@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@400;500;600;700;800&family=Rubik:wght@500;600;700;800;900&display=swap');

/* ═══ Tokens ═══════════════════════════════════════════
   Light is the base: every color is defined on bare :root.
   Dark redefines the same names, nothing else. */
:root {
  color-scheme: light;

  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f7f5ef;
  --ink: #10201b;
  --ink-2: #35473f;
  --muted: #64756e;
  --line: #e4e1d7;
  --line-strong: #d0ccbf;

  --band: #0b3b2c;
  --band-ink: #eef6ec;
  --band-muted: #a8c9b8;
  --green: #126a4f;
  --green-ink: #ffffff;
  --green-soft: #e6f1e9;
  --lime: #d4f75f;
  --lime-ink: #1d2c13;

  --best: #0f7a52;
  --best-soft: #e2f2e9;
  --high: #b8503b;
  --high-soft: #fbeae5;
  --promo: #96641a;
  --promo-soft: #fbf0da;

  --focus: #4d7a12;
  --shadow-1: 0 1px 2px #1b342a0f;
  --shadow-2: 0 6px 20px -8px #1b342a2e;
  --shadow-3: 0 24px 50px -18px #0d2b2147;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --font-display: Rubik, Heebo, system-ui, sans-serif;
  --font-ui: Assistant, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --pad: clamp(16px, 5vw, 56px);
  --shell: 1360px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1512;
    --surface: #16211c;
    --surface-2: #1c2823;
    --ink: #ecf3ef;
    --ink-2: #bacdc4;
    --muted: #8ca39a;
    --line: #27342e;
    --line-strong: #3a4a43;

    --band: #081d16;
    --band-ink: #eaf5ef;
    --band-muted: #8fb3a2;
    --green: #4fc196;
    --green-ink: #06231a;
    --green-soft: #143025;

    --best: #56cf9c;
    --best-soft: #133126;
    --high: #f0906e;
    --high-soft: #33211c;
    --promo: #ddad63;
    --promo-soft: #2d2418;

    --focus: #b7e336;
    --shadow-1: 0 1px 2px #0006;
    --shadow-2: 0 6px 20px -8px #0008;
    --shadow-3: 0 24px 50px -18px #000a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1512;
  --surface: #16211c;
  --surface-2: #1c2823;
  --ink: #ecf3ef;
  --ink-2: #bacdc4;
  --muted: #8ca39a;
  --line: #27342e;
  --line-strong: #3a4a43;

  --band: #081d16;
  --band-ink: #eaf5ef;
  --band-muted: #8fb3a2;
  --green: #4fc196;
  --green-ink: #06231a;
  --green-soft: #143025;

  --best: #56cf9c;
  --best-soft: #133126;
  --high: #f0906e;
  --high-soft: #33211c;
  --promo: #ddad63;
  --promo-soft: #2d2418;

  --focus: #b7e336;
  --shadow-1: 0 1px 2px #0006;
  --shadow-2: 0 6px 20px -8px #0008;
  --shadow-3: 0 24px 50px -18px #000a;
}

/* ═══ Base ═════════════════════════════════════════════ */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-word, .price, .total-amount { font-family: var(--font-display); }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button, a, select { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--lime);
  color: var(--lime-ink);
  border-radius: var(--r-pill);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus { inset-inline-start: 12px; }

/* ═══ Header ═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: 62px;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-word { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--lime);
  color: var(--lime-ink);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }

.site-nav {
  display: flex;
  gap: 3px;
  margin-inline-end: auto;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

.site-nav button {
  padding: 7px 15px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav button:hover { color: var(--ink); }

.site-nav .nav-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.header-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-inline-start: auto; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.version {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  white-space: nowrap;
}

/* ═══ Layout shell ═════════════════════════════════════ */
main { max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad) 40px; }

/* ═══ Hero ═════════════════════════════════════════════
   The band carries the promise; the two fields under it are
   the product. Nothing between them competes for attention. */
.hero {
  position: relative;
  margin: 18px 0 22px;
  padding: 36px clamp(22px, 4vw, 48px) 28px;
  background: var(--band);
  color: var(--band-ink);
  border-radius: var(--r-lg);
  overflow: visible;
}

.hero-copy { min-width: 0; }

h1 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 10px 0 0;
  max-width: 42ch;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--band-muted);
}

/* ── Finder ─────────────────────────────────────────── */
.finder {
  grid-column: 1 / -1;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: stretch;
  margin-top: 30px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
}

/* City menu must stack above the branch chip (.toolbar is z-index 20).
   Raising the whole finder creates the stacking context the menu needs. */
.finder:focus-within,
.finder:has(#cityMenu:not([hidden])) {
  z-index: 55;
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 14px 20px;
  min-height: 74px;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.region {
  position: relative;
  width: 280px;
  flex-shrink: 0;
  border-inline-end: 1px solid var(--line);
}

.region-input { display: flex; align-items: center; gap: 6px; min-width: 0; }

.search { flex: 1; }
.search-input { display: flex; align-items: center; gap: 10px; min-width: 0; }
.search-icon { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0; }

.finder input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  padding: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.region input { font-size: 16px; }
.finder input::placeholder { color: var(--muted); font-weight: 400; }

#clearCity {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

#clearCity:hover { color: var(--high); background: var(--high-soft); }
#clearCity[hidden] { display: none; }

/* ── City combobox ──────────────────────────────────── */
.city-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  inset-inline: -12px;
  max-height: min(340px, 52svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  scrollbar-width: thin;
}

.city-menu[hidden] { display: none; }

.city-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-align: right;
}

.city-option:hover { background: var(--surface-2); }

.city-option[aria-selected="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.city-option strong { font-size: 14px; font-weight: 700; min-width: 0; }
.city-option mark { background: var(--lime); color: var(--lime-ink); border-radius: 3px; padding: 0 1px; }
.city-option span { flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }

.city-option span.latin {
  direction: ltr;
  letter-spacing: 0.04em;
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Localities with no connected branch stay pickable but quieter */
.city-option:has(.latin) strong { font-weight: 500; color: var(--muted); }

.city-menu-note { padding: 8px 11px 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.city-menu-empty { padding: 14px 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
/* ── Provenance: one quiet line, not a stack of badges ── */
.datanote {
  margin: 4px 0 22px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.datanote strong { font-weight: 600; color: var(--ink-2); }


/* ═══ Status banner ════════════════════════════════════ */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--promo);
  background: var(--promo-soft);
  border: 1px solid color-mix(in srgb, var(--promo) 28%, transparent);
  border-radius: var(--r-sm);
}

.banner[hidden] { display: none; }

.banner::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.35; } }

/* ═══ Toolbar ══════════════════════════════════════════ */
.toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.branch-picker { position: relative; min-width: 0; flex-shrink: 1; }
.branch-picker[open] { z-index: 60; }

.stores-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 16px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stores-chip::-webkit-details-marker { display: none; }
.stores-chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }

.stores-dots { display: flex; flex-shrink: 0; }

.stores-dots i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-inline-start: -8px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--green-soft);
  color: var(--green);
  font: 700 10px/1 var(--font-ui);
  font-style: normal;
}

.stores-dots i:first-child { margin-inline-start: 0; }
.stores-dots i.more { background: var(--surface-2); color: var(--muted); }

.stores-text { display: flex; flex-direction: column; min-width: 0; }
.stores-text strong { font-size: 14px; font-weight: 700; line-height: 1.3; }
.stores-text small { font-size: 11.5px; color: var(--muted); }

.chev { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; transition: transform 0.2s; }
.branch-picker[open] .chev { transform: rotate(180deg); }

.toolbar-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; flex-shrink: 0; }

#resultCount { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.sort-field {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
}

.sort-field > span { color: var(--muted); font-weight: 500; flex-shrink: 0; }

.toolbar-end .site-nav { margin: 0; }
.toolbar-end .site-nav button { padding: 5px 12px; font-size: 12.5px; }

.sort-field select {
  border: 0;
  outline: 0;
  background: none;
  font-size: 13px;
  font-weight: 500;
  max-width: 190px;
  cursor: pointer;
}

/* ── Branch picker panel ────────────────────────────── */
.picker-panel {
  position: absolute;
  z-index: 50;
  inset-inline: 0;
  top: calc(100% + 10px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.picker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.picker-tools label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.picker-tools input,
.picker-tools select {
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.branch-search { flex: 1; min-width: 180px; }
.picker-tools .branch-search input { width: 100%; }

.picker-tools button {
  padding: 9px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.picker-tools button:hover { background: var(--green-soft); border-color: var(--green); color: var(--green); }

.directory-count { padding: 10px 18px 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.branch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 6px;
  padding: 12px 18px;
  max-height: 46svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.branch-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.branch-option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.branch-option.chosen { border-color: var(--green); background: var(--green-soft); }

.branch-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); flex-shrink: 0; }
.branch-option > span { display: flex; flex-direction: column; min-width: 0; }
.branch-option strong { font-size: 13.5px; font-weight: 700; }
.branch-option span span { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.branch-option small { margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--green); }

.branch-list > .empty,
.basket-items .empty {
  grid-column: 1 / -1;
  padding: 28px 18px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.branch-list > .empty strong,
.basket-items .empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--ink);
}

.picker-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.primary {
  padding: 11px 22px;
  background: var(--green);
  color: var(--green-ink);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.15s, transform 0.1s;
}

.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.45; cursor: default; filter: none; }

.picker-note { margin: 0; padding: 0 18px 16px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

/* ═══ Active branch strip ══════════════════════════════ */
.active-branches {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}

.active-branches-label {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.active-branches-label small { font-size: 10.5px; font-weight: 500; color: var(--muted); }

.categories {
  display: flex;
  flex: 1;
  gap: 7px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar { display: none; }

.categories button {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.categories button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.categories button.pending { color: var(--muted); border-style: dashed; }
.no-branches { padding: 7px 2px; color: var(--muted); font-size: 12.5px; }

/* ═══ Workspace ════════════════════════════════════════ */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 26px;
  align-items: start;
}

/* ═══ Product cards ════════════════════════════════════ */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product:not(.skeleton):hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.product-top { display: flex; gap: 14px; align-items: flex-start; padding: 16px 16px 12px; }

.product-media {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.product-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
:root[data-theme="dark"] .product-media img { mix-blend-mode: normal; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-media img { mix-blend-mode: normal; }
}

.product-media span { font-size: 22px; opacity: 0.45; }
.product-head { min-width: 0; flex: 1; }
.product h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.product-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.product-barcode { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.product-barcode > span { font-weight: 600; }
.product-barcode bdi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.03em; color: var(--ink); user-select: all; }
.product-barcode[data-kind="unverified"] bdi, .product-barcode[data-kind="internal"] bdi { color: var(--muted); font-weight: 600; }

/* ── Price block: one number leads, everything else defers ── */
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 0;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.price .currency { font-size: 16px; font-weight: 500; color: var(--muted); }

.price-at {
  margin: 5px 0 0;
  padding: 0 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.save-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--best-soft);
  color: var(--best);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Footnote row: how wide the spread is, and whether a promo exists */
.card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 9px 16px 14px;
  font-size: 12px;
  color: var(--muted);
}

.card-foot:empty { padding: 0 0 6px; }

.promo-label {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--promo-soft);
  color: var(--promo);
  font-size: 11px;
  font-weight: 600;
}

.stale-note {
  margin: 0 16px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}


.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.add {
  flex: 1;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 700;
  transition: filter 0.15s, transform 0.1s;
}
.add.is-adding {
  animation: addPulse 650ms ease-out;
  pointer-events: none;
}
.add:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}
.add:disabled:hover { filter: none; }

.add:hover { filter: brightness(1.25); }
.add:active { transform: translateY(1px); }

@keyframes addPulse {
  0% { transform: scale(0.985); }
  55% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.compare {
  padding: 9px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.compare:hover { color: var(--ink); background: var(--surface); }
.card-actions .meta { font-size: 12px; color: var(--muted); }

.favorite {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  transition: color 0.15s, transform 0.1s, background 0.15s;
}
.favorite:hover { color: #c0392b; background: var(--surface); }
.favorite.is-on { color: #c0392b; }
.favorite.is-on:active,
.favorite:active { transform: scale(0.9); }

#favoritesToggle.is-on { border-color: #c0392b; color: #c0392b; }

.load-more {
  display: block;
  margin: 24px auto 0;
  padding: 12px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.load-more:hover { border-color: var(--green); color: var(--green); }
.load-more[hidden] { display: none; }

.no-results {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}

.no-results strong { color: var(--ink); font-size: 16px; }

.browse-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}

.browse-note strong { color: var(--ink); font-size: 14.5px; }

/* Legal note: present on every surface, loud on none of them */
.price-disclaimer {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

#priceDisclaimer { margin: -14px 0 22px; max-width: 78ch; }

/* ═══ Skeletons ════════════════════════════════════════ */
.sk {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 320% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-xs);
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.product.skeleton { pointer-events: none; }
.sk-media { width: 66px; height: 66px; border-radius: var(--r-sm); flex-shrink: 0; }
.sk-line { height: 11px; margin-bottom: 8px; }
.sk-line.w-80 { width: 80%; }
.sk-line.w-55 { width: 55%; }
.sk-price { height: 28px; width: 46%; margin: 4px 16px 12px; }
.sk-bar { height: 7px; margin: 6px 23px 20px; border-radius: var(--r-pill); }
.sk-foot { height: 38px; margin: 0 14px 12px; border-radius: var(--r-pill); }
.sk-row { height: 46px; margin-bottom: 6px; border-radius: var(--r-sm); }

/* ═══ Basket ═══════════════════════════════════════════ */
.basket {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.basket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.basket-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; font-size: 17px; font-weight: 700; }
.basket-actions { display: flex; align-items: center; gap: 6px; }
.basket-close { display: none; }

#basketCount {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
}

.basket:has(.total-row) #basketCount { background: var(--lime); color: var(--lime-ink); }

.basket-head button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--r-xs);
}

.basket-head button:hover { color: var(--high); background: var(--high-soft); }

.basket-totals:not(:empty) { padding: 14px 14px 4px; }

.total-heading {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13.5px;
}

.total-row > div { min-width: 0; }
.total-row strong { font-weight: 700; }
.total-row .meta { font-size: 11.5px; color: var(--muted); }
.total-row small { display: block; margin-top: 3px; font-size: 11px; color: var(--promo); font-weight: 600; }

.missing-products { margin-top: 4px; color: var(--promo); font-size: 11px; }
.missing-products summary { cursor: pointer; font-weight: 700; }
.missing-products ul { margin: 5px 0 0; padding-inline-start: 17px; color: var(--muted); }
.missing-products li { margin-top: 2px; }

.total-amount { font-size: 17px; font-weight: 800; white-space: nowrap; text-align: left; }
.total-amount .delta { display: block; font-size: 11px; font-weight: 600; color: var(--high); font-family: var(--font-ui); }

.total-row.best { background: var(--best-soft); border-color: var(--best); }
.total-row.best .total-amount { color: var(--best); }

.best-flag {
  display: inline-block;
  margin-bottom: 3px;
  margin-inline-end: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--best);
  color: var(--surface);
  font-size: 10px;
  font-weight: 800;
}

.basket-items:not(:empty) { padding: 8px 14px 4px; }

.basket-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.basket-item:last-child { border-bottom: 0; }
.basket-item strong { font-weight: 600; min-width: 0; }

.quantity {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

.quantity button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
}

.quantity button:hover { background: var(--surface); color: var(--green); }
.quantity span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 700; }

.basket-note {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ═══ Mobile basket dock ═══════════════════════════════ */
.basket-dock {
  position: fixed;
  z-index: 45;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-3);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.basket-dock[hidden] { display: none; }

.dock-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 12.5px;
  font-weight: 800;
}

.dock-text { flex: 1; min-width: 0; }
.dock-go { opacity: 0.7; }

.basket-backdrop { display: none; }

/* ═══ Footer ═══════════════════════════════════════════ */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}

.footer-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand p { margin: 0; font-size: 13.5px; color: var(--muted); }

.ghost {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.ghost:hover { border-color: var(--green); color: var(--green); }

/* ═══ Dialog ═══════════════════════════════════════════ */
dialog {
  width: min(620px, 92vw);
  max-height: 88svh;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
}

dialog::backdrop { background: #05130ea8; backdrop-filter: blur(3px); }

dialog .close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
}

dialog .close:hover { color: var(--ink); background: var(--line); }

/* The panel scrolls under the close button, so it needs to read as floating
   and the header must not run beneath it. */
dialog .close { box-shadow: 0 0 0 4px var(--surface); }
#detailContent > .eyebrow,
#detailContent > h2 { padding-inline-start: 46px; }

#detailContent {
  max-height: 88svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 28px 28px;
}

#detailContent .eyebrow { color: var(--green); }
#detailContent h2 { margin: 0 0 6px; font-size: 23px; font-weight: 800; }
#detailContent > p { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
#detailContent > p:last-child { font-size: 12.5px; color: var(--muted); }

.offer-detail {
  margin: 14px 0;
  padding: 15px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.detail-row strong:last-child { font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.offer-detail p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

.source-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }

.source-links a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.source-links a { border-bottom: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.source-links a:hover { border-bottom-color: currentColor; }

.source-name {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  word-break: break-all;
  opacity: 0.75;
}

/* The product dialog opens on the active branches; this lookup reaches the rest. */
.branch-lookup {
  margin: 16px 0 6px;
  padding: 14px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.branch-lookup > label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.branch-lookup-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.branch-lookup-field:focus-within { border-color: var(--green); }

.branch-lookup-field input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.branch-lookup-field input:focus { outline: none; }
.branch-lookup-field input::-webkit-search-cancel-button { display: none; }

.branch-lookup-field button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.branch-lookup-field button:hover { background: var(--line); color: var(--ink); }

.branch-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
#detailBranches .branch-hint { margin: 16px 0 4px; font-weight: 600; }

.offer-detail.offer-outside { border-inline-start: 3px solid var(--green); }
.offer-detail p.offer-flag { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; color: var(--green); }
.offer-detail.offer-empty { background: transparent; border-style: dashed; }
.offer-noprice { font-size: 12px; font-weight: 700; color: var(--muted); }

.offer-detail button[data-addstore] {
  padding: 9px 15px;
  background: var(--green);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-ink);
}

.offer-detail button[data-addstore]:hover { filter: brightness(1.1); }

#detailBranches > .empty {
  padding: 26px 8px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

#detailBranches > .empty strong { display: block; margin-bottom: 6px; font-size: 15px; color: var(--ink); }

.source-summary { margin: 14px 0; padding: 15px 16px; background: var(--green-soft); border-radius: var(--r-md); }
.source-summary strong { display: block; margin-bottom: 5px; font-size: 15px; }
.source-summary span { font-size: 13px; line-height: 1.65; color: var(--ink-2); }

.source-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.source-directory button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  text-align: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.source-directory button:hover { border-color: var(--green); background: var(--surface); }
.source-directory strong { font-size: 13.5px; line-height: 1.35; color: var(--ink); }
.source-directory span { font-size: 11.5px; line-height: 1.45; color: var(--muted); font-weight: 400; }

.promo-detail { margin-top: 12px; padding: 13px 14px; background: var(--promo-soft); border-radius: var(--r-sm); }
.promo-detail strong { font-size: 13.5px; color: var(--promo); }
.promo-detail p { margin: 6px 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.promo-detail small { font-size: 11px; color: var(--muted); }
.promo-detail a { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--promo); }

/* ═══ Toast ════════════════════════════════════════════ */
#toast {
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  bottom: 28px;
  margin: 0 auto;
  width: fit-content;
  max-width: 88vw;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-3);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}

#toast.show { opacity: 1; transform: translateY(0); }

/* ═══ Responsive ═══════════════════════════════════════ */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
}

@media (max-width: 900px) {
  .hero { padding-top: 28px; }
  .finder { flex-direction: column; margin-top: 22px; }
  /* Both fields read the same way once they stack: label, then input */
  .search {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 20px;
  }
  .search .field-label { flex-shrink: 0; }
  .search-input { flex: 1; }
  .region {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 20px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }
  .region .field-label { flex-shrink: 0; }
  .region-input { flex: 1; }
  .region input { flex: 1; }
  .city-menu { inset-inline: 0; }

  .workspace { grid-template-columns: 1fr; gap: 22px; }
  .basket {
    position: fixed;
    z-index: 70;
    inset-inline: 0;
    top: auto;
    bottom: 0;
    max-height: min(82svh, 720px);
    overflow-y: auto;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--shadow-3);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.24s ease;
  }
  body.basket-open { overflow: hidden; }
  body.basket-open .basket { transform: translateY(0); visibility: visible; }
  body.basket-open .basket-dock { visibility: hidden; }
  .basket-head { align-items: stretch; }
  .basket-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 200px;
    max-width: 220px;
  }
  .basket-head .basket-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .basket-close { display: inline-flex; }
  .basket-backdrop:not([hidden]) {
    position: fixed;
    z-index: 69;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: #05130e9c;
  }
  .basket-dock { display: flex; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 760px) {
  .site-header { position: static; }
  .header-bar { flex-wrap: wrap; gap: 8px 12px; min-height: 56px; padding-block: 8px; }
  .header-bar > .brand, footer .brand { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .header-end { margin-inline-start: auto; }

  .hero { margin-top: 12px; padding: 26px 20px 20px; border-radius: var(--r-md); }
  .hero-sub { margin-top: 12px; font-size: 15px; }
  .finder input { font-size: 16px; }
  #clearCity { width: 44px; height: 44px; }

  .datanote { margin-bottom: 16px; font-size: 12px; }

  .toolbar { flex-wrap: wrap; gap: 8px; }
  .branch-picker { width: 100%; }
  .stores-chip { flex: 1; min-height: 46px; }
  .toolbar-end { width: 100%; margin-inline-start: 0; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  #resultCount { width: 100%; }
  .toolbar-end .site-nav, .sort-field { min-height: 44px; flex: 1; }
  .toolbar-end .site-nav button { flex: 1; min-height: 36px; text-align: center; }
  .sort-field select { max-width: 150px; font-size: 14px; }

  .active-branches { align-items: flex-start; flex-direction: column; gap: 6px; }
  .categories { width: 100%; }

  .picker-tools { padding: 14px; }
  .picker-tools label, .branch-search { width: 100%; min-width: 0; }
  .picker-tools input, .picker-tools select { width: 100%; font-size: 16px; min-height: 44px; }
  .picker-tools button { flex: 1; min-height: 44px; }
  .branch-list { grid-template-columns: 1fr; max-height: 52svh; padding: 12px 14px; }
  .branch-option { padding-block: 13px; }
  .branch-option input { width: 21px; height: 21px; }
  .picker-bottom { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
  .picker-bottom .primary { min-height: 46px; }

  .products { grid-template-columns: 1fr; }
  .product-media { width: 76px; height: 76px; }
  .add, .compare, .load-more, .ghost { min-height: 44px; }
  .categories button, .basket-head button { min-height: 44px; }
  .basket-head button { min-width: 44px; }
  .quantity button { width: 44px; height: 44px; }
  .city-option { padding-block: 12px; }
  .city-option strong { font-size: 15px; }

  dialog .close { width: 44px; height: 44px; top: 10px; inset-inline-start: 10px; }
  #detailContent { padding: 22px 18px 24px; }
  .branch-lookup-field input { font-size: 16px; min-height: 44px; }
  .branch-lookup-field button { width: 40px; height: 40px; }
  .offer-detail button[data-addstore] { width: 100%; min-height: 44px; }
  .source-directory { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand-word { font-size: 22px; }
  h1 { font-size: 32px; }
  .stores-text strong { font-size: 13px; }
  .price { font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .banner::before { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --line: var(--line-strong); --muted: var(--ink-2); }
  .product, .stores-chip, .total-row { border-width: 2px; }
}

/* Refreshing an already-populated grid dims it instead of clearing it */
.products[aria-busy="true"]:not(:has(.skeleton)) { opacity: 0.5; }

/* ═══ Selection scope ══════════════════════════════════ */
.banner.warn {
  color: var(--high);
  background: var(--high-soft);
  border-color: color-mix(in srgb, var(--high) 34%, transparent);
}

.banner.warn::before { animation: none; }

.banner-action {
  margin-inline-start: 8px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--high);
  color: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  transition: filter 0.15s;
}

.banner-action:hover { filter: brightness(1.1); }

.chip-spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.branch-picker[data-applying] .chip-spinner { display: block; }
.branch-picker[data-applying] .chev { display: none; }
.branch-picker[data-applying] .stores-chip { pointer-events: none; opacity: 0.75; }

/* ═══ Image provenance ═════════════════════════════════ */
.image-credit {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.image-credit img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--surface);
  border-radius: var(--r-sm);
}

.image-credit > div { min-width: 0; }
.image-credit strong { font-size: 13px; }
.image-credit p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.image-credit a { color: var(--green); font-weight: 600; text-decoration: none; }
.image-credit a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .chip-spinner { animation: none; } }

.basket-item-name { display: flex; flex-direction: column; min-width: 0; }
.basket-item-name small { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--high); }

.product-media .image-unavailable { font: 12px/1.4 var(--font-ui); opacity: 1; color: var(--muted); text-align: center; }

/* A product without a photograph still fills its tile, so a list never reads
   as half-illustrated.  The hue is derived from the barcode, so the same
   product keeps the same tile on every screen and across reloads. */
.product-media .product-monogram {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 1;
  font: 700 23px/1 var(--font-ui);
  letter-spacing: 0.5px;
  color: hsl(var(--mono-h, 150) 42% 30%);
  background: linear-gradient(145deg, hsl(var(--mono-h, 150) 52% 93%), hsl(var(--mono-h, 150) 46% 84%));
}
:root[data-theme="dark"] .product-media .product-monogram {
  color: hsl(var(--mono-h, 150) 55% 82%);
  background: linear-gradient(145deg, hsl(var(--mono-h, 150) 28% 26%), hsl(var(--mono-h, 150) 30% 19%));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-media .product-monogram {
    color: hsl(var(--mono-h, 150) 55% 82%);
    background: linear-gradient(145deg, hsl(var(--mono-h, 150) 28% 26%), hsl(var(--mono-h, 150) 30% 19%));
  }
}
.image-credit .product-monogram { width: 64px; height: 64px; border-radius: var(--r-sm); font-size: 22px; }

/* ═══ Product facts (OFF nutrition) ═══════════════════ */
.product-facts {
  margin: 18px 0 20px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.product-facts h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.product-facts h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.nutri-grade {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.nutri-grade.nutri-a { background: #1e8f4e; color: #fff; border-color: transparent; }
.nutri-grade.nutri-b { background: #64b544; color: #fff; border-color: transparent; }
.nutri-grade.nutri-c { background: #d4b000; color: #1a1a1a; border-color: transparent; }
.nutri-grade.nutri-d { background: #e67e22; color: #fff; border-color: transparent; }
.nutri-grade.nutri-e { background: #c0392b; color: #fff; border-color: transparent; }
.nutrient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.nutrient-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.nutrient-list li span { color: var(--muted); }
.nutrient-list li strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.facts-per { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.facts-block p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.facts-source {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}
.facts-source:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .nutrient-list { grid-template-columns: 1fr; }
}


/* ═══ Data notice ══════════════════════════════════════ */
.datanote .trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 4px;
}
.datanote .stat-flag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.datanote .stat-checked { font-size: 12.5px; color: var(--muted); }
.datanote .stat-numbers {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.source-points {
  margin: 16px 0;
  padding: 0;
  padding-inline-start: 1.1em;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
}


/* ═══ Account ══════════════════════════════════════════ */
.account-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
}
.account-btn.is-on {
  border-color: var(--green);
  color: var(--green);
}
#headerBasketBtn { display: flex; align-items: center; gap: 6px; }
#headerBasketCount {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.auth-lead { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.auth-field input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  /* dir="ltr" keeps an email/password typed correctly left-to-right, but the
     text (and the empty placeholder) should still hug the right edge like
     every other right-aligned field on this RTL page. */
  text-align: right;
}
.auth-field input::placeholder { text-align: right; }
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
/* The base button rule strips border and background, so every secondary action
   here needs the outline back. .primary and .danger keep their own fills. */
.auth-actions button:not(.primary):not(.danger) {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.auth-actions button:not(.primary):not(.danger):hover { border-color: var(--green); color: var(--green); }
.auth-actions button:disabled { opacity: 0.45; cursor: default; }
.auth-actions button:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.auth-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--high-soft);
  color: var(--high);
  font-size: 13.5px;
}
.auth-email { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
#authDialog { max-width: 460px; width: calc(100% - 32px); }
.auth-pane { padding: 26px 22px 22px; }
.auth-pane > h2 { margin: 0 0 8px; padding-inline-start: 46px; }
.auth-fine { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* Sign in / sign up share one form; the tabs only relabel the action, so the
   shopper never loses what they typed by switching. */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}
.auth-tab.is-on { background: var(--surface); color: var(--green); box-shadow: var(--shadow-1); }

.account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-inline-start: 46px;
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}
.account-head .auth-email { margin: 0; word-break: break-all; }
.account-head .auth-fine { margin: 2px 0 0; }

.account-card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.account-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.account-card > h3 { margin-bottom: 10px; }
.account-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.account-card summary::-webkit-details-marker { display: none; }
.account-card summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  margin-block-end: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.account-card[open] summary::after { transform: rotate(-135deg); margin-block: 4px 0; }
.account-hint { font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.account-body { margin-top: 14px; }
.account-body .auth-field:last-of-type { margin-bottom: 14px; }
.account-card.is-danger { border-color: var(--high-soft); }
.account-card.is-danger h3 { color: var(--high); }
.account-footer { margin: 16px 0; }

.account-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 10px;
}
.account-stats div { display: flex; flex-direction: column; gap: 2px; }
.account-stats dt { font-size: 12px; color: var(--muted); }
.account-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.danger {
  border-color: var(--high);
  color: var(--high);
  background: var(--surface);
}
.danger:hover { background: var(--high); color: #fff; border-color: var(--high); }

.auth-ok {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--best-soft);
  color: var(--best);
  font-size: 13.5px;
}

@media (max-width: 520px) {
  .auth-pane { padding: 22px 16px 18px; }
  /* Touch targets stay at 44px on phones, matching the rest of the app. */
  .auth-tab, .auth-actions button { min-height: 44px; }
}

/* ── Chain page: every connected branch we hold, grouped by town ── */
.source-lead { margin: 16px 0 10px; font-size: 13.5px; color: var(--muted); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.back-link:hover { border-color: var(--line-strong); color: var(--ink); }
.chain-lead { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }

.chain-city { margin-top: 20px; }

.chain-city h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.chain-city h3 small { font-size: 11.5px; font-weight: 500; color: var(--muted); }

.chain-branch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  background: var(--surface);
}

.chain-branch > div { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.chain-branch strong { font-size: 13.5px; font-weight: 600; }
.chain-branch span { font-size: 12px; color: var(--muted); }
.chain-branch .faint { opacity: 0.7; font-style: italic; }

.chain-branch button {
  flex-shrink: 0;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface-2);
}

.chain-branch button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }

.chain-in {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--best-soft);
  color: var(--best);
  font-size: 11.5px;
  font-weight: 600;
}

.chain-note {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 760px) {
  .chain-branch { align-items: flex-start; flex-direction: column; }
  .chain-branch button { width: 100%; min-height: 40px; }
}

/* Personal shopping area and retailer directory */
.account-head{padding:26px!important;border-radius:24px;background:linear-gradient(125deg,#134e43,#267764);color:#fff;gap:18px!important;margin-bottom:22px}
.account-welcome{font-size:1.65rem;margin:0 0 8px!important;color:inherit!important}.account-head .auth-fine{color:#d9ebe5}.account-head .auth-email{overflow-wrap:anywhere}.account-avatar{background:#ffffff20!important;color:white!important;border:1px solid #ffffff40;border-radius:20px!important}
.account-stats{gap:10px!important}.account-stats>div{background:var(--surface-2);padding:16px 10px;border-radius:16px}.account-stats dd{font-size:1.4rem}.account-card{border-radius:20px!important}.account-footer{padding-block:12px}
.source-directory{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px!important}.source-directory>button{display:flex!important;align-items:center;gap:14px;padding:22px!important;border-radius:20px!important;text-align:right;min-height:122px;transition:transform .15s,border-color .15s}.source-directory>button:hover{transform:translateY(-2px);border-color:var(--line)}.chain-emblem{display:grid;place-items:center;flex:none;width:50px;height:54px;border-radius:16px;background:var(--surface-2);color:var(--ink);font-size:25px;font-weight:800}.source-directory>button:nth-child(3n+2) .chain-emblem{background:var(--surface);color:var(--ink)}.source-directory>button:nth-child(3n) .chain-emblem{background:var(--surface-2);color:var(--ink)}.chain-card-copy{display:grid;gap:7px}.chain-card-copy strong{font-size:1.1rem}.chain-card-copy small{color:var(--green,#27705a)}.chain-branch{padding-block:18px!important}
@media(max-width:520px){.source-directory{grid-template-columns:1fr}.account-head{padding:20px!important}.account-stats{flex-wrap:wrap}.account-stats>div{min-width:85px}}
@media(prefers-reduced-motion:reduce){.source-directory>button{transition:none}}

.source-directory>button{flex-direction:row;text-align:right}.source-directory>button .chain-emblem{font-size:25px;font-weight:800;color:var(--ink)}.source-directory>button .chain-card-copy{text-align:right}

.footer-links { display: flex; align-items: center; justify-content: flex-end; gap: 10px 16px; flex-wrap: wrap; }
.footer-links > a { color: var(--muted); font-size: 13px; font-weight: 600; }
.footer-links > a:hover { color: var(--green); }
.auth-fine a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

body.legal-page { min-height: 100vh; }
.legal-shell { width: min(860px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 72px; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 42px; }
.legal-back { color: var(--green); font-size: 14px; font-weight: 700; }
.legal-card { padding: clamp(24px, 5vw, 58px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-2); }
.legal-content h1 { margin: 0 0 10px; color: var(--green); font-size: clamp(30px, 5vw, 46px); line-height: 1.12; }
.legal-content h1 + p { color: var(--muted); font-size: 13px; }
.legal-content h2 { margin: 34px 0 12px; color: var(--green); font-size: 21px; line-height: 1.35; }
.legal-content p, .legal-content li { color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.legal-content ul { padding-inline-start: 24px; }
.legal-content a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
@media(max-width:600px){.legal-shell{padding-top:24px}.legal-top{margin-bottom:24px}.legal-card{border-radius:20px}.footer-links{justify-content:center}}

.account-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.account-stats>div{min-width:0}.account-stats dd{overflow-wrap:anywhere}@media(max-width:520px){.account-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.account-stats>div:last-child{grid-column:1/-1;padding-block:8px}}
/* Landing, category illustrations and account device details */
[hidden]{display:none!important}.landing-nav{display:flex;gap:26px;align-items:center;font-size:13px}.landing-nav a{color:var(--ink);text-decoration:none}.landing-nav a:hover{text-decoration:underline}.landing-splash{display:grid;grid-template-columns:1.1fr 1fr;gap:52px;padding:68px 0 56px;align-items:center}.landing-eyebrow{font-size:12px;letter-spacing:.1em;color:var(--green);font-weight:700}.landing-copy h1{font-size:clamp(38px,4.5vw,66px);line-height:1.1;letter-spacing:-2.2px;white-space:pre-line;margin:22px 0}.landing-copy>p{font-size:18px;line-height:1.85;color:var(--ink-2);max-width:500px}.landing-actions{display:flex;align-items:center;gap:25px;margin:28px 0}.landing-actions .primary{background:var(--site-accent,#175c47);color:white;border:0;border-radius:12px;padding:16px 25px;font-size:15px}.landing-actions a{color:var(--ink);text-decoration:none;font-weight:600}.landing-proof{display:flex;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:11px}.landing-proof span:before{content:'✓';color:var(--green);margin-left:5px}.landing-art{height:365px;position:relative;background:var(--surface);border-radius:120px 32px 120px 32px;overflow:hidden}.art-ring{position:absolute;width:340px;height:340px;border:1px solid var(--line);border-radius:50%;top:16px;left:50%;transform:translateX(-50%)}.grocery{position:absolute;box-shadow:0 16px 24px color-mix(in srgb, var(--ink) 14%, transparent);width:125px;height:140px;background:var(--surface-2);border-radius:24px}.grocery img{width:100%;height:100%;object-fit:contain}.grocery-milk{right:40px;top:28px;transform:rotate(12deg)}.grocery-bread{left:43px;top:42px;transform:rotate(-15deg)}.grocery-produce{left:38%;top:100px;transform:rotate(-4deg)}.basket-emblem{position:absolute;bottom:27px;left:50%;transform:translateX(-50%);background:var(--green);color:var(--surface);display:flex;align-items:center;gap:16px;padding:22px 27px;border-radius:24px;width:280px;font-size:25px;font-weight:750;line-height:1.25;box-shadow:0 10px 30px color-mix(in srgb, var(--ink) 18%, transparent)}.basket-emblem img{width:58px;height:58px;object-fit:contain}.art-note{position:absolute;right:14px;bottom:29px;font-size:10px;color:var(--muted);writing-mode:vertical-rl}.landing-metrics{display:grid;grid-template-columns:repeat(3,1fr) 1.5fr;gap:25px;align-items:center;padding:26px 0;border-block:1px solid var(--line);margin-bottom:32px}.landing-metrics>div{display:grid;gap:5px}.landing-metrics strong{font-size:28px;letter-spacing:-1px}.landing-metrics span,.landing-metrics p{font-size:12px;color:var(--muted);line-height:1.8}.landing-section{padding:40px 0}.section-intro h2{font-size:28px;margin:0 0 12px;letter-spacing:-.6px}.section-intro>p{font-size:14px;color:var(--ink-2);line-height:1.9;max-width:700px;white-space:pre-line}.how-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:30px;margin-top:25px}.how-grid article{padding:25px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}.step-number{font-family:serif;color:var(--green);font-size:26px}.how-grid h3{font-size:16px;margin:18px 0 9px}.how-grid p{font-size:13px;line-height:1.8;color:var(--muted)}.aisle-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:22px}.aisle-grid button{display:grid;text-align:right;gap:8px;padding:15px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink)}.aisle-grid img{width:100%;height:140px;object-fit:contain;border-radius:14px}.aisle-grid span{font-size:15px;font-weight:650}.aisle-grid small{font-size:11px;color:var(--muted)}.block-text{border-radius:24px;padding:32px;background:var(--green-soft);margin:24px 0}.faq-list{display:grid;gap:10px;margin-top:20px}.faq-list details{padding:18px 20px;border:1px solid var(--line);border-radius:13px;background:var(--surface)}.faq-list summary{cursor:pointer;font-size:14px;font-weight:600}.faq-list p{font-size:13px;line-height:1.9;color:var(--ink-2);white-space:pre-line}.hero h2{font-size:28px;margin:0 0 10px}.browse-entry{margin:15px 0 28px}.browse-entry button{border:0;background:none;color:var(--green);font-weight:600}.shopping-mode .landing-splash,.shopping-mode .landing-metrics,.shopping-mode #landingBlocks{display:none}.product-illustration{display:grid;justify-items:center;width:100%;height:100%;background:var(--surface-2);border-radius:14px;overflow:hidden}.product-media .product-illustration img{width:100%;height:calc(100% - 16px);min-height:0;object-fit:contain;mix-blend-mode:normal;padding:0}.product-illustration small{font-size:8px;color:var(--muted);line-height:16px}.image-credit .product-illustration{width:100px;height:115px}.image-credit .product-illustration img{width:100%;height:96px}.device-row{border-top:1px solid var(--line);padding:14px 0}.device-row strong{font-size:13px}.device-row p{margin:5px 0;font-size:11px;color:var(--muted);line-height:1.7}.device-current{font-size:10px;color:var(--green);margin-inline-start:8px}.admin-entry{display:inline-block;padding:12px 16px;border-radius:10px;background:var(--green-soft);color:var(--green);margin-block:10px}
@media(max-width:800px){.landing-nav{display:none}.landing-splash{gap:24px;padding:35px 0;grid-template-columns:1fr}.landing-copy h1{font-size:44px}.landing-art{height:300px}.landing-metrics{grid-template-columns:repeat(3,1fr);gap:14px}.landing-metrics>p{display:none}.how-grid{grid-template-columns:1fr;gap:12px}.how-grid article{padding:20px}.aisle-grid{grid-template-columns:repeat(2,1fr)}.landing-section{padding:26px 0}.landing-proof{gap:12px}.landing-metrics strong{font-size:24px}.landing-copy>p{font-size:16px}.landing-art .grocery{width:110px;height:120px}.basket-emblem{bottom:20px}.section-intro h2{font-size:24px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}

.product-illustration img{filter:none!important;opacity:1!important}.image-credit .product-illustration{flex:none}
.product-illustration{grid-template-rows:minmax(0,1fr) auto auto;padding:5px}.product-illustration strong{max-width:100%;font-size:9px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.product-illustration small{line-height:13px}.product-media .product-illustration img{height:100%}.product-illustration-emoji{display:grid;place-items:center;width:100%;height:100%;font-size:clamp(34px,5vw,60px);background:radial-gradient(circle,color-mix(in srgb, var(--surface-2) 84%, transparent 16%) 0 48%,transparent 49%)}
.step-number {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Real, verified product photography for landing category shortcuts. */
.aisle-grid img {
  object-fit: contain;
  padding: 10px;
  background: #f5f3eb;
}

.all-categories-link{display:inline-flex;margin-top:18px;color:var(--green);font-size:14px;font-weight:700;text-underline-offset:4px}
.category-page-shell{width:min(var(--shell),calc(100% - 2 * var(--pad)));margin:0 auto;padding:clamp(42px,7vw,90px) 0 90px}
.category-page-intro{max-width:720px;margin-bottom:38px}.category-page-intro>span{color:var(--green);font-size:13px;font-weight:700}.category-page-intro h1{font-size:clamp(38px,6vw,68px);line-height:1.1;margin:12px 0 16px}.category-page-intro p{color:var(--ink-2);font-size:18px;line-height:1.8;margin:0}.category-directory{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.category-directory-card{display:grid;grid-template-columns:108px minmax(0,1fr) auto;align-items:center;gap:18px;min-height:142px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:22px;color:var(--ink);text-decoration:none;box-shadow:var(--shadow-1);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.category-directory-card:hover{transform:translateY(-3px);border-color:var(--green);box-shadow:var(--shadow-2)}.category-directory-photo{width:108px;height:108px;display:grid;place-items:center;background:#f5f3eb;border-radius:16px;overflow:hidden}.category-directory-photo img{width:100%;height:100%;object-fit:contain;padding:8px}.category-directory-copy{display:grid;gap:7px}.category-directory-copy strong{font-family:var(--font-display);font-size:17px}.category-directory-copy small{color:var(--muted);font-size:13px;line-height:1.5}.category-directory-arrow{color:var(--green);font-size:22px}.category-nav [aria-current="page"]{color:var(--green);font-weight:700}.category-home-link{display:none;color:var(--green);font-weight:700;text-decoration:none}
@media(max-width:980px){.category-directory{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.category-home-link{display:inline-flex}.category-page-shell{padding-top:36px}.category-page-intro p{font-size:16px}}
@media(max-width:620px){.category-directory{grid-template-columns:1fr}.category-directory-card{grid-template-columns:92px minmax(0,1fr) auto;min-height:122px}.category-directory-photo{width:92px;height:92px}.category-page-intro{margin-bottom:28px}}

/* ═══ Mobile menu ═══════════════════════════════════════ */
.menu-toggle { display: none; }
@media (max-width: 800px) {
  .site-header { position: relative; }
  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink);
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s ease, opacity 0.2s ease; }
  .nav-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-header.nav-open .landing-nav {
    position: absolute;
    z-index: 45;
    top: 100%;
    inset-inline: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px var(--pad) 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    font-size: 16px;
  }
  .site-header.nav-open .landing-nav a { display: flex; align-items: center; min-height: 50px; font-weight: 600; border-bottom: 1px solid var(--line); text-decoration: none; }
  .site-header.nav-open .landing-nav a:last-child, .site-header.nav-open #customPages a:last-child { border-bottom: 0; }
  .site-header.nav-open .landing-nav a[aria-current="page"] { color: var(--green); }
  .landing-nav #customPages { display: contents; }
  /* The header scrolls away on phones, so a live blur behind it only costs frames */
  .site-header { backdrop-filter: none; background: var(--bg); }
}

/* ═══ Product search suggestions ════════════════════════ */
.search { position: relative; }
.search-menu { inset-inline: 0; }
.suggest-option { align-items: center; }
.suggest-option strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-option span { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder:has(#searchMenu:not([hidden])) { z-index: 55; }
#search { -webkit-appearance: none; appearance: none; }
#search::-webkit-search-cancel-button { cursor: pointer; }
@media (max-width: 900px) { .search-menu { top: calc(100% + 4px); } .suggest-option { min-height: 46px; } }

/* ═══ Basket: price per product ═════════════════════════ */
.total-row:has(.line-items) { flex-wrap: wrap; }
.line-items { flex-basis: 100%; margin-top: 2px; font-size: 12px; }
.line-items summary { cursor: pointer; color: var(--green); font-weight: 700; min-height: 28px; display: flex; align-items: center; }
.line-items ul { list-style: none; margin: 4px 0 0; padding: 0; }
.line-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.line-items .line-name { min-width: 0; color: var(--ink-2); line-height: 1.45; }
.line-items .line-name small { display: inline; color: var(--muted); font-weight: 500; white-space: nowrap; }
.line-items .line-price { flex-shrink: 0; text-align: left; font-weight: 700; white-space: nowrap; }
.line-items .line-price small { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.line-items .line-price small.line-low { color: var(--green); font-weight: 700; }
.line-items .line-price small.line-estimate { color: var(--muted); font-style: italic; }
.line-items li.no-price .line-price { color: var(--promo); font-weight: 600; }
.line-items-note { margin: 4px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }

/* ═══ Product detail: barcode and the chain's own name ═══ */
.detail-barcode { display: inline-flex; align-items: center; gap: 10px; margin: 2px 0 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; }
.detail-barcode > span { color: var(--muted); font-weight: 600; }
.detail-barcode bdi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; user-select: all; }
.detail-barcode button { min-height: 30px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--green); font-size: 12px; font-weight: 700; }
.barcode-note { margin: -8px 0 12px; font-size: 11.5px; color: var(--muted); }
.barcode-note bdi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.raw-name { margin: -4px 0 12px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 760px) { .detail-barcode button { min-height: 40px; } }
