/* Phone ordering page. Mobile first, one column, big touch targets. Colours are tokens so brand.css can repaint it. */
:root {
  --brand-primary: #0f6cbd; --brand-hover: #115ea3; --brand-pressed: #0f548c; --brand-on: #fff; --brand-tint-20: #ebf3fc;
  --bg: #f6f7f9; --card: #fff; --text: #1a1d21; --muted: #5b6470; --line: #e1e4e8;
  --ok: #107c10; --warn: #8a5a00; --warn-bg: #fff4ce; --bad: #b3261e; --bad-bg: #fde7e9;
  --radius: 14px; --shadow: 0 2px 12px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151a; --card: #1b2026; --text: #eef0f2; --muted: #a2abb5; --line: #2c333b;
    --warn: #f7d68b; --warn-bg: #3a2f10; --bad: #f2a29c; --bad-bg: #3d1a1a; --ok: #6fd36f; --shadow: 0 2px 12px rgba(0,0,0,.5); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
body.locked { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
.pad { padding: 24px; text-align: center; }

.top { padding: calc(14px + env(safe-area-inset-top)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.15rem; }
.top-sub { color: var(--muted); font-size: .85rem; }
.banner { padding: 10px 16px; background: var(--warn-bg); color: var(--warn); font-size: .9rem; text-align: center; }
main { max-width: 640px; margin: 0 auto; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-height: 48px; padding: 0 18px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand-primary); color: var(--brand-on); border-color: transparent; }
.btn.primary:active { background: var(--brand-pressed); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, input:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; border-radius: 50%; }

/* Menu */
.search { padding: 12px 16px 4px; }
.search input { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; position: sticky; top: 0; background: var(--bg); z-index: 2; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-height: 40px; padding: 0 16px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--brand-primary); color: var(--brand-on); border-color: transparent; }
.list { list-style: none; margin: 0; padding: 4px 16px 16px; display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.item.off { opacity: .55; }
.item-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.item-main:disabled { cursor: default; }
.item-name { font-weight: 600; }
.item-desc { color: var(--muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; font-size: .9rem; }
.price { font-weight: 700; }
.tag { font-size: .72rem; border-radius: 6px; padding: 1px 6px; background: var(--brand-tint-20); color: var(--text); }
.tag.off { background: var(--bad-bg); color: var(--bad); }
.in-order { color: var(--ok); font-size: .8rem; font-weight: 600; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.3rem; cursor: pointer; }
.stepper button.add { background: var(--brand-primary); color: var(--brand-on); border-color: transparent; }
.stepper button:disabled { opacity: .4; }
.stepper .n { min-width: 28px; text-align: center; font-weight: 700; }

/* Centered states (closed, error, loading) */
.state { padding: 56px 24px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.state h2 { font-size: 1.25rem; }
.state p { color: var(--muted); max-width: 26rem; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Cart bar, sheets, toast */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.cartbar .btn { max-width: 608px; margin: 0 auto; display: flex; justify-content: space-between; box-shadow: var(--shadow); align-items: center; }
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden], .banner[hidden], .cartbar[hidden], .toast[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; background: var(--card); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.1rem; }
.sheet-body { overflow-y: auto; padding: 14px 18px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.foot-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.err { color: var(--bad); background: var(--bad-bg); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.hint { color: var(--muted); font-size: .85rem; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20; max-width: 600px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: #202428; color: #fff; text-align: center; box-shadow: var(--shadow); }

/* Options */
.group { margin-bottom: 18px; }
.group h3 { font-size: 1rem; display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.group .hint { margin-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.opt .mark { width: 24px; height: 24px; border: 2px solid var(--muted); flex: none; border-radius: 50%; display: grid; place-items: center; }
.opt .mark.box { border-radius: 6px; }
.opt[aria-checked="true"] .mark { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on); }
.opt .grow { flex: 1; }
.opt:disabled { opacity: .45; cursor: default; }
.row-opt { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.row-opt .grow { flex: 1; }
.cart-line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .grow { flex: 1; min-width: 0; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 700; }

/* Checkout */
.panel { margin: 16px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 14px; }
.panel h2 { font-size: 1.15rem; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.sum-line .hint { display: block; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 14px; font-size: 1.2rem; letter-spacing: .02em; }
.order-number { font-size: 3.4rem; font-weight: 800; letter-spacing: .04em; text-align: center; line-height: 1.1; padding: 8px 0; }
.big-ok { text-align: center; color: var(--ok); font-weight: 700; }
.ready-box { text-align: center; border-radius: 12px; padding: 12px; background: var(--brand-tint-20); font-weight: 600; }
.ready-box.now { background: var(--ok); color: #fff; font-size: 1.1rem; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 44px; cursor: pointer; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: var(--line); }
