/* ============================================================
   Ellibo Online Store - storefront styles (v3, modern look)
   Mobile-first: base rules are phone; min-width queries layer on
   tablet then desktop. Class names and ids are the ones store.js,
   book.php and order_success.php use: keep them.
   ============================================================ */

:root {
    /* Colours (names kept: book.php / order_success.php use them) */
    --ink: #1c1f26;
    --ink-soft: #4b5160;
    --muted: #7a8090;
    --paper: #ffffff;          /* cards, bars, sheets */
    --paper-alt: #f2f3f6;      /* soft fills */
    --bg: #f6f7f9;             /* page */
    --line: #e6e8ed;
    --accent: #f05a28;         /* buttons, active chips, prices to act on */
    --accent-dark: #d64616;
    --accent-soft: #fff1ea;
    --amber: var(--accent);
    --amber-dark: var(--accent-dark);
    --green: #138a4a;
    --green-soft: #e8f6ee;
    --red: #d93a2b;
    --red-soft: #fdecea;

    --font-display: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif; /* money: tabular figures (see .mono) */

    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);

    --header-h: 0px;   /* measured by store.js (updateStickyOffsets) */
}

* { box-sizing: border-box; }
/* store.js hides parts with the hidden attribute (empty cart: bar, totals, Checkout): never let a display rule show them */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

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

/* ---------- Not-found / coming-soon states ---------- */
.state-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; }
.state-card { max-width: 420px; text-align: center; background: var(--paper); border-radius: 20px; padding: 36px 28px; box-shadow: var(--shadow); }
.state-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 12px; }
.state-card h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.01em; }
.state-card p { color: var(--ink-soft); line-height: 1.55; margin: 0; }

/* ---------- Sticky top bar ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { min-width: 0; }
.brand h1 { font-family: var(--font-display); font-weight: 800; font-size: 17px; margin: 0; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tagline { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.status-pill {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.is-open { background: var(--green-soft); color: var(--green); }
.status-pill.is-closed { background: var(--red-soft); color: var(--red); }

/* Search (store.js filters the menu as you type) */
.store-search { position: relative; display: none; }
.store-search input {
    width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-alt);
    padding: 0 38px 0 38px; font: inherit; font-size: 14px; color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s;
}
.store-search input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.store-search .ss-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; }
.store-search .ss-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--line); color: var(--ink-soft); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; display: none; }
.store-search.has-text .ss-clear { display: block; }
.search-toggle {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.site-header.search-open .store-search { display: block; padding: 0 16px 10px; }
.search-empty { display: none; text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.search-empty.is-visible { display: block; }
.item-row.is-filtered, .menu-section.is-filtered { display: none !important; }

/* ---------- Hero (banner, name, info) ---------- */
.store-hero { position: relative; background: var(--paper); border-bottom: 1px solid var(--line); }
.banner {
    height: 150px; background-color: #2b2f38; background-size: cover; background-position: center; position: relative;
}
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35)); }
.hero-body { padding: 14px 16px 16px; }
.hero-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.hero-tagline { color: var(--ink-soft); font-size: 14px; margin: 4px 0 0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
    background: var(--paper-alt); border-radius: 999px; padding: 6px 11px; text-decoration: none; max-width: 100%;
}
.hero-chip svg { flex-shrink: 0; }
.hero-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.hero-chip { color: var(--accent-dark); background: var(--accent-soft); }
a.hero-chip:hover { background: #ffe3d6; }

.notice-bar { background: #fff8e6; color: #7a5200; font-size: 13.5px; font-weight: 600; text-align: center; padding: 10px 16px; border-bottom: 1px solid #f6e3b3; }
.notice-bar-dinein { background: var(--green-soft); color: var(--green); border-bottom-color: #cdebd9; }

/* ---------- Layout ---------- */
.layout { display: block; padding-bottom: 96px; }

.cat-rail {
    position: sticky; top: var(--header-h, 0px); z-index: 15;
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
    background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
    scrollbar-width: none; scroll-behavior: smooth;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0; font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
    padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.cat-chip:hover { border-color: #cfd3db; color: var(--ink); }
.cat-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.menu-main { padding: 6px 16px 24px; }

.hh-banner {
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(90deg, #fff1ea, #fff8e6) !important; border: 1px solid #ffd7c2 !important; color: #a8410f !important;
    border-radius: var(--radius) !important; padding: 12px 14px !important; font-weight: 700; font-size: 14px; margin: 14px 0 4px !important;
}
.hh-banner::before { content: "\1F379"; font-size: 18px; }

.menu-section {
    margin-top: 22px;
    /* A chip jump (scrollIntoView) lands the title below the sticky bars (heights measured by store.js). */
    scroll-margin-top: calc(var(--header-h, 0px) + var(--catrail-h, 0px) + 12px);
}
.menu-section h2 {
    font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 10px;
    display: flex; align-items: baseline; gap: 8px;
}
.menu-section h2::after { content: attr(data-count); font-size: 13px; font-weight: 600; color: var(--muted); }

/* Item card: text on the left, picture on the right with the Add button over its bottom edge */
.item-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 104px; grid-template-areas: "info thumb" "info add";
    column-gap: 14px; align-items: start;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.item-row:hover { box-shadow: var(--shadow); }
.item-thumb {
    grid-area: thumb; width: 104px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--paper-alt);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-thumb-empty { background: linear-gradient(135deg, #f4f5f8, #eceef2); position: relative; }
.item-thumb-empty::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; opacity: .35;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8090' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11h18M5 11a7 7 0 0 1 14 0M4 15h16l-1.5 4h-13z'/%3E%3C/svg%3E");
}
/* No picture: the card is text + button only */
.item-row:has(.item-thumb-empty) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info add"; align-items: center; }
.item-row:has(.item-thumb-empty) .item-thumb { display: none; }
.item-row:has(.item-thumb-empty) .item-add-col { margin-top: 0; }

.item-info { grid-area: info; min-width: 0; }
.item-name-row { display: flex; align-items: flex-start; gap: 8px; }
.veg-dot, .nonveg-dot, .egg-dot {
    flex-shrink: 0; width: 14px; height: 14px; border: 1.5px solid var(--green); border-radius: 3px; position: relative; margin-top: 3px;
}
.veg-dot::after { content: ""; position: absolute; inset: 2.5px; background: var(--green); border-radius: 50%; }
.nonveg-dot { border-color: #b3261e; }
.nonveg-dot::after { content: ""; position: absolute; inset: 2px; background: #b3261e; clip-path: polygon(50% 5%, 0 95%, 100% 95%); }
.egg-dot { border-color: #c88a12; }
.egg-dot::after { content: ""; position: absolute; inset: 2.5px; background: #c88a12; border-radius: 50%; }
.item-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.item-price { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.item-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.item-row.is-sold-out { background: #fafafb; }
.item-row.is-sold-out .item-thumb { filter: grayscale(1); opacity: .55; }
.item-row.is-sold-out .item-info { opacity: .6; }
.sold-out-tag { font-size: 12px; font-weight: 700; color: var(--red); background: var(--red-soft); padding: 7px 12px; border-radius: 10px; white-space: nowrap; }
.stock-note { font-size: 11.5px; font-weight: 600; color: var(--accent-dark); text-align: center; }

.item-add-col { grid-area: add; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -18px; position: relative; z-index: 1; }

.btn-add {
    min-width: 92px; font-weight: 800; font-size: 14px; letter-spacing: .02em; text-transform: uppercase;
    padding: 9px 18px; border-radius: 10px; border: 1px solid #ffd2bf; background: #fff; color: var(--accent);
    cursor: pointer; box-shadow: 0 3px 10px rgba(240, 90, 40, .18); transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-add:hover { background: var(--accent-soft); }
.btn-add:active { transform: scale(.96); }
.btn-add.is-added { background: var(--green); border-color: var(--green); color: #fff; }

.qty-stepper {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 92px;
    background: var(--accent); border-radius: 10px; padding: 4px 6px; box-shadow: 0 3px 10px rgba(240, 90, 40, .25);
}
.qty-stepper button {
    background: none; border: none; color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; line-height: 1;
    width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
}
.qty-stepper button:hover { background: rgba(255, 255, 255, .18); }
.qty-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper .qty-val { color: #fff; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 800; min-width: 18px; text-align: center; }

/* ---------- Order panel (desktop) ---------- */
.receipt-panel { display: none; } /* shown at desktop width */
.receipt { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.receipt-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.receipt-store { font-weight: 800; font-size: 16px; margin: 0; }
.receipt-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 3px 0 0; }
.receipt-lines { padding: 12px 18px; min-height: 60px; max-height: 46vh; overflow-y: auto; }
.empty-note { font-size: 13.5px; color: var(--muted); text-align: center; margin: 22px 0; line-height: 1.5; }
.empty-note::before {
    content: ""; display: block; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--paper-alt) no-repeat center / 26px
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8090' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6h15l-1.5 9h-12z'/%3E%3Cpath d='M6 6 5 3H2'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E");
}
.receipt-line { padding: 10px 0; border-bottom: 1px solid var(--paper-alt); }
.receipt-line:last-child { border-bottom: 0; }
.receipt-line-top { display: flex; align-items: baseline; gap: 8px; }
.receipt-line-name { font-size: 14px; font-weight: 700; }
.receipt-line-dots { flex: 1; }
.receipt-line-price { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; }
.receipt-line-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.receipt-line-controls { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.receipt-line-controls > button {
    border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 700;
    cursor: pointer; padding: 4px 10px; border-radius: 999px; transition: background .15s, border-color .15s;
}
.receipt-line-controls > button:hover { background: var(--paper-alt); }
.receipt-line-controls > button[data-cart-remove], .receipt-line-controls > button[data-co-remove] { border-color: transparent; background: none; color: var(--red); margin-left: auto; }

.receipt-total-block { padding: 6px 18px 14px; background: #fbfbfc; border-top: 1px solid var(--line); }
.receipt-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; color: var(--ink-soft); }
.receipt-row.receipt-total { border-top: 1px dashed #d7dae1; margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 16px; color: var(--ink); }
.receipt-row.tax-row { font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.tax-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 5px; margin-left: 4px; }
.tax-tag-incl { background: var(--green-soft); color: var(--green); }
.tax-tag-excl { background: var(--accent-soft); color: var(--accent-dark); }
.tax-loading-note { font-size: 12px; color: var(--muted); font-style: italic; padding: 2px 0 4px; }
.tax-error-note { font-size: 12.5px; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 7px 9px; margin: 4px 0; }

.btn-primary {
    display: block; width: 100%; font-family: var(--font-body); font-weight: 800; font-size: 15px; letter-spacing: .01em;
    padding: 14px; border-radius: 12px; border: none; background: var(--accent); color: #fff; cursor: pointer;
    box-shadow: 0 6px 16px rgba(240, 90, 40, .28); transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: #e3e5ea; color: #9aa0ad; cursor: not-allowed; box-shadow: none; }
.btn-checkout { margin: 0 18px 18px; width: calc(100% - 36px); }
.receipt-total-block + .btn-checkout, .receipt-total-block[hidden] + .btn-checkout { margin-top: 14px; }

/* ---------- Mobile cart bar ---------- */
.mobile-cart-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--accent); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px;
    box-shadow: 0 10px 28px rgba(240, 90, 40, .38); animation: bar-in .25s ease-out;
}
@keyframes bar-in { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
#mobileCartSummary { font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 800; }
.mobile-cart-bar .btn-primary { width: auto; padding: 10px 16px; font-size: 14px; background: #fff; color: var(--accent-dark); box-shadow: none; }
.mobile-cart-bar .btn-primary:hover { background: #fff4ee; }
.mobile-cart-bar .btn-primary::after { content: " \2192"; }

/* ---------- Sheets (bottom sheet on mobile, dialog on desktop) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 20, 28, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-backdrop[hidden] { display: none; }
.sheet {
    position: relative; background: var(--paper); width: 100%; max-height: 90vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d9dce3; margin: -10px auto 14px; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-item-image { width: 100%; height: 200px; border-radius: 16px; overflow: hidden; background: var(--paper-alt); margin-bottom: 16px; }
.sheet-item-image:empty, .sheet-item-image.is-empty { display: none; }
.sheet-item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet h3 { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; padding-right: 36px; }
.sheet > .item-price { font-size: 16px; }
.sheet-close {
    position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
    border: none; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-soft);
}
.option-group { margin-top: 18px; }
.option-group-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.option-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 14.5px; font-weight: 600; transition: border-color .15s, background .15s; }
.option-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.option-row input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.option-row .mono { color: var(--ink-soft); font-weight: 700; }
.sheet .option-group .qty-stepper { min-width: 120px; padding: 6px 8px; }

.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input, .field textarea, .field select {
    width: 100%; border: 1px solid #dcdfe5; border-radius: 12px; padding: 12px 13px; font-family: var(--font-body); font-size: 15px;
    background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 64px; }
.optin-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); }
.optin-row input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 1px; }

.pay-option { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s; }
.pay-option input { accent-color: var(--accent); }
.pay-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.pay-option.is-disabled { opacity: .45; cursor: not-allowed; }
.pay-option-tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--paper-alt); padding: 3px 8px; border-radius: 999px; }

.form-error { background: var(--red-soft); color: var(--red); font-size: 13px; padding: 9px 12px; border-radius: 10px; margin-top: 12px; }
.field-error { display: none; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--red); }
.has-error > .field-error { display: block; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); background: #fff8f7; }
.checkout-card.has-error { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.checkout-hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

.checkout-error {
    display: flex; align-items: flex-start; gap: 8px; background: var(--red-soft); color: var(--red); border: 1px solid #f6c9c3;
    font-size: 13.5px; font-weight: 600; line-height: 1.4; padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; animation: err-in .18s ease-out;
}
.checkout-error::before { content: "!"; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.checkout-error[hidden] { display: none; }
@keyframes err-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Toast (minimum order, stock limits) */
.store-toast {
    position: fixed; left: 50%; top: 16px; z-index: 80; transform: translate(-50%, -12px); max-width: calc(100% - 32px);
    background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600; padding: 11px 16px; border-radius: 12px;
    box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.store-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Checkout: full page ---------- */
#checkoutSheetBackdrop { align-items: stretch; background: var(--bg); z-index: 60; }
#checkoutSheetBackdrop .sheet.checkout-sheet {
    width: 100%; max-width: none; height: 100%; max-height: 100%; border-radius: 0; animation: none;
    overflow-y: auto; padding: 0; display: flex; flex-direction: column; background: var(--bg);
}
#checkoutSheetBackdrop .sheet.checkout-sheet::before { display: none; }
.checkout-topbar {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.checkout-back { border: 1px solid var(--line); background: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.checkout-back:hover { background: var(--paper-alt); }
.checkout-topbar h3 { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0; padding: 0; }
.checkout-topbar .checkout-step-note { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.checkout-body { padding: 18px 16px 210px; flex: 1; } /* clears the fixed footer bar */
.checkout-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.checkout-card-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; }
.checkout-card .field:first-child { margin-top: 0; }
.dinein-card { display: flex; align-items: center; gap: 12px; background: var(--green-soft); border-color: #cdebd9; }
.dinein-card .dinein-icon { font-size: 26px; }
.dinein-card h4 { margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.dinein-card p { margin: 0; font-size: 13px; color: #2d6a48; }
.order-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.order-type-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 13px; text-align: center; cursor: pointer; font-weight: 700; font-size: 14px; transition: border-color .15s, background .15s; }
.order-type-opt input { display: none; }
.order-type-opt.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.checkout-summary-card .receipt-row { font-size: 13.5px; }
.checkout-footer-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid var(--line);
    padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(16, 24, 40, .06);
}
.checkout-footer-bar-inner { width: 100%; }
.checkout-footer-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }
.checkout-footer-total strong { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 800; color: var(--ink); }

/* ============================================================
   Tablet
   ============================================================ */
@media (min-width: 640px) {
    .store-search { display: block; flex: 1; max-width: 380px; }
    .search-toggle { display: none; }
    .site-header.search-open .store-search { padding: 0; }
    .site-header-inner { gap: 16px; }
    .banner { height: 200px; }
    .hero-body { padding: 18px 24px 20px; }
    .hero-title { font-size: 30px; }
    .menu-main { padding: 6px 24px 28px; }
    .cat-rail { padding: 10px 24px; }
    .menu-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
    .menu-section > h2, .menu-section > .search-empty { grid-column: 1 / -1; }
    .item-row { margin-bottom: 14px; }
    .sheet-backdrop { align-items: center; padding: 24px; }
    .sheet { max-width: 520px; border-radius: 22px; padding-bottom: 24px; }
    .sheet::before { display: none; }
}

/* ============================================================
   Desktop: categories on the left, order panel on the right
   ============================================================ */
@media (min-width: 1100px) {
    .site-header-inner, .hero-inner { max-width: 1320px; margin: 0 auto; width: 100%; padding-left: 28px; padding-right: 28px; }
    .hero-inner { display: flex; gap: 28px; align-items: flex-end; }
    .banner { height: 230px; }
    .hero-body { padding: 20px 0 22px; }
    .layout {
        display: grid; grid-template-columns: 220px minmax(0, 1fr) 340px; gap: 0 28px;
        max-width: 1320px; margin: 0 auto; padding: 8px 28px 40px;
    }
    .cat-rail {
        flex-direction: column; align-items: stretch; overflow-x: visible; overflow-y: auto; gap: 4px;
        height: calc(100vh - var(--header-h, 64px) - 24px); top: calc(var(--header-h, 0px) + 16px);
        background: none; border: 0; padding: 14px 0 0;
    }
    .cat-chip { text-align: left; border: 0; background: none; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
    .cat-chip:hover { background: #eceef2; }
    .cat-chip.is-active { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 3px 0 0 var(--accent); }
    .menu-main { padding: 0 0 40px; }
    .menu-section { scroll-margin-top: calc(var(--header-h, 0px) + 16px); }
    .receipt-panel { display: block; position: sticky; top: calc(var(--header-h, 0px) + 16px); align-self: start; padding-top: 14px; }
    .receipt-lines { max-height: calc(100vh - var(--header-h, 64px) - 330px); }
    .mobile-cart-bar { display: none !important; }
}

/* ---------- Checkout page at tablet+: two columns ---------- */
@media (min-width: 860px) {
    .checkout-topbar, .checkout-body { max-width: 1000px; margin: 0 auto; width: 100%; }
    .checkout-body { padding: 28px 24px 200px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
    .checkout-form-col { grid-column: 1; }
    .checkout-summary-col { grid-column: 2; position: sticky; top: 84px; }
    .checkout-footer-bar-inner { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
}
