/* Evergreen Gelateria – Allergens page */

/* Typeface */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Palette & tokens */
:root {
  --brand: #00321C;
  --brand-600: #0A3E29;
  --cream: #FDF1D7;

  --bg: var(--cream);
  --card: #ffffff;
  --text: var(--brand);
  --muted: #4B6357;
  --ring: rgba(0, 50, 28, 0.35);
  --border: #E8DEC7;
  --shadow: 0 10px 25px rgba(0,0,0,0.07);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout shell */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header + logo */
.appbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--brand);
  font-size: 20px;
  width: 100%;
}

.logo {
  height: 250px;
  width: auto;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 50, 28, 0.15);
}

/* Main card */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.title {
  margin: 0 0 12px;
  font-size: 27px;
  color: var(--brand);
  text-align: center;
}

.stack {
  display: grid;
  gap: 12px;
}

/* Footer */
.footer {
  margin: auto 0 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Accessibility focus */
:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 8px;
}

/* ---------- Table ---------- */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

/* Desktop / tablet layout */
.table--stack th,
.table--stack td {
  padding: 8px 12px;
}

/* keep Flavour left, center other columns */
.table--stack th:first-child,
.table--stack td:first-child {
  text-align: left;
}

.table--stack th:nth-child(n + 2),
.table--stack td:nth-child(n + 2) {
  text-align: center;
}

/* extra spacing + soft separators */
.table thead th {
  padding: 14px 8px;
}

.table tbody tr td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
}

.table thead tr {
  border-bottom: 4px solid var(--border);
}

.flavour-search {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.flavour-search input {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  min-width: 180px;
}

.flavour-search button {
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: #00321c;
  color: white;
  font-size: 14px;
}

.flavour-search .clear-btn {
  background: #ffffff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.search-message {
  font-size: 12px;
  color: var(--muted);
}

.table--stack tbody tr.highlight-row {
  background-color: rgba(0, 50, 28, 0.04);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.flavour-search .clear-btn {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.legend-icon {
  vertical-align: -4px;   /* move icon down slightly */
}

@media (min-width: 641px) {
  /* draw a full rectangle around the row via its cells */
  .table--stack tbody tr.highlight-row td {
    border-top: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
  }

  .table--stack tbody tr.highlight-row td:first-child {
    border-left: 2px solid var(--brand);
    border-radius: 12px 0 0 12px;
  }

  .table--stack tbody tr.highlight-row td:last-child {
    border-right: 2px solid var(--brand);
    border-radius: 0 12px 12px 0;
  }
}

@media (max-width: 640px) {

  /* remove desktop-style row separators */
  .table tbody tr {
    border-bottom: none;
  }

  .flavour-search {
    gap: 6px;
    align-items: center;
  }

  /* label takes full width on its own line */
  .flavour-search label {
    flex: 0 0 100%;
    font-weight: 600;
  }

  /* input grows to fill space, rounded pill */
  /* input grows, but not too much */
  .flavour-search input {
    flex: 0 0 50%;              /* about 60% of the row */
    min-width: 0;
    padding: 4px 10px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-right: 15px;
  }


  /* buttons stay their natural width, same height as input */
  .flavour-search button {
    flex: 0 0 auto;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
  }

  .flavour-search .clear-btn {
    /* keep outline style from base, just same height & centering */
    background: #ffffff;
  }

  .table--stack thead {
    display: none;
  }

  .table--stack tbody {
    display: block;
  }

  /* base card style for every flavour row */
  .table--stack tbody tr {
    display: block;
    margin: 10px 0;
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);   /* normal beige card border */
  }

  /* HIGHLIGHTED CARD – this MUST come AFTER the base rule */
  .table--stack tbody tr.highlight-row {
    border: 2px solid var(--brand);    /* full green outline, all sides */
    box-shadow: 0 10px 25px rgba(0,0,0,0.07); /* keep nice shadow */
  }

  .table--stack tbody tr td {
    display: block;
  }

  /* base style for all responsive cells */
  .table--stack tbody td.cell {
    position: relative;
    display: block;
    padding: 10px 5px 10px 150px; /* space on the left for the label */
    text-align: center;           /* center content (text or icon) */
  }

  /* label on the left side */
  .table--stack tbody td.cell::before {
    content: attr(data-label);
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 650;
    color: var(--muted);
    text-align: left;
    width: 120px;
  }

  /* first row (Flavour) behaves differently */
  .table--stack tbody td.cell.cell--flavour {
    padding-left: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 20px;
  }

  .table--stack tbody td.cell.cell--flavour::before {
    content: none;
  }

  .table--stack tbody td.cell.cell--allergen img,
  .table--stack tbody td.cell.cell--allergen svg {
    display: inline-block;
    vertical-align: middle;
  }
}




/* Ultra-small phones: slightly narrower label column */
@media (max-width: 360px) {
  .table--stack tbody td {
    grid-template-columns: 96px 1fr;
  }
}
