/* ==========================================================================
   InstaMart storefront — design system + components
   Vanilla CSS. Mobile-first. RTL-native (logical properties only).
   Taste dials: VARIANCE 4 · MOTION 3 · DENSITY 4
   ========================================================================== */

/* ---------- fonts (self-hosted; CSP font-src 'self') ---------- */
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-arabic-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-arabic-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-arabic-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-arabic-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/store/fonts/cairo-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  /* tenant brand — overridden at runtime from store.primary_color / secondary_color */
  --brand: #1f7a4d;
  --brand-strong: #17603c;
  --brand-tint: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-tint-soft: color-mix(in srgb, var(--brand) 7%, #fff);
  --on-brand: #fff;
  /* secondary brand — supporting accents only; overridden at runtime from
     store.theme.secondary. Defaults to a darker primary so unset stores look coherent. */
  --brand-2: #17603c;
  --brand-2-strong: #124a2e;
  --on-brand-2: #fff;

  /* warm neutral surfaces */
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-sunk: #f3f1ec;
  --border: #e9e4dc;
  --border-strong: #ddd6ca;

  --text: #1c1a17;
  --text-2: #5b564d;
  --text-3: #948d81;

  --warning: #9a5b00;
  --warning-tint: #fbf1e2;
  --danger: #b23b30;
  --danger-tint: #f8ebe9;

  /* shape lock: image wells & cards 14, controls 10, pills full */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* 4px rhythm */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  --shadow-sm: 0 1px 2px rgba(28,26,23,.06), 0 1px 1px rgba(28,26,23,.04);
  --shadow-md: 0 8px 30px -10px rgba(28,26,23,.16);
  --shadow-bar: 0 -6px 20px -12px rgba(28,26,23,.18);

  --dur-1: 120ms;
  --dur-2: 200ms;
  --ease: cubic-bezier(.2,.7,.2,1);

  --header-h: 108px;
  --maxw: 1180px;
  --tap: 44px;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Cairo", "SF Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
picture { display: contents; }  /* AVIF wrapper: layout stays the <img>'s */
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.hidden, [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* icons — one family, one stroke weight */
.icon { inline-size: 1.25em; block-size: 1.25em; flex: 0 0 auto; stroke: currentColor;
  fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }
#sprite { display: none; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-block-end: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
}
.brand {
  display: flex; align-items: center; gap: var(--s-3);
  text-decoration: none; color: inherit; min-width: 0; flex: 1;
}
/* Store logo — a fixed circular mark beside the store name (Option A brand
   lockup), opposite the language switcher. Real uploads are wide landscape
   (Carrefour ~928x612, Hypermart ~1600x912 — ratios ~1.5-1.75:1) with a lot
   of their own background padding baked into the source file (e.g. Carrefour's
   mark occupies only a small centered fraction of the canvas), so
   object-fit:cover would crop into the actual brand mark — never used here.
   object-fit:contain shows the whole logo (never cropped) at the cost of
   letterboxing inside the circle; `background` fills that letterbox space so
   it reads as a card, not a transparent gap. The circle is sized generously
   (rather than the smaller 42/48px it used to be) specifically because contain
   already shrinks these particular assets a lot — a bigger circle is the only
   lever left to keep the brand mark recognizable without cropping or
   generating a replacement image. border-radius does the clipping,
   overflow:hidden is the safety net for non-conforming browsers. */
.store-logo {
  flex: 0 0 auto;
  inline-size: 52px; block-size: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  object-fit: contain;
  object-position: center;
}
/* Name + status stack beside the logo. The store name is not hidden when a
   logo is present — no metadata says whether a given logo already renders
   the name, so both always show (matches the approved brand-lockup direction
   for both a symbol-only mark and a wordmark). */
.brand-text {
  display: flex; flex-direction: column; justify-content: center;
  gap: 1px; min-width: 0;
}
.store-name {
  /* the store's wordmark, not a UI label — carry a touch more identity */
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Compact Open/Closed/Unknown indicator under the store name — the primary
   at-a-glance status signal (Option A). Colour comes from the dot only; the
   label stays the header's ink colour so it never competes with the name. */
.header-status {
  display: flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 600; color: var(--text-2);
}
.header-status-dot {
  inline-size: 7px; block-size: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--text-3);
  transition: background var(--dur-1) var(--ease);
}
.header-status[data-state="OPEN"] .header-status-dot { background: #34d17a; }
.header-status[data-state="CLOSED"] .header-status-dot { background: #ff6b6b; }
@keyframes status-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .45; }
}
.lang-switch {
  flex: 0 0 auto; block-size: var(--tap); padding-inline: var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: transparent; color: var(--text);
  font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
/* desktop header links (cart D-03, account); the bottom nav carries both below 900px */
.header-link {
  display: none; flex: 0 0 auto; align-items: center; gap: var(--s-2);
  block-size: var(--tap); padding-inline: var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); text-decoration: none; font-size: .8125rem; font-weight: 600;
  transition: background var(--dur-1) var(--ease);
}
.header-link:hover { background: var(--surface-sunk); }
.header-link .icon { inline-size: 20px; block-size: 20px; }
@media (min-width: 900px) { .header-link { display: inline-flex; } }
.lang-switch:hover { background: var(--surface-sunk); }
.lang-switch:active { transform: scale(.94); }
.bn-badge.pop { animation: pop var(--dur-2) var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }

.search-wrap { max-width: var(--maxw); margin-inline: auto; padding: 0 var(--s-4) var(--s-3); }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .icon-search {
  position: absolute; inset-inline-start: 12px; inline-size: 20px; block-size: 20px;
  color: var(--text-2); stroke-width: 2; pointer-events: none;
}
.search-input {
  inline-size: 100%; block-size: 46px;
  padding-inline: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: 16px; color: var(--text);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.search-input::placeholder { color: var(--text-3); }
/* the field already ships a custom .search-clear — suppress the browser's own
   native clear so there is exactly one clear affordance. */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.search-clear {
  position: absolute; inset-inline-end: 8px;
  inline-size: 30px; block-size: 30px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--text-2);
}
.search-clear .icon { inline-size: 16px; block-size: 16px; }
.search-clear:active { transform: scale(.9); }
.search-wrap.has-price-check .search-input { padding-inline-end: 88px; }
.search-wrap.has-price-check .search-clear { inset-inline-end: 50px; }
.search-scan-btn {
  position: absolute;
  inset-inline-end: 4px;
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--brand-strong);
  background: transparent;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.search-scan-btn[hidden] { display: none; }
.search-scan-btn .icon {
  inline-size: 21px;
  block-size: 21px;
  stroke-width: 2.2;
}
.search-scan-btn:hover { background: var(--surface-sunk); }
.search-scan-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.search-scan-btn:active { transform: scale(.94); }

/* autocomplete suggestions — additive overlay, existing tokens only */
.search-wrap { position: relative; }
.search-suggest {
  position: absolute; inset-inline: 0; top: calc(100% - var(--s-2));
  z-index: 40; margin: 0; padding: var(--s-1); list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  max-block-size: 60vh; overflow-y: auto; overscroll-behavior: contain;
}
.sugg {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  cursor: pointer; font-size: .9375rem; color: var(--text);
}
.sugg[aria-selected="true"], .sugg:hover { background: var(--surface-sunk); }
.sugg-img {
  inline-size: 34px; block-size: 34px; flex: 0 0 auto;
  border-radius: var(--r-sm); object-fit: cover; background: var(--surface-sunk);
}
.sugg-img-ph { display: grid; place-items: center; color: var(--text-3); }
.sugg-img-ph .icon { inline-size: 16px; block-size: 16px; }
.sugg-txt { min-inline-size: 0; display: flex; flex-direction: column; }
.sugg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-sub { font-size: .75rem; color: var(--text-3); }
.sugg-chip {
  align-self: flex-start; margin-block-start: 2px; padding: 1px 6px;
  border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--text-2);
}

/* ==========================================================================
   Hero (cover photo + operational info — store identity lives in the header)
   ========================================================================== */
.hero {
  position: relative; overflow: hidden;
  max-width: var(--maxw); margin: var(--s-4) auto 0; margin-inline: var(--s-4);
  block-size: 168px; border-radius: var(--r-xl);
  background: var(--surface-sunk);
  border: 1px solid var(--border);
}
.hero-cover {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,15,.65), transparent 55%);
}
.hero-info {
  position: absolute; inset-inline: var(--s-4); inset-block-end: var(--s-3);
}
/* Delivery / hours info rows — a small outline icon + text, subordinate to
   the header's brand + status. Not a status pill; purely informational. */
.hero-delivery, .hero-hours {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; font-size: .8125rem; font-weight: 600;
  background: color-mix(in srgb, #000 32%, transparent);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.hero-info-icon { inline-size: 14px; block-size: 14px; stroke-width: 2; flex: 0 0 auto; }

/* ==========================================================================
   Install banner
   ========================================================================== */
.install-banner {
  max-width: var(--maxw); margin: var(--s-3) auto 0;
  inline-size: calc(100% - var(--s-8));
  background: var(--brand); color: var(--on-brand);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  font-size: .875rem; font-weight: 500;
}
.install-actions { display: flex; gap: var(--s-2); flex: 0 0 auto; }
.install-banner button {
  border-radius: var(--r-sm); padding: 6px 14px;
  background: var(--on-brand); color: var(--brand-strong);
  font-weight: 700; font-size: .8125rem;
}
.install-banner button.ghost {
  background: transparent; color: var(--on-brand);
  border: 1px solid color-mix(in srgb, var(--on-brand) 55%, transparent);
}

/* ==========================================================================
   Category rail
   ========================================================================== */
.cat-rail {
  position: sticky; inset-block-start: var(--stack-top, var(--header-h)); z-index: 15;
  background: var(--bg);
  border-block-end: 1px solid var(--border);
}
.cat-rail-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none;
  overscroll-behavior: contain;
  padding: var(--s-2) var(--s-5);
  scroll-snap-type: inline proximity;
}
.cat-rail-inner::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: var(--r-pill);
  font-size: .875rem; font-weight: 400; color: var(--text-2);
  white-space: nowrap; min-block-size: 36px;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.cat-btn:hover { color: var(--text); background: var(--surface-sunk); }
.cat-btn .icon {
  inline-size: 15px; block-size: 15px; margin-inline-end: 5px; stroke-width: 2;
  color: color-mix(in srgb, var(--brand) 55%, var(--text-2));
}
.cat-btn[aria-pressed="true"] {
  background: var(--brand); color: var(--on-brand); font-weight: 600;
}
.cat-btn[aria-pressed="true"] .icon { color: var(--on-brand); }

/* `catButton()` wraps a department button's icon/label in these two spans so
   the mobile tile layout below has something to stack; everywhere else
   (desktop sidebar, subcategory pills) they stay `display: contents` — inert
   wrappers with zero layout effect, so the pre-existing inline icon+label
   row is completely unchanged unless the mobile tile rule below applies. */
.cat-tile-icon, .cat-tile-label { display: contents; }
#cat-rail-inner .cat-tile-icon {
  display: flex; position: relative; align-items: center; justify-content: center;
  flex: 0 0 64px; inline-size: 64px; block-size: 64px;
  overflow: hidden; border-radius: var(--r-md); margin-inline-end: 8px;
}
.cat-dept-img {
  display: block; position: absolute; left: 50%; top: 50%;
  inline-size: 230%; block-size: 230%; max-inline-size: none;
  object-fit: contain; transform: translate(-50%, -50%);
}
#cat-rail-inner .cat-tile-label { white-space: normal; overflow-wrap: break-word; }

/* ---- department rail: compact icon tiles, phones/tablets only ----
   Reference: single horizontal carousel of rounded-square tiles, large icon
   over a centered label. Scoped to <900px so the desktop sidebar list (which
   uses the very same markup/classes) is completely untouched — see the
   `min-width: 900px` block further down, which restores the original inline
   row for `.cat-btn` there. */
@media (max-width: 899px) {
  /* Tile/icon sizes reduced ~15% from the prior 104x120 / 88px icon for a
     more compact rail (label kept legible, made bold instead — see below). */
  #cat-rail-inner { gap: 6px; padding-block: 4px 0; scroll-behavior: smooth; }
  #cat-rail-inner .cat-btn {
    flex-direction: column; justify-content: flex-start; gap: 0;
    inline-size: 88px; block-size: 102px; padding: 0;
    border-radius: 0; background: transparent;
    border: 0;
  }
  #cat-rail-inner .cat-btn:hover { background: transparent; }
  #cat-rail-inner .cat-tile-icon,
  #cat-rail-inner .cat-tile-label { display: flex; }
  #cat-rail-inner .cat-tile-icon {
    flex-basis: 75px; inline-size: 75px; block-size: 75px;
    padding: 0; border-radius: var(--r-lg); background: transparent;
    margin-inline-end: 0; flex-shrink: 0;
  }
  #cat-rail-inner .cat-tile-label {
    display: block; text-align: center; white-space: normal;
    font-size: .6875rem; font-weight: 700; line-height: 1.05;
    inline-size: 100%; letter-spacing: 0;
  }
  #cat-rail-inner .cat-btn[aria-pressed="true"] {
    background: transparent; color: var(--brand-strong); font-weight: 600;
  }
  #cat-rail-inner .cat-btn[aria-pressed="true"] .cat-tile-icon {
    box-shadow: inset 0 0 0 2px var(--brand);
  }
}

/* On mobile the two rails are independent sticky bars; `display: contents`
   keeps the wrapper from trapping their sticky positioning inside its own box.
   The wrapper only becomes a real (scrollable) element in the desktop sidebar. */
.cat-nav { display: contents; }

/* ---- second row: subcategories of the selected department ----
   The subcategory rail sticks directly below the department rail. Its offset
   is the department rail's real height, measured once by app.js into
   --catrail-h (the 56px fallback matches the current rail geometry); never a
   blind magic number. */
.subcat-rail {
  inset-block-start: calc(var(--stack-top, var(--header-h)) + var(--catrail-h, 56px));
  z-index: 14;
  background: var(--surface-sunk, var(--bg));
}
.subcat-rail .cat-rail-inner { padding-block: 6px; }
.cat-btn--sub {
  min-block-size: 32px; padding: 6px 12px; font-size: .8125rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.content {
  max-width: var(--maxw); margin-inline: auto;
  padding: var(--s-4) var(--s-4) var(--s-12);
}
.view[hidden] { display: none; }
/* search results lead; the decorative cover steps aside (app.js loadProducts) */
#view-home.is-searching .hero { display: none; }

/* cart / checkout / success read better in a narrower column on desktop */
@media (min-width: 760px) {
  #view-cart .content, #view-checkout .content, #view-success .content,
  #view-cart .action-bar, #view-checkout .action-bar {
    max-width: 620px;
  }
  #view-checkout, #view-cart { padding-block-start: var(--s-6); }
}

.section-head {
  display: flex; align-items: baseline; gap: var(--s-3);
  margin-block-end: var(--s-4);
}
.page-title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.result-count { font-size: .8125rem; color: var(--text-3); }

/* ==========================================================================
   Product grid + card
   ========================================================================== */
.product-grid {
  display: grid; gap: var(--s-5) var(--s-4);
  grid-template-columns: repeat(2, 1fr);
  /* clears the sticky header + both category rails when scrolled into view */
  scroll-margin-block-start: calc(var(--stack-top, var(--header-h)) + 116px);
}
@media (min-width: 900px) { .product-grid { scroll-margin-block-start: calc(var(--stack-top, var(--header-h)) + var(--s-4)); } }
@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .product-grid { grid-template-columns: repeat(4, 1fr); gap: var(--s-6) var(--s-5); } }
@media (min-width: 1180px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

/* ---- desktop: category sidebar ---- */
@media (min-width: 900px) {
  #view-home {
    display: grid; grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: var(--s-8);
    max-width: 1240px; margin-inline: auto;
    padding: var(--s-6) var(--s-6) var(--s-12);
  }
  .hero { grid-column: 1 / -1; grid-row: 1; margin-inline: 0; }
  .cat-nav {
    display: block;
    grid-column: 1; grid-row: 2;
    position: sticky; inset-block-start: calc(var(--stack-top, var(--header-h)) + var(--s-4));
    align-self: start;
    max-block-size: calc(100dvh - var(--stack-top, var(--header-h)) - var(--s-10));
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #view-home > .content { grid-column: 2; grid-row: 2; }
  .cat-rail {
    position: static; background: none; border: 0; padding: 0;
  }
  .subcat-rail {
    position: static; background: none;
    margin-block-start: var(--s-2);
    padding-inline-start: var(--s-3);
    border-inline-start: 2px solid var(--border);
  }
  .cat-rail-inner {
    flex-direction: column; gap: 2px; overflow: visible; padding: 0;
  }
  .cat-btn {
    inline-size: 100%; justify-content: flex-start; text-align: start;
    padding-inline: var(--s-3); border-radius: var(--r-md);
  }
  #view-home > .content { max-width: none; margin: 0; padding: 0; }
  .search-wrap { max-width: 560px; margin-inline: 0; padding-inline: var(--s-4); }
  .header-inner { padding-block-end: 0; }
  /* a touch larger on desktop, still a fixed circle */
  .store-logo { inline-size: 60px; block-size: 60px; }
  .cat-rail::before {
    content: attr(data-label);
    display: block; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    color: var(--text-3); text-transform: uppercase;
    padding-inline: var(--s-3); margin-block-end: var(--s-2);
  }
}

.card { display: flex; flex-direction: column; min-width: 0; position: relative; }
.card-media {
  position: relative; aspect-ratio: 1 / 1;
  /* was --surface-sunk (a distinct warm gray) — a white-background product
     photo read as a separate pasted rectangle against it. The card itself
     (Golden skin, styles-preview.css) is already white; matching this to it
     is the actual fix. */
  border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden;
  transition: transform var(--dur-1) var(--ease);
}
.card-media img {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
}
.ph-fill {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.ph-fill .ph { stroke-width: 1.4; opacity: .95; inline-size: 34%; block-size: auto; aspect-ratio: 1; }
.card-media:active { transform: scale(.985); }
.card.oos .card-media img,
.card.oos .card-media .ph-fill { opacity: .5; }
.oos-tag {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: .6875rem; font-weight: 600;
  padding: 3px 8px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.card-name {
  margin-block-start: var(--s-3);
  font-size: .875rem; font-weight: 500; line-height: 1.35; color: var(--text);
  text-align: start;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  /* reserve a true two lines (2 × line-height, + a hair for line-box rounding)
     so a one-line name doesn't pull the price + add button up and break the
     grid row's vertical rhythm. */
  min-block-size: 2.8em;
}
.card.oos .card-name { color: var(--text-2); }
.card-meta {
  margin-block-start: 2px;
  font-size: .75rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-price {
  margin-block-start: var(--s-2);
  font-size: 1rem; font-weight: 700; color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}
.card-price .cur { font-size: .75rem; font-weight: 500; color: var(--text-3); margin-inline-start: 4px; }
.card-foot {
  /* pinned to the bottom of the (grid-stretched) card so the add control lines
     up across a row regardless of name length or whether a meta line exists. */
  margin-block-start: auto;
  padding-block-start: var(--s-2);
  display: flex; align-items: center;
  min-block-size: 38px;
}

/* add control: icon button -> becomes inline stepper when in cart */
.add-btn {
  inline-size: 38px; block-size: 38px; display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--brand); color: var(--on-brand);
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.add-btn .icon { inline-size: 20px; block-size: 20px; stroke-width: 2.2; }
.add-btn:active { transform: scale(.9); }
.add-btn.added { background: var(--brand-strong); color: var(--on-brand); }

/* Local "added" feedback: when the add button is swapped for the stepper as a
   result of the user adding the item, the stepper springs in briefly, and a
   later quantity change gives the number a small bump. Fast, interruptible,
   and skipped entirely under reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .stepper.is-in { animation: stepper-in var(--dur-2) var(--ease); }
  .stepper .n.bump { animation: qty-bump var(--dur-2) var(--ease); }
  /* a very slow, restrained breathing pulse on the header status dot — only
     while the store is genuinely open */
  .header-status[data-state="OPEN"] .header-status-dot { animation: status-pulse 2.6s ease-in-out infinite; }
}
@keyframes stepper-in {
  0% { transform: scale(.9); opacity: .4; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes qty-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.stepper {
  display: flex; align-items: center; gap: 2px;
  background: var(--brand); color: var(--on-brand);
  border-radius: var(--r-md); padding: 2px;
}
.stepper button {
  inline-size: 34px; block-size: 34px; display: grid; place-items: center;
  color: var(--on-brand); border-radius: var(--r-sm);
}
.stepper button .icon { inline-size: 16px; block-size: 16px; stroke-width: 2.4; }
.stepper button:active { background: color-mix(in srgb, #000 12%, transparent); }
.stepper .n { min-inline-size: 22px; text-align: center; font-weight: 700; font-size: .875rem;
  font-variant-numeric: tabular-nums; }

/* ==========================================================================
   List status (loading / empty / error)
   ========================================================================== */
.list-status {
  grid-column: 1 / -1;
  text-align: center; color: var(--text-2);
  padding: var(--s-12) var(--s-4);
}
.list-status .icon { inline-size: 28px; block-size: 28px; color: var(--text-3); margin-block-end: var(--s-3); stroke-width: 1.5; }
.list-status strong { display: block; color: var(--text); font-size: 1rem; font-weight: 600; margin-block-end: var(--s-1); }
.list-status .btn-line { margin-block-start: var(--s-4); }

.load-more {
  grid-column: 1 / -1; justify-self: center;
  margin-block-start: var(--s-6);
  padding: 10px 22px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); color: var(--text);
  font-weight: 500; font-size: .875rem;
  transition: background var(--dur-1) var(--ease);
}
.load-more:hover { background: var(--surface-sunk); }

/* infinite-scroll inline slot — subtle "loading" line / retry beneath the grid */
.grid-more {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-block-size: 44px; margin-block-start: var(--s-5);
  color: var(--text-3); font-size: .875rem;
}
.grid-more-spin {
  inline-size: 16px; block-size: 16px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--text-2);
}
@media (prefers-reduced-motion: no-preference) {
  .grid-more-spin { animation: gm-spin .7s linear infinite; }
}
@keyframes gm-spin { to { transform: rotate(360deg); } }
.grid-more-retry {
  padding: 8px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); color: var(--text);
  font-weight: 500; font-size: .875rem;
  transition: background var(--dur-1) var(--ease);
}
.grid-more-retry:hover { background: var(--surface-sunk); }
#grid-sentinel { block-size: 1px; pointer-events: none; }

/* ==========================================================================
   Skeletons
   ========================================================================== */
.sk { background: var(--surface-sunk); position: relative; overflow: hidden; border-radius: var(--r-md); }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .sk::after { animation: shimmer 1.4s ease-in-out infinite; }
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-rail { display: flex; gap: var(--s-2); padding: var(--s-2) var(--s-4); max-width: var(--maxw); margin-inline: auto; }
.sk-chip { inline-size: 76px; block-size: 36px; border-radius: var(--r-pill); flex: 0 0 auto; }
.sk-card { aspect-ratio: 1 / 1; border-radius: var(--r-lg); }
#skeleton .product-grid { margin-block-start: var(--s-4); }

/* ==========================================================================
   Fatal / not-found
   ========================================================================== */
.fatal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; background: var(--bg); padding: var(--s-6);
}
.fatal-box { text-align: center; max-width: 300px; }
.fatal-box .icon { inline-size: 32px; block-size: 32px; color: var(--text-3); margin-block-end: var(--s-3); stroke-width: 1.5; }
.fatal-box h1 { font-size: 1.25rem; font-weight: 700; margin-block-end: var(--s-2); }
.fatal-box p { color: var(--text-2); font-size: .9375rem; }

/* ==========================================================================
   Bottom sheet / dialog (product detail)
   ========================================================================== */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet.hidden { display: none; }
.sheet-scrim {
  position: absolute; inset: 0;
  background: rgba(28,26,23,.42);
}
.sheet-panel {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  background: var(--surface);
  border-start-start-radius: var(--r-xl); border-start-end-radius: var(--r-xl);
  max-block-size: 92dvh; display: flex; flex-direction: column;
  max-inline-size: 520px; margin-inline: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .sheet:not(.closing) .sheet-panel { animation: sheet-in var(--dur-2) var(--ease); }
  .sheet:not(.closing) .sheet-scrim { animation: fade-in var(--dur-2) var(--ease); }
}
@keyframes sheet-in { from { transform: translateY(12%); opacity: .6; } }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 720px) {
  .sheet { display: grid; place-items: center; }
  .sheet-panel {
    position: relative; border-radius: var(--r-xl); max-block-size: 84dvh;
  }
}
.sheet-handle {
  inline-size: 36px; block-size: 4px; border-radius: var(--r-pill);
  background: var(--border-strong); margin: 10px auto 0;
}
.sheet-close {
  position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 2;
  inline-size: 36px; block-size: 36px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-2); backdrop-filter: blur(4px);
}
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4) var(--s-5) var(--s-4); flex: 1; }
.sheet-media {
  position: relative;
  aspect-ratio: 4 / 3; max-block-size: 42dvh;
  border-radius: var(--r-lg); background: var(--surface-sunk);
  overflow: hidden; margin-block-end: var(--s-4);
}
.sheet-media img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.sheet-media .ph-fill .ph { inline-size: 76px; }
.sheet-thumbs {
  display: flex; gap: var(--s-2); overflow-x: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin-block-end: var(--s-4); padding-block-end: 2px;
}
.sheet-thumb {
  flex: 0 0 auto; inline-size: 56px; block-size: 56px; padding: 0;
  border-radius: var(--r-md); overflow: hidden; background: var(--surface-sunk);
  border: 2px solid transparent; cursor: pointer;
}
.sheet-thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.sheet-thumb.is-on { border-color: var(--primary); }
.sheet-thumb:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sheet-title { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.sheet-meta { color: var(--text-2); font-size: .875rem; margin-block-start: var(--s-1); }
.sheet-price {
  margin-block-start: var(--s-3);
  font-size: 1.375rem; font-weight: 700; color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}
.sheet-price .cur { font-size: .875rem; font-weight: 500; color: var(--text-3); margin-inline-start: 5px; }
.avail {
  display: inline-flex; align-items: center; gap: 6px;
  margin-block-start: var(--s-3);
  font-size: .8125rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.avail .icon { inline-size: 16px; block-size: 16px; }
.avail.in { background: var(--brand-tint); color: var(--brand-strong); }
.avail.out { background: var(--danger-tint); color: var(--danger); }
.sheet-desc {
  margin-block-start: var(--s-4); color: var(--text-2); font-size: .9375rem;
  white-space: pre-wrap; line-height: 1.6;
}
.sheet-action {
  border-block-start: 1px solid var(--border);
  padding: var(--s-3) var(--s-5) calc(var(--s-3) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface);
}
.sheet-action .stepper { background: var(--surface-sunk); color: var(--text); }
.sheet-action .stepper button { color: var(--text); }
.sheet-action .stepper button:active { background: var(--border); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  inline-size: 100%; min-block-size: 50px;
  padding: 0 var(--s-5); border-radius: var(--r-md);
  background: var(--brand); color: var(--on-brand);
  font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn-primary .icon { inline-size: 20px; block-size: 20px; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-primary:active { transform: translateY(1px) scale(.995); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--surface-sunk); color: var(--text-2);
  cursor: not-allowed; transform: none;
}
.btn-primary .amount { font-variant-numeric: tabular-nums; opacity: .92; font-weight: 600; }

.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  inline-size: 100%; min-block-size: 48px;
  padding: 0 var(--s-5); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); color: var(--text);
  font-weight: 600; font-size: .9375rem; text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.btn-ghost:hover { background: var(--surface-sunk); }
.btn-ghost:active { transform: translateY(1px); }

.btn-text {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-weight: 500; font-size: .9375rem; text-decoration: none;
}
.btn-text:hover { color: var(--text); }

/* sticky bottom action bar (cart / checkout) */
.action-bar {
  position: sticky; inset-block-end: 0; z-index: 15;
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  box-shadow: var(--shadow-bar);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  max-width: var(--maxw); margin-inline: auto;
}
/* Cart's bar sits above the (still-visible) bottom nav instead of under it —
   same 64px nav-height assumption as .content--nav-pad. Checkout hides the
   nav (see NO_BOTTOM_NAV in app.js) so its bar keeps inset-block-end: 0. */
#view-cart .action-bar {
  inset-block-end: calc(64px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  /* bottom nav is hidden at this width — bar goes back to the viewport edge */
  #view-cart .action-bar { inset-block-end: 0; }
}
.bar-note {
  display: flex; align-items: center; gap: 6px;
  font-size: .8125rem; font-weight: 500; color: var(--warning);
  margin-block-end: var(--s-2);
}
.bar-note .icon { inline-size: 16px; block-size: 16px; flex: 0 0 auto; }
/* Checkout bar: note -> primary -> secondary -> quiet account row, on one
   8px rhythm ([hidden] children are display:none, so they take no gap). */
.co-bar { display: flex; flex-direction: column; gap: var(--s-2); }
.co-bar > .bar-note { margin: 0; }
.co-bar > .btn-ghost { min-block-size: 44px; }
.btn-ghost:disabled { color: var(--text-3); background: none; cursor: not-allowed; transform: none; }
.checkout-auth-note {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  column-gap: 6px; margin-block-start: calc(-1 * var(--s-1));
  font-size: .8125rem; color: var(--text-2);
}

/* ==========================================================================
   Alerts / inline messages
   ========================================================================== */
.alert {
  display: flex; gap: var(--s-2);
  background: var(--warning-tint); color: var(--warning);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  margin-block-end: var(--s-4); font-size: .875rem; font-weight: 500;
}
.alert .icon { inline-size: 18px; block-size: 18px; flex: 0 0 auto; margin-block-start: 1px; }
.alert > div > div { margin-block-start: 2px; }
.notice {
  margin-block-start: var(--s-3);
  font-size: .8125rem; color: var(--danger); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.notice .icon { inline-size: 16px; block-size: 16px; }
.notice--pad { padding: var(--s-6); }

.barcode-scan { padding: var(--s-5); display: grid; gap: var(--s-3); }
.barcode-video-wrap {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: #111; aspect-ratio: 4 / 3;
}
.barcode-video-wrap video { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.barcode-frame {
  position: absolute; inset: 22% 10%; border: 2px solid rgba(255,255,255,.9);
  border-radius: var(--r-md); box-shadow: 0 0 0 999px rgba(0,0,0,.28);
}
.barcode-result-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.barcode-result-actions > * { flex: 1 1 150px; }

/* ==========================================================================
   Empty states
   ========================================================================== */
.empty-state {
  text-align: center; padding: var(--s-12) var(--s-4) var(--s-6);
}
.empty-state .icon { inline-size: 34px; block-size: 34px; color: var(--text-3); stroke-width: 1.5; margin-block-end: var(--s-3); }
.empty-state p { color: var(--text-2); font-size: .9375rem; margin-block-end: var(--s-4); }
.empty-state .btn-ghost { max-width: 260px; margin-inline: auto; }

/* ==========================================================================
   Cart
   ========================================================================== */
.cart-list { display: flex; flex-direction: column; }
.cart-row {
  display: grid; grid-template-columns: 60px 1fr; gap: var(--s-3);
  align-items: start; padding-block: var(--s-4);
}
.cart-row + .cart-row { border-block-start: 1px solid var(--border); }
.cart-thumb {
  position: relative;
  inline-size: 60px; block-size: 60px; align-self: start; border-radius: var(--r-md);
  background: var(--surface-sunk); overflow: hidden;
}
.cart-thumb img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.cart-thumb .ph-fill .ph { inline-size: 26px; }
.cart-main { min-width: 0; }
.cart-line1 { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.cart-name {
  font-size: .9375rem; font-weight: 500; line-height: 1.35; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-line-total { font-size: .9375rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-unit { font-size: .8125rem; color: var(--text-3); font-variant-numeric: tabular-nums; margin-block-start: 2px; }
.cart-line2 {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin-block-start: var(--s-3);
}
.cart-row .stepper { background: var(--surface-sunk); color: var(--text); }
.cart-row .stepper button { color: var(--text); }
.cart-row .stepper button:active { background: var(--border); }
.cart-remove {
  inline-size: 36px; block-size: 36px; display: grid; place-items: center;
  color: var(--text-3); border-radius: var(--r-sm);
}
.cart-remove:hover { color: var(--danger); background: var(--danger-tint); }
.cart-remove .icon { inline-size: 18px; block-size: 18px; }

.totals {
  margin-block-start: var(--s-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-4);
}
.totals-row { display: flex; justify-content: space-between; align-items: baseline;
  padding-block: var(--s-1); color: var(--text-2); font-size: .9375rem; }
.totals-row span:last-child { font-variant-numeric: tabular-nums; }
.totals-row.grand {
  margin-block-start: var(--s-2); padding-block-start: var(--s-3);
  border-block-start: 1px solid var(--border);
  color: var(--text); font-size: 1.125rem; font-weight: 700;
}

/* ==========================================================================
   Checkout
   ========================================================================== */
.co-section { margin-block-end: var(--s-6); }
.co-section > h2 {
  font-size: .8125rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-3); text-transform: uppercase;
  margin-block-end: var(--s-3);
}
.field { display: block; margin-block-end: var(--s-3); }
.field > .label { display: block; font-size: .875rem; font-weight: 500; color: var(--text-2); margin-block-end: 6px; }
.field .req { color: var(--danger); font-weight: 400; }
.field input, .field textarea {
  inline-size: 100%; min-block-size: 46px;
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: 16px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.field textarea { min-block-size: 64px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
/* DEF-03 — field-level checkout validation state (works alongside the top alert) */
.field--err input, .field--err textarea { border-color: var(--danger); }
.field--err input:focus, .field--err textarea:focus {
  border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}
.field-err {
  display: block; margin-block-start: 5px;
  font-size: .78rem; font-weight: 500; color: var(--danger);
}
/* Compact side-by-side pair (Apartment + Floor) — smaller than the main
   address fields per the requested hierarchy. Wraps to a single column on
   very narrow screens instead of forcing a cramped row (clarity over
   compactness). */
.field-row { display: flex; gap: var(--s-3); }
.field-row .field { flex: 1 1 0; min-inline-size: 0; }
.field-sm input { min-block-size: 42px; font-size: 16px; }
/* OTP code: six boxes in the space of one field input (inherit .field input look). */
.otp-boxes { display: flex; gap: var(--s-2); }
.otp-boxes input { flex: 1 1 0; min-inline-size: 0; padding-inline: 0; text-align: center; }
@media (max-width: 360px) {
  .field-row { flex-direction: column; gap: 0; }
}
/* Building + Apartment + Floor as one required address-details group — all
   three look like a single logical unit, not a primary field plus two
   afterthoughts. Desktop/tablet/normal-mobile: 3 even columns. Very narrow
   screens: Building takes its own full-width row, Apartment+Floor pair up
   below it (2 + 1) rather than squeezing three unusable inputs into 320px. */
/* align-items:end keeps the three inputs on one line when a label wraps */
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); align-items: end; }
@media (max-width: 360px) {
  .field-row-3 { grid-template-columns: repeat(2, 1fr); }
  .field-row-3 > :first-child { grid-column: 1 / -1; }
}
/* Icon-in-field pattern, matching the existing .search-box treatment — same
   rounded input, same subtle border, just an inline leading icon. */
.field-icon-wrap { position: relative; }
.field-icon-wrap > .icon {
  position: absolute; inset-inline-start: 12px; inset-block-start: 50%;
  transform: translateY(-50%); inline-size: 18px; block-size: 18px;
  color: var(--text-3); pointer-events: none;
}
.field-icon-wrap input, .field-icon-wrap textarea { padding-inline-start: 38px; }
.field-icon-wrap--textarea > .icon { inset-block-start: 16px; transform: none; }
/* The legacy free-text field is optional context, not a required address
   component — a lighter label keeps it visually secondary. */
.field-secondary > .label { font-weight: 400; color: var(--text-3); }
/* Address-form card — same recipe as .co-summary (checkout's own card), reused
   rather than inventing a new container style. */
.acct-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-4);
}
/* Street/Compound + "Use My Location" as one row (not stacked) — the button
   keeps its own compact width, the input takes the rest. */
.location-row { display: flex; gap: var(--s-2); align-items: stretch; }
.location-row .field-icon-wrap { flex: 1 1 auto; min-inline-size: 0; }
.location-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 0 var(--s-3); border-radius: var(--r-md); border: 0; cursor: pointer;
  background: var(--brand-tint); color: var(--brand-strong);
  font-weight: 600; font-size: .8125rem; white-space: nowrap; min-block-size: 46px;
}
.location-btn:active { transform: translateY(1px); }
.location-btn .icon { inline-size: 16px; block-size: 16px; }
/* Instructional copy under the location row — same secondary treatment as
   every other field hint, not a new text style. */
.location-hint { display: block; font-size: .75rem; color: var(--text-3); margin-block: 4px; }
/* Important-note box — same neutral card recipe as the reentry banner
   (.addorder-banner--reentry), reused rather than adding a new colour. */
.note-box {
  margin-block-start: var(--s-4); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); background: var(--surface-sunk); border: 1px solid var(--border);
}
.note-box-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .875rem; color: var(--text); margin-block-end: 4px;
}
.note-box-head .icon { inline-size: 18px; block-size: 18px; color: var(--brand-strong); }
.note-box p { font-size: .8125rem; color: var(--text-2); }
/* DEF-02 — PDP action: explicit label/price separator */
.btn-primary .sep { opacity: .6; font-weight: 600; }

.choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
/* An odd number of enabled methods leaves the last one alone on its row, full width
   (3 -> 50% / 50% / 100%; 1 -> 100%). bindCheckoutForm() sets the class on the last
   visible method, so the layout follows the store's real method count. */
.choice--wide { grid-column: 1 / -1; }
.choice {
  display: flex; align-items: center; gap: var(--s-2);
  min-block-size: 48px; min-inline-size: 0;
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  cursor: pointer; font-size: .9375rem; font-weight: 500;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.choice .icon { inline-size: 18px; block-size: 18px; flex: 0 0 auto; color: var(--text-2); }
.choice > span { min-inline-size: 0; overflow-wrap: anywhere; line-height: 1.3; }
.choice::after { flex: 0 0 auto; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
.choice:has(input:checked) {
  border-color: var(--brand); background: var(--brand-tint-soft);
}
.choice:has(input:checked) .icon { color: var(--brand-strong); }
.choice:has(input:checked)::after {
  content: ""; inline-size: 16px; block-size: 16px; margin-inline-start: auto;
  border-radius: var(--r-pill); background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--brand);
}
.choice:has(input:disabled) { opacity: .4; cursor: not-allowed; }

/* Checkout "Back to store" — a quiet text link above the title */
.back-link {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-block-size: 44px; margin-block-end: var(--s-1);
  color: var(--text-2); font-size: .9375rem; font-weight: 600; text-decoration: none;
}
.back-link .icon { inline-size: 18px; block-size: 18px; }
.back-link:hover { color: var(--brand-strong); }
.icon-back { transform: scaleX(-1); }            /* the arrow glyph points right: flip it for LTR "back" */
[dir="rtl"] .icon-back { transform: none; }

.co-static {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: .9375rem; font-weight: 500;
}
.co-static .icon { inline-size: 18px; block-size: 18px; color: var(--brand-strong); }

.co-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-4);
}
.co-summary .totals-row.grand { border-color: var(--border); }
/* cart: the one pre-checkout minimum-order hint, informational (not an error) */
.totals-note {
  display: flex; align-items: center; gap: 6px; margin-block-start: var(--s-3);
  font-size: .8125rem; font-weight: 500; color: var(--warning);
}
.totals-note .icon { inline-size: 15px; block-size: 15px; flex: 0 0 auto; }

/* ==========================================================================
   Success
   ========================================================================== */
.success-wrap { text-align: center; max-width: 380px; margin-inline: auto; padding-block: var(--s-10); }
.success-mark {
  inline-size: 68px; block-size: 68px; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand-strong);
  display: grid; place-items: center; margin: 0 auto var(--s-5);
}
.success-mark .icon { inline-size: 34px; block-size: 34px; stroke-width: 2.25; }
@media (prefers-reduced-motion: no-preference) {
  .success-mark { animation: mark-in 320ms var(--ease); }
}
@keyframes mark-in { from { transform: scale(.7); opacity: 0; } }
.success-wrap h1 { font-size: 1.375rem; font-weight: 700; }
.success-order {
  margin-block-start: var(--s-2);
  font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.success-total-card {
  margin-block: var(--s-4);
  display: inline-flex; align-items: baseline; gap: var(--s-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 18px;
}
.success-total-card .k { font-size: .875rem; color: var(--text-3); }
.success-total-card .v { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.success-msg { color: var(--text-2); font-size: .9375rem; margin-block-end: var(--s-6); }
.success-wrap .btn-primary { margin-block-end: var(--s-3); }
/* The add-to-order countdown gets its own clear card, separated from the
   contact actions below it — on narrow screens these used to sit right on
   top of each other (button touching button). */
.addorder-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  inline-size: 100%; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-4);
  margin-block-end: var(--s-6);
}
.addorder-card-head { font-size: .8125rem; color: var(--text-3); }
.addorder-card-cta { font-weight: 600; }
.addorder-card .addorder-countdown { font-weight: 400; color: var(--text-2); font-size: .875rem; }
/* A distinct, clearly-labelled section for order-contact actions (WhatsApp
   today; the heading and wrapper are ready for more without a new pattern),
   visually separated from the timer card above it. */
.success-contact {
  border-block-start: 1px solid var(--border);
  padding-block-start: var(--s-5); margin-block-end: var(--s-4);
}
.success-contact-head {
  font-size: .8125rem; font-weight: 600; letter-spacing: .02em;
  color: var(--text-3); text-transform: uppercase;
  margin-block-end: var(--s-3);
}

/* ==========================================================================
   Bottom navigation
   ========================================================================== */
.bottom-nav {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  max-width: var(--maxw); margin-inline: auto;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-block-start: 1px solid var(--border);
  padding-block-end: env(safe-area-inset-bottom);
}
.bn-item {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding-block: 8px 6px;
  color: var(--text-3); text-decoration: none; font-size: .6875rem; font-weight: 500;
  transition: color var(--dur-1) var(--ease);
}
.bn-item .icon { inline-size: 22px; block-size: 22px; }
.bn-item[aria-current="page"] { color: var(--brand-strong); font-weight: 700; }
.bn-item[aria-current="page"]::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 30%;
  block-size: 3px; border-radius: 0 0 3px 3px; background: var(--brand-2);
}
.bn-item:active { transform: scale(.96); }
.bn-icon-wrap { position: relative; }
.bn-badge {
  position: absolute; inset-block-start: -4px; inset-inline-end: -8px;
  min-inline-size: 16px; block-size: 16px; padding: 0 4px;
  background: var(--brand); color: var(--on-brand);
  font-size: .625rem; font-weight: 700; line-height: 16px; text-align: center;
  border-radius: var(--r-pill); border: 2px solid var(--surface);
}
/* The fixed bottom nav is cleared once, by the footer that always ends the
   page (see .site-footer) — not by every view's content, which left ~88px of
   blank space between short pages (account, orders) and the footer. */
.content--nav-pad { padding-block-end: var(--s-6); }
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .content--nav-pad { padding-block-end: var(--s-12); }
}

/* ==========================================================================
   Orders (device-local history) / Account (read-only shell)
   ========================================================================== */
.device-local-note {
  color: var(--text-3); font-size: .8125rem; line-height: 1.5;
  margin-block-end: var(--s-4);
}
.order-list { display: flex; flex-direction: column; }
.order-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-block: var(--s-3);
}
.order-row + .order-row { border-block-start: 1px solid var(--border); }
.order-row-main { display: flex; flex-direction: column; gap: 2px; }
.order-number { font-weight: 700; font-size: .9375rem; }
.order-date { font-size: .8125rem; color: var(--text-3); }
.order-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.order-status { font-size: .75rem; color: var(--brand-strong); font-weight: 600; }
.order-total { font-size: .9375rem; font-weight: 700; }
.account-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-4); margin-block-end: var(--s-4);
}
.account-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: var(--s-2);
}
.account-row + .account-row { border-block-start: 1px solid var(--border); }
.account-row .k { color: var(--text-3); font-size: .875rem; }
.account-row .v { font-weight: 600; font-size: .9375rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  text-align: center; color: var(--text-3); font-size: .8125rem;
  padding: var(--s-8) var(--s-4) var(--s-10);
  border-block-start: 1px solid var(--border);
}
.site-footer .dot { margin-inline: 6px; opacity: .6; }
@media (max-width: 899px) {
  /* clears the fixed 64px bottom nav for every view (see .content--nav-pad) */
  .site-footer { padding-block: var(--s-5) calc(var(--s-5) + 64px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Offline
   ========================================================================== */
.conn-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--warning-tint); color: var(--warning);
  font-size: .8125rem; font-weight: 500; text-align: center;
  padding: var(--s-2) var(--s-4);
}
/* Demo Store (/store/?demo): a quiet, always-visible label — not a dev banner */
.demo-banner {
  margin: 0; padding: 6px var(--s-4); text-align: center;
  font-size: .75rem; font-weight: 600; color: var(--brand-strong);
  background: var(--brand-tint-soft); border-block-end: 1px solid var(--border);
}
.demo-card .btn-primary { margin-block-start: var(--s-2); }
.offline-wrap { text-align: center; max-width: 320px; margin: 18vh auto 0; padding: var(--s-4); }
.offline-wrap .icon { inline-size: 40px; block-size: 40px; color: var(--text-3); stroke-width: 1.5; margin-block-end: var(--s-4); }
.offline-wrap h1 { font-size: 1.25rem; font-weight: 700; margin-block-end: var(--s-2); }
.offline-wrap p { color: var(--text-2); margin-block-end: var(--s-5); }

/* ==========================================================================
   Customer account + server order history (Phase B)
   ========================================================================== */
.acct-hint { color: var(--text-2); font-size: .875rem; margin-block-end: var(--s-4); }
.acct-subhead { font-size: 1rem; font-weight: 700; margin-block-end: var(--s-3); }
.acct-form { display: block; margin-block-end: var(--s-4); }
.acct-form .field { margin-block-end: var(--s-3); }
.acct-form .btn-primary { inline-size: 100%; margin-block-start: var(--s-2); }
.acct-actions { display: flex; flex-direction: column; gap: var(--s-2); margin-block-start: var(--s-4); }
.acct-actions .btn-primary, .acct-actions .btn-ghost { inline-size: 100%; }
.acct-switch { text-align: center; color: var(--text-2); font-size: .875rem; margin-block-start: var(--s-2); }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--brand-strong); font: inherit; font-weight: 600; text-decoration: underline;
}
.linklike:disabled { color: var(--text-3); text-decoration: none; cursor: default; }

/* Sign-in / create-account / reset: one card per journey. The title and the
   "Step n of 3" marker stay fixed while the body moves phone -> code ->
   password, so the three steps read as one registration flow. */
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-5) var(--s-4) var(--s-4);
}
.auth-title { font-size: 1.125rem; font-weight: 700; margin-block-end: var(--s-1); }
.auth-card .acct-hint { margin-block-end: var(--s-4); }
.auth-card .acct-form { margin-block-end: 0; }
.auth-card .acct-form + .acct-form, .auth-card #su-otp:not([hidden]) { margin-block-start: var(--s-2); }
.auth-step { font-size: .75rem; font-weight: 600; color: var(--text-3); margin-block-end: 6px; }
.auth-progress { display: flex; gap: 4px; margin-block-end: var(--s-4); }
.auth-progress span { flex: 1 1 0; block-size: 4px; border-radius: var(--r-pill); background: var(--surface-sunk); }
.auth-progress span.on { background: var(--brand); }
.auth-verified {
  display: flex; align-items: center; gap: 6px; margin-block-end: var(--s-3);
  font-size: .8125rem; font-weight: 600; color: var(--brand-strong);
}
.auth-verified .icon { inline-size: 15px; block-size: 15px; flex: 0 0 auto; }
/* quiet secondary actions under a primary button; 40px rows keep them tappable */
.auth-aside { text-align: center; margin-block-start: var(--s-1); }
.auth-links { display: flex; justify-content: center; gap: var(--s-6); margin-block-start: var(--s-1); }
.auth-aside .linklike, .auth-links .linklike, .acct-switch .linklike, .checkout-auth-note .linklike {
  min-block-size: 40px; padding-inline: var(--s-1); font-size: .875rem;
}
/* inside the sticky checkout bar every px of height counts; 32px still clears 24px AA */
.checkout-auth-note .linklike { min-block-size: 32px; font-size: .8125rem; }
.device-local-note--link {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--brand-strong); font-weight: 600;
  min-block-size: 32px;   /* whole-row tap target */
}
.device-local-note--link .icon { inline-size: 16px; block-size: 16px; }
.order-row--link {
  inline-size: 100%; text-align: inherit; background: none; border: 0; cursor: pointer;
  font: inherit; color: inherit;
}
.order-row--link:active { background: var(--surface-sunk); }

/* Task 6 — Add-to-Order MVP banners */
.addorder-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; inline-size: 100%; text-align: center; font-weight: 600;
}
.addorder-banner .addorder-countdown { font-weight: 400; color: var(--text-2); }
.addorder-banner--reentry {
  margin-block-end: var(--s-4); padding: 10px var(--s-6); border-radius: var(--r-md);
  background: var(--surface-sunk); border: 1px solid var(--border);
  color: var(--brand-strong); font-size: 0.9rem;
}

.od-head { font-size: .9375rem; font-weight: 700; margin: var(--s-4) 0 var(--s-2); }
.od-items { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-block-end: var(--s-4); }
.od-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
}
.od-item + .od-item { border-block-start: 1px solid var(--border); }
.od-item-name { flex: 1 1 auto; font-size: .9375rem; }
.od-item-qty { color: var(--text-3); font-size: .875rem; flex: 0 0 auto; }
.od-item-price { font-weight: 600; font-size: .9375rem; flex: 0 0 auto; }
.od-totals { margin-block-start: 0; }

/* --- Phase B continuation: status pills, hints, synced notes --- */
.device-local-note {
  display: flex; align-items: center; gap: 8px;
}
.device-local-note .icon { inline-size: 15px; block-size: 15px; flex: 0 0 auto; }
.field-hint { display: block; font-size: .75rem; color: var(--text-3); margin-block-start: 4px; }
.field-hint a { display: inline-block; padding-block: 3px; }   /* >=24px target (WCAG 2.5.8) */

.order-status.ost {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-sunk); color: var(--text-2);
}
.order-status.ost::before { content: ""; inline-size: 5px; block-size: 5px; border-radius: 50%; background: currentColor; }
.order-status.ost.st-NEW { background: color-mix(in srgb, #2f6ab0 12%, #fff); color: #2f6ab0; }
.order-status.ost.st-CONFIRMED { background: #e6f2ec; color: #1c6b45; }
.order-status.ost.st-PREPARING { background: color-mix(in srgb, #9a6a12 14%, #fff); color: #9a6a12; }
.order-status.ost.st-OUT_FOR_DELIVERY { background: color-mix(in srgb, #6a4fb0 14%, #fff); color: #6a4fb0; }
.order-status.ost.st-DELIVERED { background: #e6f2ec; color: #1c6b45; }
.order-status.ost.st-CANCELLED { background: color-mix(in srgb, #b23b30 12%, #fff); color: #b23b30; }
.account-row .v .order-status.ost { font-size: .6875rem; }
#success-orders { margin-block-end: var(--s-3); }

.acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-block-end: var(--s-3); }
.acct-head .acct-subhead { margin-block-end: 0; }
.saved-note { display: flex; align-items: center; gap: 7px; color: var(--brand-strong); font-size: .8125rem; font-weight: 600; margin-block-end: var(--s-3); }
.saved-note .icon { inline-size: 15px; block-size: 15px; }
.acct-form input:disabled { color: var(--text-3); background: var(--surface-sunk); }

/* ==========================================================================
   Saved addresses (Phase C-3)
   ========================================================================== */
.acct-addr-head { margin-block-start: var(--s-6); }
#acct-addresses { display: flex; flex-direction: column; gap: var(--s-3); }
.addr-card {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
}
.addr-card--default { border-color: var(--brand); background: var(--brand-tint-soft, #f1f6f3); }
.addr-card-head { display: flex; align-items: center; gap: var(--s-2); margin-block-end: 6px; }
.addr-card-head strong { font-size: .9375rem; font-weight: 700; }
.addr-badge {
  font-size: .6875rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--on-brand, #fff);
}
.addr-lines { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); font-size: .875rem; }
.addr-lines .num { direction: ltr; unicode-bidi: plaintext; }
.addr-zone { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-strong); font-weight: 600; }
.addr-zone .icon { inline-size: 14px; block-size: 14px; }
.addr-card-actions { display: flex; gap: var(--s-4); margin-block-start: var(--s-3); }
.linklike.danger { color: var(--danger); }
.acct-form .check { display: flex; align-items: center; gap: var(--s-2); font-size: .875rem; margin-block-end: var(--s-3); }
.acct-form .check input { inline-size: auto; }

/* ==========================================================================
   Checkout — saved addresses + delivery area (Phase C-4)
   ========================================================================== */
#checkout-form .check { display: flex; align-items: flex-start; gap: var(--s-2); font-size: .875rem; margin-block-start: var(--s-3); }
#checkout-form .check input { inline-size: auto; margin-block-start: 3px; }
.co-saved-title { font-size: .8125rem; font-weight: 600; color: var(--text-2); margin-block-end: var(--s-2); }
.co-addr-chips { display: flex; flex-direction: column; gap: var(--s-2); margin-block-end: var(--s-3); }
.co-addr-chip {
  display: block; inline-size: 100%; text-align: start; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: var(--s-3); font: inherit; color: inherit;
}
.co-addr-chip.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-tint-soft, #f1f6f3); }
.co-addr-chip strong { display: block; font-size: .9375rem; font-weight: 700; margin-block-end: 2px; }
.co-addr-chip span { display: block; font-size: .8125rem; color: var(--text-2); }
.co-addr-chip .co-addr-text { white-space: normal; }
.co-addr-chip .co-def { font-size: .625rem; font-weight: 700; padding: 1px 6px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand, #fff); }
.co-addr-zone { display: inline-flex !important; align-items: center; gap: 4px; color: var(--brand-strong); font-weight: 600; margin-block-start: 3px; }
.co-addr-zone .icon { inline-size: 13px; block-size: 13px; }
.co-addr-new { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--brand-strong); }
.co-addr-new .icon { inline-size: 15px; block-size: 15px; }
#co-zone select {
  inline-size: 100%; min-block-size: 44px; padding: 0 var(--s-3);
  border: 1px solid var(--border-strong, #d9d3c8); border-radius: var(--r-md);
  background: var(--surface); font: inherit; color: inherit;
}
.co-zone-line { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-strong); font-size: .875rem; margin-block-end: var(--s-2); }
.co-zone-line .icon { inline-size: 15px; block-size: 15px; }

/* ==========================================================================
   Phase E — order timeline, reorder, cancellation request
   ========================================================================== */

.notice.ok { color: var(--brand-strong, var(--text)); }

.od-cxl-note {
  margin-block-start: var(--s-3);
  display: flex; align-items: flex-start; gap: 6px;
  font-size: .8125rem; font-weight: 500; color: var(--danger);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-sunk); border-radius: var(--r-md);
}
.od-cxl-note .icon { inline-size: 15px; block-size: 15px; flex: 0 0 auto; margin-top: 1px; }

.ot { list-style: none; margin: 0 0 var(--s-4); padding: 0; }
.ot-row { position: relative; display: flex; gap: 10px; padding-block-end: var(--s-3); }
.ot-row:not(:last-child)::before {
  content: ""; position: absolute; inset-inline-start: 5px; top: 14px; bottom: 0;
  inline-size: 2px; background: var(--border);
}
.ot-dot {
  flex: 0 0 auto; inline-size: 12px; block-size: 12px; margin-block-start: 2px;
  border-radius: 50%; background: var(--brand); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.ot-row--cxl .ot-dot { background: var(--danger); }
.ot-main { display: flex; flex-direction: column; gap: 1px; font-size: .875rem; }
.ot-time { color: var(--text-3); font-size: .75rem; }

.od-actions { display: flex; flex-direction: column; gap: var(--s-2); margin-block-start: var(--s-4); }
.od-actions .btn-ghost, .od-actions .btn-primary { inline-size: 100%; }
.od-actions .btn-ghost .icon { inline-size: 16px; block-size: 16px; }
.od-danger { color: var(--danger); }
#od-msg .btn-primary { inline-size: 100%; margin-block-start: var(--s-2); }

/* ---- iOS Safari: stop auto-zoom when a form field gains focus ----
   iOS zooms the viewport whenever a focused control's font-size is < 16px.
   The main .search-input is already 16px; this covers the checkout / account
   fields (which inherit the 15px body size) on phones only. Desktop unchanged. */
@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea { font-size: 16px; }
}

/* Task 7 — shrink the product sheet on mobile: less image, tighter
   whitespace, Add-to-Cart stays pinned and reachable via .sheet-action
   (unchanged). Desktop keeps the wider 42dvh/s-4 rules above. */
@media (max-width: 430px) {
  .sheet-media { max-block-size: 30dvh; margin-block-end: var(--s-3); }
  .sheet-body { padding: var(--s-3) var(--s-4) var(--s-3); }
  .sheet-title { font-size: 1.0625rem; }
  .sheet-price { margin-block-start: var(--s-2); }
  .sheet-desc { margin-block-start: var(--s-3); }
  .avail { margin-block-start: var(--s-2); }
}

/* toast: non-blocking feedback, above the sheet (z 50) and header */
.toast-host {
  position: fixed; inset-block-start: var(--s-3); inset-inline: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding-inline: var(--s-4); pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: flex-start; gap: var(--s-2);
  inline-size: min(100%, 420px); padding: 10px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-inline-start: 4px solid var(--text-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  font-size: .875rem; font-weight: 500; line-height: 1.4;
}
.toast .icon { flex: 0 0 auto; inline-size: 18px; block-size: 18px; margin-block-start: 1px; color: var(--text-2); }
.toast-msg { flex: 1 1 auto; overflow-wrap: anywhere; }
.toast--success { border-inline-start-color: var(--brand); }
.toast--success .icon { color: var(--brand); }
.toast--error { border-inline-start-color: var(--danger); background: var(--danger-tint); }
.toast--error .icon { color: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in var(--dur-2) var(--ease); }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
.toast-x { flex: 0 0 auto; display: grid; place-items: center; inline-size: 24px; block-size: 24px; margin: -2px; border-radius: var(--r-sm); color: var(--text-3); }
.toast-x:hover { color: var(--text); }
.toast-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.toast .toast-x .icon { inline-size: 14px; block-size: 14px; margin: 0; color: inherit; }

/* account: verified phone marker (text + icon, not colour alone) */
.acct-verified { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: var(--s-2); color: var(--brand); font-size: .75rem; font-weight: 600; }
.acct-verified .icon { inline-size: 14px; block-size: 14px; }

/* ==========================================================================
   Visual polish — typography
   Arabic is a joined script: any letter-spacing (positive tracking or negative
   tightening) breaks the letter joins in Cairo. Reset it in RTL only; Latin
   text in LTR keeps its tracking. Headings balance their line breaks where the
   browser supports it (no effect elsewhere).
   ========================================================================== */
[dir="rtl"], [dir="rtl"] *, [dir="rtl"] *::before, [dir="rtl"] *::after { letter-spacing: 0 !important; }
:is(h1, h2, h3) { text-wrap: balance; }
