/*
  Store PWA styles. Every colour, radius and font comes from the --store-* custom properties that
  Grocery.Customer.Host renders per store (see ThemeCss). Do not hard-code colours here: derive them with color-mix().
*/

:root {
    --c-primary: var(--store-primary);
    /* The primary colour when used as text or a thin line on cards: readable even for bright brand colours. */
    --c-primary-ink: var(--store-primary-ink, var(--store-primary));
    --c-on-primary: var(--store-on-primary);
    --c-secondary: var(--store-secondary);
    --c-accent: var(--store-accent);
    --c-on-accent: var(--store-on-accent);
    --c-bg: var(--store-bg);
    --c-surface: var(--store-surface);
    --c-nav-bg: var(--store-bottom-nav-bg, var(--store-surface));
    --c-text: var(--store-text);
    --c-danger: var(--store-danger);
    --c-on-danger: var(--store-on-danger);
    --c-muted: color-mix(in srgb, var(--store-text) 62%, var(--store-surface));
    --c-subtle: color-mix(in srgb, var(--store-text) 6%, var(--store-surface));
    --c-border: color-mix(in srgb, var(--store-text) 13%, var(--store-surface));
    --c-primary-soft: color-mix(in srgb, var(--store-primary) 12%, var(--store-surface));
    --c-skeleton: color-mix(in srgb, var(--store-text) 8%, var(--store-surface));
    --c-skeleton-shine: color-mix(in srgb, var(--store-text) 3%, var(--store-surface));
    --shadow-sm: 0 1px 2px color-mix(in srgb, var(--store-text) 12%, transparent);
    --shadow-md: 0 4px 16px color-mix(in srgb, var(--store-text) 14%, transparent);
    --radius: var(--store-radius);
    --radius-sm: calc(var(--store-radius) * 0.6);
    --radius-pill: 999px;
    --font: var(--store-font);
    --touch: 44px;
    --gutter: 16px;
    --header-h: 112px;
    --nav-h: 64px;
    --max-w: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Splash (server-rendered, shown until Blazor starts) ---------- */
.splash {
    position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: var(--store-splash); color: var(--store-on-primary);
}
.splash__logo { width: 96px; height: 96px; border-radius: 24px; object-fit: contain; }
.splash__name { margin: 0; font-size: 1.4rem; font-weight: 700; }
.splash__spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--store-on-primary) 30%, transparent);
    border-top-color: var(--store-on-primary);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App frame ---------- */
/* clip (not hidden) keeps the sticky header working while stopping any page from scrolling sideways. */
.app { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }

.app-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--c-primary); color: var(--c-on-primary);
    padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 12px;
    box-shadow: var(--shadow-sm);
}
.app-header__bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 8px; max-width: var(--max-w); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; min-height: var(--touch); }
.brand__logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: var(--c-surface); }

/* Restaurants, and any shop with a cover photo: the name sits centred above the search bar. */
.biz-restaurant .app-header__bar,
.app-header--photo .app-header__bar { display: grid; grid-template-columns: 1fr auto 1fr; }
.biz-restaurant .brand,
.app-header--photo .brand { grid-column: 2; justify-content: center; text-align: center; }
.brand__text { display: grid; gap: 2px; }
.brand__tagline { font-size: .85rem; font-weight: 500; opacity: .9; }

/* Header image as the background of the (pinned) header, behind the name and search. It is shown whole (contain), never
   cropped or stretched, centred; a blurred copy of it fills the space around it, so the header works at any width.
   The admin portal's header crop previews exactly this (Grocery.Admin ImageCropDialog). */
.app-header--photo {
    isolation: isolate; overflow: hidden; color: #fff;
    padding-top: calc(env(safe-area-inset-top) + 16px); padding-bottom: 14px;
    /* Keep the visual banner height in sync with the admin crop preview (143 desktop / 114 phone).
       Safe-area inset is handled by padding so devices with a notch do not become taller. */
    min-height: 143px;
}
@media (max-width: 767px) { .app-header--photo { min-height: 114px; } }
.app-header__photo, .app-header__photo-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.app-header__photo { z-index: -2; object-fit: contain; }
.app-header__photo-fill { z-index: -3; object-fit: cover; filter: blur(20px) saturate(1.2); transform: scale(1.15); }
.app-header--photo .app-header__bar { position: relative; margin-bottom: 0; }
/* No shading over the image (it keeps its real colours): a soft shadow keeps the name readable on any picture. */
.app-header--photo .brand { text-shadow: 0 1px 3px rgb(0 0 0 / .75), 0 0 14px rgb(0 0 0 / .5); }
.app-header--photo .brand { font-size: 1.5rem; }
.app-header--photo .brand__logo { width: 40px; height: 40px; }

.app-main {
    flex: 1; width: 100%; max-width: var(--max-w); margin: 0 auto;
    padding: 12px var(--gutter) calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------- Search bar ---------- */
/* Compact search (headers with a banner): a round button in the header row that opens into a full-width field over it. */
.search.search--compact { grid-column: 3; justify-self: end; margin: 0; max-width: none; }
.search__toggle {
    display: grid; place-items: center; width: var(--touch); height: var(--touch); border-radius: 50%; cursor: pointer;
    background: rgb(255 255 255 / .92); color: var(--c-text); box-shadow: 0 2px 8px rgb(0 0 0 / .25);
}
.search--compact:not(.search--open) .search__icon { display: none; }
.search--compact:not(.search--open) .search__input {
    position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; /* still focusable (Tab, the button) */
}
.search.search--compact.search--open {
    grid-column: auto; justify-self: stretch; /* placed against, and stretched over, the whole header row */
    position: absolute; inset: 0; z-index: 1; display: flex; align-items: center;
    animation: search-open .2s ease-out;
}
.search--compact.search--open .search__input { box-shadow: 0 2px 10px rgb(0 0 0 / .25); }
@keyframes search-open { from { clip-path: inset(0 0 0 calc(100% - var(--touch)) round 999px); } to { clip-path: inset(0 round 999px); } }
@media (prefers-reduced-motion: reduce) { .search--compact.search--open { animation: none; } }

.search { position: relative; max-width: var(--max-w); margin: 0 auto; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--c-muted); pointer-events: none; }
.search__input {
    width: 100%; height: var(--touch); padding: 0 44px 0 42px;
    border: 0; border-radius: var(--radius-pill);
    background: var(--c-surface); color: var(--c-text);
    font-size: 16px; /* prevents iOS zoom on focus */
}
.search__input::placeholder { color: var(--c-muted); }
.search__clear {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    width: var(--touch); height: var(--touch); border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); cursor: pointer;
}

/* ---------- Notices ---------- */
.notice { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); font-size: .9rem; }
.notice--offline { background: var(--c-text); color: var(--c-surface); justify-content: center; }
/* Shown (instead of reloading) when a new version arrives while the shopper is typing or paying. */
.update-banner {
    position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); width: min(420px, calc(100% - 2 * var(--gutter)));
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px;
    background: var(--c-text); color: var(--c-surface); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(0 0 0 / .25); font-size: .9rem;
}
.update-banner__button {
    flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-pill);
    background: var(--c-primary); color: var(--c-on-primary); font-weight: 700; cursor: pointer;
}
.notice--error { background: color-mix(in srgb, var(--c-danger) 10%, var(--c-surface)); color: var(--c-danger); border-radius: var(--radius); margin: 12px 0; }

.install {
    display: flex; align-items: center; gap: 12px; margin: 12px auto 0; max-width: var(--max-w);
    padding: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.install__icon { width: 44px; height: 44px; border-radius: 10px; flex: none; object-fit: contain; }
.install__text { flex: 1; font-size: .9rem; }
.install__text strong { display: block; font-size: 1rem; }
.install__ios-share { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--c-nav-bg); border-top: 1px solid var(--c-border);
}
.bottom-nav__item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: var(--touch); font-size: .75rem; color: var(--c-muted);
}
.bottom-nav__item.active { color: var(--c-primary-ink); font-weight: 600; }
.bottom-nav__icon { width: 24px; height: 24px; }
.bottom-nav__badge {
    position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--radius-pill); background: var(--c-accent); color: var(--c-on-accent);
    font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--touch); min-width: var(--touch); padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600;
    background: var(--c-subtle); color: var(--c-text);
}
.btn--primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn--outline { background: var(--c-surface); color: var(--c-primary-ink); border-color: var(--c-primary-ink); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Sections ---------- */
.section { margin: 20px 0; }
.section__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section__title { font-size: 1.15rem; font-weight: 700; }
.section__link { color: var(--c-primary-ink); font-weight: 600; font-size: .9rem; min-height: var(--touch); display: inline-flex; align-items: center; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 4px 0 12px; }

/* ---------- Banner carousel ---------- */
.carousel { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--c-skeleton); touch-action: pan-y; }
.carousel__track { display: flex; transition: transform .45s ease; will-change: transform; }
.carousel__track.dragging { transition: none; }
.carousel__slide { flex: 0 0 100%; aspect-ratio: 2 / 1; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel__dots { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; }
.carousel__dot { width: 28px; height: var(--touch); border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.carousel__dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--c-surface) 60%, transparent); }
.carousel__dot[aria-current="true"]::before { background: var(--c-surface); width: 18px; border-radius: var(--radius-pill); }
@media (min-width: 768px) { .carousel__slide { aspect-ratio: 3 / 1; } }

/* ---------- Categories ---------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .82rem; font-weight: 500; }
.category-card__image { width: 100%; aspect-ratio: 1; border-radius: var(--radius); background: var(--c-primary-soft); object-fit: cover; }

.category-list { display: grid; gap: 12px; }
.category-group { background: var(--c-surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.category-group__head { display: flex; align-items: center; gap: 12px; min-height: var(--touch); font-weight: 700; }
.category-group__head img { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; }
.category-group .chips { margin-top: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; margin: 4px 0;
    border-radius: var(--radius-pill); border: 1px solid var(--c-border); background: var(--c-surface); font-size: .88rem; cursor: pointer; white-space: nowrap;
}
.chip--active { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }

.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.select {
    min-height: var(--touch); padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface);
}
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); font-size: .9rem; }
.toggle input { width: 20px; height: 20px; accent-color: var(--c-primary-ink); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; font-size: .82rem; color: var(--c-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--c-primary-ink); }

/* ---------- Product tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--store-tile-min, 156px), 1fr)); gap: 10px; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(var(--store-tile-min, 156px), 44%); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
@media (min-width: 768px) { .scroller { grid-auto-columns: 180px; } }

/* Phones: a fixed number of products per row (3 for compact tiles, 2 for comfortable), never one huge tile. */
@media (max-width: 599px) {
    .tile-grid { grid-template-columns: repeat(var(--store-tile-cols, 2), minmax(0, 1fr)); gap: 8px; }
    .scroller {
        grid-auto-columns: calc((100% - (var(--store-tile-cols, 2) - 1) * 8px) / var(--store-tile-cols, 2) - 6px);
        gap: 8px;
    }
}

.tile {
    container-type: inline-size; min-width: 0;
    position: relative; display: flex; flex-direction: column;
    background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.tile__media { display: block; aspect-ratio: 1; background: var(--c-subtle); }
.tile__media img { width: 100%; height: 100%; object-fit: contain; }
/* Product without a photo (every shop type): its name on a colour picked from the product. */
.product-placeholder {
    display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center;
    --ph-bg: linear-gradient(135deg, hsl(var(--ph-hue) 62% 50%), hsl(calc(var(--ph-hue) + 35) 58% 36%));
    background: var(--ph-bg);
    color: #fff; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; text-shadow: 0 1px 3px rgb(0 0 0 / .35);
}
/* 24 placeholder colours, 15° apart round the colour wheel. */
.ph-0 { --ph-hue: 0; }
.ph-1 { --ph-hue: 15; }
.ph-2 { --ph-hue: 30; }
.ph-3 { --ph-hue: 45; }
.ph-4 { --ph-hue: 60; }
.ph-5 { --ph-hue: 75; }
.ph-6 { --ph-hue: 90; }
.ph-7 { --ph-hue: 105; }
.ph-8 { --ph-hue: 120; }
.ph-9 { --ph-hue: 135; }
.ph-10 { --ph-hue: 150; }
.ph-11 { --ph-hue: 165; }
.ph-12 { --ph-hue: 180; }
.ph-13 { --ph-hue: 195; }
.ph-14 { --ph-hue: 210; }
.ph-15 { --ph-hue: 225; }
.ph-16 { --ph-hue: 240; }
.ph-17 { --ph-hue: 255; }
.ph-18 { --ph-hue: 270; }
.ph-19 { --ph-hue: 285; }
.ph-20 { --ph-hue: 300; }
.ph-21 { --ph-hue: 315; }
.ph-22 { --ph-hue: 330; }
.ph-23 { --ph-hue: 345; }
.tile__placeholder { width: 100%; height: 100%; padding: 12px; font-size: clamp(.8rem, 9cqi, 1.25rem); }
.tile--out .tile__placeholder { opacity: .55; }
.tile__badge {
    position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: var(--radius-pill);
    background: var(--c-accent); color: var(--c-on-accent); font-size: .72rem; font-weight: 700;
}
.tile__body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; flex: 1; }
.tile__name { font-size: .88rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.tile__unit { font-size: .78rem; color: var(--c-muted); }
.tile__footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.tile--out .tile__media img { opacity: .45; }
.tile__oos { font-size: .78rem; font-weight: 600; color: var(--c-muted); }

.price { display: flex; flex-direction: column; line-height: 1.15; }
.price__now { font-weight: 700; }
.price__mrp { font-size: .78rem; color: var(--c-muted); text-decoration: line-through; }
.price--large .price__now { font-size: 1.4rem; }
.price--large { flex-direction: row; align-items: baseline; gap: 8px; }
.price__off { font-size: .85rem; font-weight: 700; color: var(--c-primary-ink); }

/* ---------- Add / stepper ---------- */
.add-btn {
    min-width: 64px; min-height: 36px; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--c-primary-ink); background: var(--c-surface); color: var(--c-primary-ink); font-weight: 700; font-size: .85rem;
}
.add-btn::after { content: ""; position: absolute; inset: -4px; } /* 44px touch target around a compact button */
.add-btn { position: relative; }
.stepper { display: inline-flex; align-items: center; border-radius: var(--radius-sm); background: var(--c-primary); color: var(--c-on-primary); min-height: 36px; }
.stepper__btn { position: relative; width: 32px; min-height: 36px; border: 0; background: transparent; color: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.stepper__btn::after { content: ""; position: absolute; inset: -4px -2px; }
.stepper__btn:disabled { opacity: .45; }
.stepper__qty { min-width: 24px; text-align: center; font-weight: 700; font-size: .9rem; }
.stepper--large { min-height: var(--touch); }
.stepper--large .stepper__btn { width: var(--touch); min-height: var(--touch); }
.add-btn--large { min-height: var(--touch); min-width: 140px; font-size: 1rem; }

/* Narrow tiles (3 per row on phones): smaller type, price above a full-width Add button / stepper. */
@container (max-width: 140px) {
    .tile__body { padding: 6px 7px 8px; }
    .tile__name { font-size: .78rem; }
    .tile__unit, .price__mrp { font-size: .7rem; }
    .price__now { font-size: .9rem; }
    .tile__badge { top: 4px; left: 4px; padding: 1px 6px; font-size: .62rem; }
    .tile__footer { flex-direction: column; align-items: stretch; gap: 6px; }
    .tile__footer .add-btn { width: 100%; min-width: 0; padding: 0 6px; }
    .tile__footer .stepper { width: 100%; justify-content: space-between; }
}

/* ---------- Skeletons ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--c-skeleton) 25%, var(--c-skeleton-shine) 37%, var(--c-skeleton) 63%);
    background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm);
}
.skeleton--media { aspect-ratio: 1; border-radius: 0; }
.skeleton--line { height: 12px; margin: 6px 0; }
.skeleton--short { width: 55%; }
.skeleton--banner { aspect-ratio: 2 / 1; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
    .skeleton, .splash__spinner { animation: none; }
    .carousel__track { transition: none; }
}

/* ---------- Search page ---------- */
.search-suggestions { display: grid; gap: 20px; }
.search-meta { color: var(--c-muted); font-size: .88rem; margin-bottom: 10px; }
.link-btn { border: 0; background: none; color: var(--c-primary-ink); font-weight: 600; cursor: pointer; min-height: var(--touch); }

/* ---------- Product page ---------- */
/* minmax(0, …): grid columns otherwise grow to their widest content (thumbnail strip, long names), pushing the page sideways. */
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.gallery { background: var(--c-surface); border-radius: var(--radius); padding: 8px; }
.gallery__main { aspect-ratio: 1; width: 100%; object-fit: contain; }
.gallery__placeholder { border-radius: var(--radius-sm); padding: 24px; font-size: clamp(1.4rem, 6vw, 2.4rem); }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery__thumb { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); cursor: pointer; overflow: hidden; }
.gallery__thumb[aria-current="true"] { border-color: var(--c-primary-ink); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__info { display: grid; gap: 12px; background: var(--c-surface); border-radius: var(--radius); padding: 16px; }
.product__brand { color: var(--c-muted); font-size: .9rem; }
.product__name { font-size: 1.35rem; overflow-wrap: anywhere; }
.product__description { white-space: pre-line; color: var(--c-text); overflow-wrap: anywhere; }
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-option {
    min-height: var(--touch); padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--c-border);
    background: var(--c-surface); cursor: pointer; text-align: left;
}
.variant-option[aria-pressed="true"] { border-color: var(--c-primary-ink); background: var(--c-primary-soft); }
.variant-option small { display: block; color: var(--c-muted); }
.variant-option:disabled { opacity: .5; }
.product__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tax-note { font-size: .8rem; color: var(--c-muted); }

/* ---------- Cart ---------- */
.cart-lines { display: grid; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--c-surface); border-radius: var(--radius); padding: 10px; }
.cart-line img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); background: var(--c-subtle); }
.cart-line__placeholder { width: 64px; height: 64px; padding: 4px; border-radius: var(--radius-sm); font-size: .62rem; }
.cart-line__name { font-weight: 600; font-size: .92rem; }
.cart-line__meta { font-size: .8rem; color: var(--c-muted); }
.summary { margin-top: 16px; background: var(--c-surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
.summary__row { display: flex; justify-content: space-between; }
.summary__row--total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--c-border); padding-top: 8px; }
.summary__saving { color: var(--c-primary-ink); font-weight: 600; }

/* ---------- Empty / error states ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--c-muted); }
.empty__title { font-size: 1.1rem; font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px var(--gutter);
    background: var(--c-danger); color: var(--c-on-danger); box-shadow: var(--shadow-md);
}
#blazor-error-ui .reload { text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; border: 0; background: none; color: inherit; cursor: pointer; min-width: var(--touch); min-height: 24px; }

/* ---------- Forms ---------- */
.form-card { background: var(--c-surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; display: grid; gap: 12px; box-shadow: var(--shadow-sm); }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.field__label { font-size: .88rem; font-weight: 600; }
.field__input {
    width: 100%; min-height: var(--touch); padding: 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    background: var(--c-surface); color: var(--c-text); font-size: 16px;
}
.field__input:focus { border-color: var(--c-primary-ink); outline: 2px solid var(--c-primary-soft); }
.field__input[aria-invalid="true"], .field__input.invalid { border-color: var(--c-danger); }
.field__input--code { letter-spacing: .5em; font-size: 1.3rem; text-align: center; }
.field__phone { display: flex; align-items: stretch; }
.field__prefix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--c-border); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--c-subtle); }
.field__phone .field__input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.field__error { color: var(--c-danger); font-size: .85rem; margin: 0; }
.field__hint { color: var(--c-primary-ink); font-size: .85rem; margin: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--c-muted); font-size: .9rem; margin: 0; }
.center { text-align: center; }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--c-primary-soft); color: var(--c-primary-ink); font-size: .75rem; font-weight: 700; margin-left: 6px; }

.menu { display: grid; background: var(--c-surface); border-radius: var(--radius); overflow: hidden; }
.menu__item { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--c-border); background: none; text-align: left; cursor: pointer; font-weight: 600; }
.menu__item:last-child { border-bottom: 0; }

.address-list, .choice-list { display: grid; gap: 10px; }
.address-card { background: var(--c-surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.address-card__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.address-summary p { margin: 2px 0; }
.address-summary__title { font-weight: 700; }

.choice {
    display: block; width: 100%; text-align: left; padding: 12px; border-radius: var(--radius-sm); cursor: pointer;
    border: 2px solid var(--c-border); background: var(--c-surface);
}
.choice[aria-checked="true"] { border-color: var(--c-primary-ink); background: var(--c-primary-soft); }
.choice--inline { display: grid; gap: 2px; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slot {
    display: grid; gap: 2px; min-height: 56px; padding: 8px 10px; text-align: left; cursor: pointer;
    border: 2px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface);
}
.slot[aria-checked="true"] { border-color: var(--c-primary-ink); background: var(--c-primary-soft); }
.slot:disabled { opacity: .5; cursor: not-allowed; }

.notice--warning { background: color-mix(in srgb, var(--c-accent) 18%, var(--c-surface)); color: var(--c-text); border-radius: var(--radius); margin: 0 0 12px; align-items: flex-start; }
.notice--warning p { margin: 4px 0 8px; }
.change-list { margin: 6px 0 10px; padding-left: 18px; font-size: .9rem; }
.review-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.review-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.checkout { display: grid; gap: 0; }

.success-banner { display: flex; gap: 12px; align-items: center; background: var(--c-primary-soft); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.success-banner__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c-primary); color: var(--c-on-primary); font-size: 1.4rem; font-weight: 700; flex: none; }
.success-banner .page-title { margin: 0 0 4px; }
.success-banner p { margin: 0; }

/* ---------- Offers ---------- */
.badge--gift { background: var(--c-accent); color: var(--c-on-accent); margin-left: 0; }
.offer-hint {
    margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600;
    background: color-mix(in srgb, var(--c-accent) 16%, var(--c-surface)); color: var(--c-text);
}

/* ---------- Orders: history, tracking, push opt-in (Phase 5) */
.badge--success { background: color-mix(in srgb, #16a34a 14%, var(--c-surface)); color: color-mix(in srgb, #16a34a 80%, var(--c-text)); }
.badge--danger { background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface)); color: var(--c-danger); }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.order-card { display: grid; gap: 10px; background: var(--c-surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.order-card:hover { box-shadow: var(--shadow-md); }
.order-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-card__number { font-weight: 700; }
.order-card__thumbs { display: flex; gap: 6px; min-height: 44px; }
.order-card__thumbs img { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: contain; background: var(--c-subtle); }
.order-card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .95rem; }

.tracker-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--c-primary-ink); }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live__dot { animation: none; } }

.tracker { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.tracker__step { position: relative; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; min-height: 40px; color: var(--c-muted); }
.tracker__step::before { content: ""; position: absolute; left: 11px; top: -12px; height: 24px; width: 2px; background: var(--c-border); }
.tracker__step:first-child::before { display: none; }
.tracker__dot { width: 14px; height: 14px; margin-left: 5px; border-radius: 50%; border: 2px solid var(--c-border); background: var(--c-surface); z-index: 1; }
.tracker__step--done { color: var(--c-text); }
.tracker__step--done::before { background: var(--c-primary-ink); }
.tracker__step--done .tracker__dot { background: var(--c-primary-ink); border-color: var(--c-primary-ink); }
.tracker__step--current .tracker__label { font-weight: 700; }
.tracker__step--current .tracker__dot { box-shadow: 0 0 0 4px var(--c-primary-soft); }
.tracker__time { font-size: .8rem; color: var(--c-muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline__item { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.timeline__time { color: var(--c-muted); font-size: .85rem; }

.push-card { display: flex; align-items: center; gap: 12px; background: var(--c-primary-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.push-card__icon { width: 28px; height: 28px; flex: none; color: var(--c-primary-ink); }
.push-card__text { flex: 1; font-size: .9rem; }
.push-card__text p { margin: 2px 0 0; color: var(--c-muted); }

.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.order-actions .btn { flex: 1 1 140px; }
.btn--danger { background: var(--c-danger); color: var(--c-on-danger); border-color: var(--c-danger); }
.btn--danger-text { color: var(--c-danger); }
.radio { display: flex; align-items: center; gap: 10px; min-height: var(--touch); font-size: .95rem; }
.radio input { width: 20px; height: 20px; accent-color: var(--c-primary-ink); }

/* ---------- Accessibility (Phase 8) */
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); border: 0;
    background: var(--c-primary); color: var(--c-on-primary); font-weight: 700; cursor: pointer;
}
.skip-link:focus { top: 8px; }
.app-main:focus { outline: none; }
.carousel__toggle {
    position: absolute; right: 8px; bottom: 8px; width: var(--touch); height: var(--touch); border: 0; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: color-mix(in srgb, var(--store-text) 55%, transparent); color: #fff;
}
.carousel__toggle svg { width: 20px; height: 20px; }

/* ---------- Store labels (StoreText / StoreSection) and the in-place editor for platform developers */
.lbl--image { display: inline-block; max-height: 2.5em; width: auto; vertical-align: middle; }
.lbl--editable { outline: 1px dashed color-mix(in srgb, var(--c-accent) 70%, transparent); outline-offset: 2px; cursor: text; }
.lbl--editable:hover { outline-style: solid; background: color-mix(in srgb, var(--c-accent) 12%, transparent); }
.lbl--hidden, .lbl-region--hidden { opacity: .45; text-decoration: line-through; }
.lbl-region--hidden { outline: 2px dashed var(--c-danger); outline-offset: 2px; cursor: pointer; }
.is-editing [data-product-images] { outline: 2px dashed color-mix(in srgb, var(--c-accent) 70%, transparent); outline-offset: -2px; cursor: pointer; }
.is-editing .gallery[data-product-images] { min-height: 120px; }

.lbl-toolbar {
    position: fixed; z-index: 900; right: 8px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100vw - 16px);
    padding: 8px 12px; border-radius: var(--radius); background: var(--c-text); color: var(--c-surface);
    box-shadow: var(--shadow-md); font-size: .85rem;
}
.lbl-toolbar__switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lbl-toolbar__switch input { width: 18px; height: 18px; accent-color: var(--c-accent); }
.lbl-toolbar__btn {
    min-height: 32px; padding: 0 10px; border: 1px solid currentColor; border-radius: var(--radius-pill);
    background: transparent; color: inherit; cursor: pointer;
}
.lbl-toolbar__hint { flex-basis: 100%; opacity: .8; }
/* Cropping a new product photo before upload (in-place editor). */
.lbl-crop { display: grid; gap: 10px; margin: 8px 0; }
.lbl-crop__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lbl-crop__tools input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--c-primary); }
.crop-stage { width: 100%; display: grid; place-items: center; min-height: 220px; background: #111; border-radius: var(--radius-sm); overflow: hidden; }
.crop-canvas { display: block; touch-action: none; user-select: none; }

.lbl-dialog-backdrop {
    position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: var(--gutter);
    background: color-mix(in srgb, var(--store-text) 45%, transparent);
}
.lbl-dialog {
    width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; padding: 16px;
    border-radius: var(--radius); background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-md);
}
.lbl-dialog--list { max-width: 560px; }
.lbl-dialog__title { font-size: 1.1rem; margin-bottom: 4px; }
.lbl-dialog__key { margin: 0 0 8px; color: var(--c-muted); font-size: .8rem; }
.lbl-dialog__image { display: grid; gap: 8px; justify-items: start; margin-bottom: 8px; }
.lbl-dialog__image img { max-height: 120px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.lbl-dialog__image .btn { position: relative; cursor: pointer; }
.lbl-dialog__upload { position: relative; margin: 8px 0 4px; cursor: pointer; }
.lbl-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.lbl-dialog__spacer { flex: 1; }
.lbl-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lbl-list__group { margin-top: 12px; font-weight: 700; font-size: .8rem; text-transform: uppercase; color: var(--c-muted); }
.lbl-list__item {
    display: grid; width: 100%; padding: 8px; border: 0; border-bottom: 1px solid var(--c-border);
    background: none; text-align: left; cursor: pointer;
}
.lbl-list__item:hover { background: var(--c-subtle); }
.lbl-list__item small { color: var(--c-muted); }
.lbl-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 8px 0; }
.lbl-images__item { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.lbl-images__item--main { border-color: var(--c-primary-ink); }
.lbl-images__item img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.lbl-images__item .btn { min-height: 32px; padding: 0 8px; font-size: .8rem; }

/* ---------- Marketplace app ---------- */
.mk-header .brand { font-size: 1.2rem; }
.mk-signed-in { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c-on-primary) 18%, transparent); }
.mk-main { padding-bottom: 32px; }
.mk-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mk-card {
    display: flex; gap: 12px; align-items: center; min-height: 76px; padding: 12px;
    background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.mk-card:hover { box-shadow: var(--shadow-md); }
.mk-card--skeleton { height: 76px; border-radius: var(--radius); }
.mk-card__body { display: grid; gap: 2px; min-width: 0; }
.mk-card__name { font-weight: 700; }
.mk-card__tagline { font-size: .85rem; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card__meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.mk-card__meta .badge { margin-left: 0; }
.mk-open { color: var(--c-primary-ink); font-weight: 600; }
.mk-closed { color: var(--c-muted); }
.mk-carts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mk-cart { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.mk-cart > span:nth-child(2) { display: grid; flex: 1; }
.mk-cart small { color: var(--c-muted); }
.mk-cart__go { color: var(--c-primary-ink); font-weight: 700; font-size: .9rem; }
.mk-recent { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 14px; overflow-x: auto; }
.mk-recent__item { display: grid; justify-items: center; gap: 6px; width: 72px; font-size: .78rem; text-align: center; }
.shop-mark { flex: none; border-radius: 14px; object-fit: contain; background: var(--c-surface); box-shadow: var(--shadow-sm); }
.shop-mark--initial { display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }

/* ---------- Business types ---------- */
/* Food-type marks are the standard Indian symbols, so their colours are fixed rather than themed. */
.food-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid; border-radius: 2px; vertical-align: -2px; flex: none; margin-right: 6px; }
.food-mark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.food-mark--veg { color: #0F8A3C; }
.food-mark--nonveg { color: #8B2C1E; }
.food-mark--nonveg::after { width: 0; height: 0; border-radius: 0; background: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid currentColor; }
.food-mark--egg { color: #C68A00; }
.spice { font-size: .8rem; letter-spacing: -2px; margin-left: 6px; }

.tile__brand { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.tile__per-unit { white-space: nowrap; }
.add-btn--link { display: inline-grid; place-items: center; text-align: center; }

/* Fashion: tall photos that fill the tile, like a lookbook. */
.biz-fashion .tile__media { aspect-ratio: 3 / 4; }
.biz-fashion .tile__media img { object-fit: cover; }
.biz-fashion .gallery__main { aspect-ratio: 3 / 4; object-fit: cover; }

.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatch {
    width: 32px; height: 32px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 2px solid var(--c-surface); box-shadow: 0 0 0 1px var(--c-border);
}
.swatch--selected { box-shadow: 0 0 0 2px var(--c-primary-ink); }
.swatch--small { width: 14px; height: 14px; border-width: 1px; cursor: default; display: inline-block; }
.picker { display: grid; gap: 8px; }
.picker__label { font-size: .9rem; color: var(--c-muted); }
.picker__label b { color: var(--c-text); }
.size-option { min-width: 52px; text-align: center; }
.size-option--out { text-decoration: line-through; color: var(--c-muted); }
.returns-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--c-primary-ink); font-weight: 600; }
.size-chart summary { cursor: pointer; font-weight: 600; color: var(--c-primary-ink); min-height: var(--touch); display: flex; align-items: center; }
.attributes { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .92rem; }
.attributes dt { color: var(--c-muted); }
.attributes dd { margin: 0; }
.filters { display: grid; gap: 8px; margin-bottom: 8px; }
.chip--color { display: inline-flex; align-items: center; gap: 6px; }

/* Restaurant: the menu. */
.menu-eta { margin: 0 0 8px; font-weight: 600; color: var(--c-primary-ink); }
.menu-tools { position: sticky; top: var(--header-h); z-index: 10; background: var(--c-bg); padding: 6px 0; display: flex; align-items: center; gap: 12px; }
.menu-tabs { flex: 1; min-width: 0; }
.menu-veg { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; }
.menu-section { scroll-margin-top: calc(var(--header-h) + 56px); }
.menu-list { display: grid; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.menu-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px; border-bottom: 1px solid var(--c-border); }
.menu-item:last-child { border-bottom: 0; }
.menu-item--out { opacity: .6; }
.menu-item__text { display: grid; gap: 4px; align-content: start; min-width: 0; }
.menu-item__marks { display: flex; align-items: center; gap: 6px; }
.menu-item__name { font-weight: 700; }
.menu-item__description { margin: 2px 0 0; font-size: .85rem; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item__side { display: grid; justify-items: center; gap: 0; width: 112px; }
.menu-item__image { width: 112px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); background: var(--c-subtle); }
.menu-item__photo { display: block; }
.menu-item__image.product-placeholder { background: var(--ph-bg); font-size: .82rem; }
.menu-item__add { margin-top: -18px; display: grid; justify-items: center; gap: 2px; }
.menu-item__side > .menu-item__add:first-child { margin-top: 0; }
.menu-item__add .add-btn, .menu-item__add .stepper { box-shadow: var(--shadow-sm); }
.menu-item__customisable { font-size: .7rem; color: var(--c-muted); }
.asap { margin: 0; }
.review-lines__addons { display: block; font-size: .8rem; }

/* Add-ons sheet (a dish's choices). */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--c-text) 45%, transparent); }
.sheet {
    position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
    background: var(--c-surface); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-md);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { .sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: 480px; border-radius: var(--radius); } }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 16px 16px 8px; }
.sheet__head > div { display: grid; gap: 4px; }
.sheet__title { font-size: 1.15rem; }
.sheet__body { overflow-y: auto; padding: 0 16px 16px; display: grid; gap: 12px; }
.dish-group { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.dish-group__title { font-weight: 700; padding: 0; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.dish-group__rule { font-size: .78rem; font-weight: 600; color: var(--c-muted); }
.dish-option { display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 4px; cursor: pointer; border-bottom: 1px solid var(--c-border); }
.dish-option input { width: 20px; height: 20px; accent-color: var(--c-primary); }
.dish-option__name { flex: 1; }
.dish-option__price { color: var(--c-muted); font-size: .9rem; }
.dish-option--off { opacity: .5; cursor: not-allowed; }
.dish-add { display: flex; gap: 12px; align-items: center; position: sticky; bottom: 0; background: var(--c-surface); padding-top: 8px; }
.dish-add__button { flex: 1; }

/* ---------- Generic listing ---------- */
/* Home: category menu on the left, items three per row. On phones the menu is a drawer opened from a button. */
.listing { display: grid; gap: 16px; align-items: start; }
.listing__items { display: grid; gap: 20px; min-width: 0; }
.listing__section .section__title { margin-bottom: 10px; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.listing__menu { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px 8px; }
.listing__menu-title { font-weight: 700; padding: 0 8px 8px; margin: 0; }
.listing-menu, .listing-menu__items { list-style: none; margin: 0; padding: 0; }
.listing-menu__category {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: var(--touch);
    padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--c-text);
    font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.listing-menu__category:hover { background: var(--c-subtle); }
.listing-menu__category[aria-current="true"] { background: color-mix(in srgb, var(--c-primary) 14%, transparent); color: var(--c-primary-ink); }
.listing-menu__count { font-size: .78rem; font-weight: 600; color: var(--c-muted); }
.listing-menu__items { margin: 2px 0 8px 12px; border-left: 2px solid var(--c-border); }
.listing-menu__items a { display: block; padding: 8px 10px; font-size: .88rem; color: var(--c-muted); overflow-wrap: anywhere; }
.listing-menu__items a:hover { color: var(--c-primary-ink); }
.listing__toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); margin-bottom: 12px; padding: 0 14px;
    border: 1px solid var(--c-border); border-radius: var(--radius-pill); background: var(--c-surface); color: var(--c-text);
    font: inherit; font-weight: 600; cursor: pointer;
}
.listing__scrim { display: none; }

@media (max-width: 767px) {
    .listing__menu {
        position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 85vw); overflow-y: auto; border-radius: 0;
        padding-top: calc(env(safe-area-inset-top) + 16px); transform: translateX(-100%); visibility: hidden;
        transition: transform .2s ease, visibility .2s;
    }
    .listing__menu--open { transform: none; visibility: visible; }
    .listing__scrim { display: block; position: fixed; z-index: 39; inset: 0; background: rgb(0 0 0 / .4); }
    .listing-grid { gap: 8px; }
}
@media (min-width: 768px) {
    .listing { grid-template-columns: 240px minmax(0, 1fr); }
    .listing__toggle { display: none; }
    .listing__menu {
        position: sticky; top: calc(var(--header-h, 120px) + 12px);
        max-height: calc(100vh - var(--header-h, 120px) - 24px); overflow-y: auto;
    }
    .listing-grid { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { .listing__menu { transition: none; } }

/* Item page: the product photo, blurred and darkened, fills the screen behind the page. */
.showcase { position: relative; isolation: isolate; }
.showcase__backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #111; }
.showcase__backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.3); transform: scale(1.15); opacity: .85; }
.showcase__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(0 0 0 / .2), rgb(0 0 0 / .55)); }
.showcase .breadcrumb, .showcase .breadcrumb a { color: rgb(255 255 255 / .9); }
.showcase .gallery { background: rgb(255 255 255 / .12); backdrop-filter: blur(6px); box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.showcase .gallery__main { border-radius: var(--radius-sm); }
.showcase .product__info { background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(10px); box-shadow: 0 12px 40px rgb(0 0 0 / .3); }
.showcase .section__title { color: inherit; }
.showcase > .section > .section__header .section__title { color: #fff; }

