/* Ordering app (PWA). Mobile first; a centred column on wider screens. */

:root {
    --ink: #1a1a1a;
    --heading: #2c1810;
    --muted: #6d655f;
    --bg: #faf6f1;
    --card: #ffffff;
    --line: #ebe4dc;
    --green: #377237;
    --green-dark: #2b5a2b;
    --green-soft: #e8f5ea;
    --red: #9b1c1f;
    --red-soft: #fbeceb;
    --gold: #d4af37;
    --radius: 14px;
    --tabs: 62px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --shadow: 0 1px 2px rgba(44, 24, 16, 0.06), 0 4px 14px rgba(44, 24, 16, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

body.has-sheet { overflow: hidden; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.ic { width: 1em; height: 1em; flex: none; }

/* ---------- frame ---------- */

.app { max-width: 600px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

.app-boot {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background: #000; color: #fff;
}
.app-boot img { border-radius: 20px; }

.bar {
    position: sticky; top: 0; z-index: 20;
    padding: calc(var(--safe-t) + 12px) 16px 12px;
    background: #000; color: #fff;
}
.bar__brand { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; color: #fff; }

.offline { background: var(--red); color: #fff; text-align: center; font-size: 14px; padding: 8px 16px; }

.view { padding: 18px 16px calc(var(--tabs) + var(--safe-b) + 104px); display: flex; flex-direction: column; gap: 22px; }
.view:focus { outline: none; }

.tabs {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    max-width: 600px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--card); border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; }
.tab[aria-current="page"] { color: var(--green); font-weight: 600; }
.tab__icon { position: relative; font-size: 21px; display: flex; }
.tab__badge {
    position: absolute; top: -7px; right: -13px; min-width: 19px; height: 19px; padding: 0 5px;
    border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
}

.cartbar {
    position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(var(--tabs) + var(--safe-b) + 10px);
    max-width: 576px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: 999px;
    background: var(--green); color: #fff; font-weight: 600;
    box-shadow: 0 8px 22px rgba(43, 90, 43, 0.35);
}
.cartbar__count { min-width: 26px; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, 0.22); text-align: center; line-height: 26px; font-size: 14px; }
.cartbar__label { flex: 1; }

.toast {
    position: fixed; z-index: 60; left: 16px; right: 16px; top: calc(var(--safe-t) + 60px);
    max-width: 480px; margin: 0 auto; padding: 12px 16px; border-radius: 12px;
    background: var(--ink); color: #fff; font-size: 15px; text-align: center;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast--show { opacity: 1; transform: none; }
.toast--error { background: var(--red); }

.notice {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: var(--radius);
    background: #fff6dc; color: #5a4a12; font-size: 14px;
}
.notice .ic { margin-top: 3px; }
.notice--bar { border-radius: 0; padding: 10px 16px; }

.loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- shared pieces ---------- */

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

.block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.block__title { font-size: 19px; font-weight: 650; color: var(--heading); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); margin-bottom: -6px; }
.page__title { font-size: 26px; font-weight: 700; color: var(--heading); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.link { color: var(--green); font-weight: 600; text-decoration: none; }

.hero__title { font-size: 28px; font-weight: 700; color: var(--heading); line-height: 1.15; }
.hero__text { color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:active { background: var(--green-dark); }
.btn--outline { border: 1.5px solid var(--green); color: var(--green); background: transparent; }
.btn--ghost { color: var(--muted); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--big { min-height: 56px; font-size: 18px; }
.btn--block { display: flex; width: 100%; }
.btn:disabled, .is-busy { opacity: 0.55; }

.pill { padding: 3px 10px; border-radius: 999px; background: #f1ece6; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill--live { background: var(--green-soft); color: var(--green-dark); }

.tag { padding: 2px 8px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag--muted { background: #f1ece6; color: var(--muted); }
/* A note such as the days a deal runs can be long: it wraps inside the card instead of running under the add button. */
.tag--note { white-space: normal; max-width: 100%; line-height: 1.3; padding: 3px 8px; }

.price { font-weight: 650; color: var(--heading); white-space: nowrap; }
.price s { color: var(--muted); font-weight: 400; margin-right: 6px; }
.price__from { font-weight: 400; color: var(--muted); font-size: 13px; }

/* ---------- home ---------- */

.signin { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; }
.signin__title { font-size: 17px; font-weight: 650; color: var(--heading); }
.signin__text { font-size: 14px; color: var(--muted); }

.order { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.order--active { border-left: 4px solid var(--green); }
.order__head, .order__foot { display: flex; align-items: center; gap: 10px; }
.order__when { font-weight: 600; color: var(--heading); flex: 1; }
.order__items { color: var(--muted); font-size: 15px; }
.order__total { font-weight: 650; flex: 1; }

.rail {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity;
    margin: 0 -16px; padding: 4px 16px 12px; scrollbar-width: none;
    /* Without this the snap pulls the first card flush to the edge, past the padding. */
    scroll-padding: 0 16px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: none; scroll-snap-align: start; }

.tile {
    width: 148px; display: flex; flex-direction: column; gap: 6px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; padding-bottom: 10px;
}
.tile__img { width: 148px; height: 118px; object-fit: cover; background: #f1ece6; }
.tile__img--none { display: flex; align-items: center; justify-content: center; font-size: 28px; color: #c9beb2; }
.tile__name { padding: 0 10px; font-weight: 600; font-size: 15px; line-height: 1.25; min-height: 2.5em; color: var(--heading); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__foot { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 14px; }
.tile__add { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }

.install { display: flex; gap: 14px; padding: 16px; }
.install__icon { border-radius: 12px; flex: none; }
.install__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.install__title { font-size: 16px; font-weight: 650; color: var(--heading); }
.install__text { font-size: 14px; color: var(--muted); }
.install__text .ic { vertical-align: -2px; }
.install__actions { display: flex; gap: 6px; margin-top: 4px; }

/* ---------- menu ---------- */

.menu__top {
    position: sticky; top: calc(var(--safe-t) + 49px); z-index: 10;
    margin: -18px -16px 0; padding: 12px 16px 8px; background: var(--bg);
    display: flex; flex-direction: column; gap: 10px;
}
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.search__input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 16px; -webkit-appearance: none; appearance: none; }
.search:focus-within { border-color: var(--green); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--heading); white-space: nowrap; }

.chip--fav { display: inline-flex; align-items: center; gap: 6px; }
.chip--fav .ic { color: var(--red); font-size: 13px; }
.hint { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--muted); font-size: 15px; }
.hint .ic { color: #d2c8bd; }

.menu { display: flex; flex-direction: column; gap: 26px; }
.menu__section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: calc(var(--safe-t) + 170px); }

.rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row--out { opacity: 0.6; }
.row__main { flex: 1; min-width: 0; display: flex; gap: 12px; padding: 12px 0 12px 12px; }
.row__img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; background: #f1ece6; }
.row__img--none { display: flex; align-items: center; justify-content: center; font-size: 24px; color: #c9beb2; }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__name { font-weight: 600; color: var(--heading); line-height: 1.25; }
.row__desc { font-size: 13.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.row__side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 10px 12px 12px 6px; }

.add { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-top: auto; }
.add:disabled { background: #cfc7be; }
.heart { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: #d2c8bd; font-size: 17px; }
.heart[aria-pressed="true"] { color: var(--red); }

/* ---------- cart ---------- */

.lines { padding: 4px 16px; }
.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line__body { flex: 1; min-width: 0; }
.line__name { font-weight: 600; color: var(--heading); }
.line__data { margin-top: 4px; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.line__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.line__total { font-weight: 650; }

.qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 3px; }
.qty__btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 14px; }
.qty__value { min-width: 26px; text-align: center; font-weight: 650; }
.qty--small .qty__btn { width: 32px; height: 32px; font-size: 12px; }

.totals { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.totals__row { display: flex; justify-content: space-between; font-weight: 600; }
.totals__note { font-size: 13.5px; color: var(--muted); }

.empty { padding: 48px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.empty__icon { width: 76px; height: 76px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.empty__title { font-size: 22px; font-weight: 700; color: var(--heading); }
.empty__text { color: var(--muted); }

/* ---------- account ---------- */

.form { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--heading); }
.field__input { height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; outline: none; }
.field__input:focus { border-color: var(--green); }
.form__error { color: var(--red); font-size: 14px; font-weight: 500; }
.google { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.google__button { min-height: 44px; display: flex; justify-content: center; width: 100%; }
.google__or { display: flex; align-items: center; gap: 12px; width: 100%; font-size: 13px; color: var(--muted); }
.google__or::before, .google__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form__note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--muted); }

.links { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.links__item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; color: var(--heading); }
.links__item:last-child { border-bottom: 0; }
.links__item span { flex: 1; }
.links__item > .ic:first-child { color: var(--green); width: 18px; }
.links__item > .ic:last-child { color: #c9beb2; font-size: 13px; margin-left: auto; }

.push { display: flex; gap: 14px; padding: 16px; }
.push[hidden] { display: none; }
.push__icon { width: 42px; height: 42px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; flex: none; font-size: 18px; }
.push__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.push__title { font-size: 16px; font-weight: 650; color: var(--heading); }
.push__text { font-size: 14px; color: var(--muted); }
.push__pref { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--heading); }
.push__check { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.push__actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ---------- product sheet ---------- */

.backdrop {
    position: fixed; inset: 0; z-index: 50; background: rgba(20, 12, 8, 0.55);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fade 0.16s ease;
}
.sheet {
    width: 100%; max-width: 600px; max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column;
    background: var(--bg); border-radius: 20px 20px 0 0;
    animation: rise 0.22s ease;
}
.sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 10px; }
.sheet__title { flex: 1; font-size: 21px; font-weight: 700; color: var(--heading); line-height: 1.2; }
.sheet__close { width: 38px; height: 38px; border-radius: 50%; background: #ece5dd; display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.sheet__body { flex: 1; overflow-y: auto; padding: 0 16px 18px; display: flex; flex-direction: column; gap: 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet__desc { color: var(--muted); font-size: 15px; }
.sheet__foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--card); border-top: 1px solid var(--line); }
.sheet__foot:empty { display: none; }
.sheet__foot .btn { flex: 1; }

.group { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 8px; }
.group__title { display: flex; align-items: baseline; gap: 10px; font-size: 16px; font-weight: 650; color: var(--heading); }
.group__hint { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-left: auto; white-space: nowrap; }
.group--missing .group__hint { color: var(--red); }
.group--missing .options { box-shadow: 0 0 0 2px var(--red); }
.group__desc { font-size: 14px; color: var(--muted); }

.options { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.option { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 52px; border-bottom: 1px solid var(--line); }
.option:last-child { border-bottom: 0; }
.option__mark { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #cfc7be; display: flex; align-items: center; justify-content: center; flex: none; color: transparent; font-size: 11px; }
.option[role="checkbox"] .option__mark { border-radius: 7px; }
.option[aria-checked="true"] { background: var(--green-soft); }
.option[aria-checked="true"] .option__mark { background: var(--green); border-color: var(--green); color: #fff; }
.option__img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.option__label { flex: 1; min-width: 0; font-weight: 500; }
.option__price { font-size: 14px; color: var(--muted); white-space: nowrap; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

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

/* Mouse and trackpad: nothing to swipe with, so show every section chip and give the rails a scrollbar. */
@media (hover: hover) and (pointer: fine) {
    .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0 0 4px; }
    .chip:hover { border-color: var(--green); color: var(--green); }
    .menu__section { scroll-margin-top: calc(var(--safe-t) + 230px); }
    .rail { scrollbar-width: thin; scrollbar-color: #d6ccc1 transparent; padding-bottom: 14px; }
    .rail::-webkit-scrollbar { display: block; height: 8px; }
    .rail::-webkit-scrollbar-thumb { background: #d6ccc1; border-radius: 4px; }
}

@media (min-width: 640px) {
    body { background: #efe8e0; }
    .app { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
    .backdrop { align-items: center; }
    .sheet { border-radius: 20px; max-height: 86vh; }
}
