/* Customer storefront — mobile-first, no framework, small payload. */
:root {
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-soft: #fff1e6;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #fafaf9;
  --card: #ffffff;
  --ok: #15803d;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
  --err: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f4; --muted: #a8a29e; --line: #3a3532; --bg: #161412; --card: #211e1b;
    --brand-soft: #3b2417; --warn-bg: #3d2f0d; --warn-ink: #fcd34d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
body.no-scroll { overflow: hidden; }
body.has-cart .menu { padding-bottom: calc(96px + var(--safe-bottom)); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--err); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 999px; padding: .65rem 1.1rem; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; min-height: 44px; touch-action: manipulation;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; font: inherit; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--brand), #ea580c); color: #fff; background-size: cover; background-position: center; }
.hero.has-cover { position: relative; }
.hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.7)); }
.hero-inner { position: relative; padding: 12px 16px 20px; max-width: 1100px; margin: 0 auto; }
.has-cover .hero-inner { padding-top: 12px; min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.table-badge { display: inline-block; background: rgba(255,255,255,.95); color: var(--brand-dark); font-weight: 700; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.status-head .table-badge { background: var(--brand-soft); color: var(--brand-dark); }
.lang-form select { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .875rem; }
.lang-form option { color: #000; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: #fff; flex: none; }
.brand h1 { font-size: 1.6rem; }
.hero-desc { margin: 4px 0 0; opacity: .92; font-size: .95rem; }

/* Notices */
.notices { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.notice { display: block; margin-top: 12px; padding: 12px 14px; border-radius: 12px; text-decoration: none; font-size: .95rem; }
.notice-info { background: var(--brand-soft); color: var(--brand-dark); }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }
@media (prefers-color-scheme: dark) { .notice-info { color: #fdba74; } }

/* Category nav */
.cat-nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.cat-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 6px; scrollbar-width: none; max-width: 1100px; margin: 0 auto; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.cat-scroll a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search-wrap { padding: 4px 16px 10px; max-width: 1100px; margin: 0 auto; }
.search-wrap input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }

/* Menu grid */
.menu { max-width: 1100px; margin: 0 auto; padding: 8px 16px 32px; }
.cat { padding-top: 16px; }
.cat h2 { font-size: 1.25rem; margin: 4px 0 12px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-open { all: unset; cursor: pointer; display: block; width: 100%; }
.card-img { position: relative; aspect-ratio: 3 / 2; background: var(--brand-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge-sold { display: none; position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--bg); padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.card.sold-out .badge-sold { display: block; }
.card.sold-out .card-img img { filter: grayscale(1); opacity: .55; }
.card.sold-out .card-body { opacity: .6; }
.card.no-img .badge-sold { position: static; display: none; width: fit-content; margin-bottom: 4px; }
.card.no-img.sold-out .badge-sold { display: inline-block; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 1.1rem; cursor: pointer; }
.card-desc { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-addons { margin: 0; color: var(--brand); font-size: .85rem; font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1.1rem; }
.price.big { font-size: 1.35rem; margin: 6px 0 10px; }
.card-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.no-results { text-align: center; color: var(--muted); padding: 32px 0; }
.info { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.3rem; color: var(--ink); cursor: pointer; border-radius: 999px; touch-action: manipulation; }
.stepper button:active { background: var(--brand-soft); }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }
.stepper.small button { width: 36px; height: 36px; font-size: 1.1rem; }

/* Cart bar */
.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 12px; border: 0; border-radius: 16px; padding: 14px 18px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 8px 24px rgba(194,65,12,.4); cursor: pointer; max-width: 640px; margin: 0 auto;
}
.cart-count { background: #fff; color: var(--brand); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: .9rem; }
.cart-total { margin-left: auto; }

/* Sheets */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .22s ease-out;
  max-width: 640px; margin: 0 auto;
}
.sheet-panel.tall { height: 92vh; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1.5rem; cursor: pointer; }
.sheet-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 20px 20px 0 0; }
.sheet-body { padding: 18px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-body h2 { font-size: 1.35rem; padding-right: 44px; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.options { border: 0; padding: 0; margin: 8px 0 12px; }
.options legend { font-weight: 700; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.check span:nth-child(2) { flex: 1; }
.field { display: block; margin: 12px 0; border: 0; padding: 0; }
.field > span, .field legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.radio input { width: 20px; height: 20px; accent-color: var(--brand); }

/* Cart lines */
.cart-lines { list-style: none; padding: 0; margin: 12px 0; }
.cart-line { display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line.unavailable { opacity: .7; }
.cl-info { flex: 1; min-width: 0; }
.cl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.totals { margin: 8px 0; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translate(-50%, 20px); opacity: 0; transition: .2s; z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Order status */
.status-wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.status-head { text-align: center; }
.status-head h1 { font-size: 2rem; margin: 4px 0 8px; }
.status-card, .receipt { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.status-msg { font-size: 1.15rem; font-weight: 700; text-align: center; margin: 0 0 16px; }
.status-card[data-status="ready"] .status-msg { color: var(--ok); font-size: 1.35rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: relative; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: .8rem; color: var(--muted); position: relative; }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before { background: var(--brand); }
.dot { width: 20px; height: 20px; border-radius: 999px; background: var(--line); position: relative; z-index: 1; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--brand); }
.step.current .dot { box-shadow: 0 0 0 5px var(--brand-soft); animation: pulse 1.6s infinite; }
.step.current { font-weight: 700; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent; } }
.eta { text-align: center; margin: 16px 0 0; font-weight: 600; }
.live-note { text-align: center; margin: 8px 0 0; }
.cancelled-pill { text-align: center; color: var(--err); font-weight: 700; }
.receipt ul { list-style: none; margin: 0; padding: 0; }
.receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.paid-badge { margin: 12px 0 0; text-align: center; font-weight: 800; color: var(--ok); background: rgba(21,128,61,.12); border-radius: 999px; padding: 6px 12px; }
.small-h { font-size: 1rem; margin-bottom: 6px; }

/* Landing */
.home { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.home-card { text-align: center; max-width: 380px; }
.home-icon { color: var(--brand); margin-bottom: 12px; display: inline-block; }
.home h1 { font-size: 1.8rem; margin-bottom: 8px; }

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

/* Landing page (restaurant owners) */
.land-hero { background: linear-gradient(135deg, var(--brand), #ea580c); color: #fff; }
.land-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px; max-width: 1000px; margin: 0 auto; }
.land-nav a { color: #fff; font-weight: 700; text-decoration: none; }
.land-brand { font-weight: 900; font-size: 1.15rem; }
.land-inner { max-width: 1000px; margin: 0 auto; padding: 32px 16px 56px; }
.land-inner h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
.land-lead { font-size: 1.15rem; max-width: 640px; opacity: .95; margin: 14px 0 26px; }
.land-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-ghost-light { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); }
.land { max-width: 1000px; margin: 0 auto; padding: 32px 16px; }
.land h2 { font-size: 1.5rem; margin-bottom: 16px; }
.land section { margin-bottom: 40px; }
.land-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.land-steps li { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 6px; counter-increment: step; }
.land-steps li::before { content: counter(step); width: 34px; height: 34px; border-radius: 999px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; }
.land-steps span, .land-features span { color: var(--muted); }
.land-features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.land-features div { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.land-diner { text-align: center; background: var(--brand-soft); border-radius: var(--radius); padding: 24px 16px; }
.land-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 16px; }
