/* QR order page. Mobile first, light only (cafe colours are picked for light screens). */
:root {
  --bg: #f6f7f7;
  --surface: #ffffff;
  --text: #15201f;
  --muted: #5d6b6a;
  --line: #e3e8e7;
  --primary: #0f766e;
  --on-primary: #ffffff;
  --soft: #e8f3f1;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; }
.app { max-width: 640px; margin: 0 auto; padding: 12px 14px 120px; }
.loading, .notice { color: var(--muted); text-align: center; padding: 48px 8px; }
.hi { display: block; color: var(--muted); font-size: 0.85em; font-weight: normal; }
.inline-hi { color: var(--muted); font-size: 0.85em; font-weight: normal; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
h1, h2, h3 { margin: 0; line-height: 1.25; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; padding: 6px 0 12px; }
.top img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.top h1 { font-size: 1.25rem; }
.place { display: inline-block; margin-top: 2px; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* Banners */
.banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.error { background: #fdecec; border: 1px solid #f5c2c2; color: var(--bad); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }

/* Category nav */
.cats { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; margin: 0 -14px 4px; padding-left: 14px; padding-right: 14px;
  background: var(--bg); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.9rem; }
section.cat { margin: 14px 0 6px; }
section.cat > h2 { font-size: 1.05rem; margin: 0 0 8px; }

/* Items */
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 0 0 8px; min-height: 64px; }
.item.out { opacity: 0.55; }
.item .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: 0 0 64px; background: var(--soft); }
.item .info { flex: 1 1 auto; min-width: 0; }
.item .name { font-weight: 600; overflow-wrap: anywhere; }
.item .price { color: var(--text); margin-top: 2px; }
.item .tag { display: inline-block; margin-left: 6px; font-size: 0.75rem; color: var(--primary); background: var(--soft); border-radius: 6px; padding: 0 6px; vertical-align: middle; }
.item .na { color: var(--bad); font-size: 0.85rem; }
button.group-open { width: 100%; text-align: left; border: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; }

/* Buttons */
button { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 0;
  background: var(--primary); color: var(--on-primary); font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.btn.wa { background: #1fa855; color: #ffffff; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.add { min-width: 76px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--primary); border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--soft); color: var(--primary); font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.stepper span { min-width: 32px; text-align: center; font-weight: 700; }

/* Cart bar */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06); }
.cartbar .btn { width: 100%; max-width: 640px; margin: 0 auto; justify-content: space-between; display: flex; }

/* Checkout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 12px; }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.line:last-child { border-bottom: 0; }
.line .grow { flex: 1 1 140px; min-width: 0; }
.split { display: flex; gap: 6px; width: 100%; }
.split label { flex: 1 1 0; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 0.9rem; cursor: pointer; }
.split input { width: 18px; height: 18px; margin: 0; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
label.field { display: block; margin: 10px 0; font-weight: 600; }
label.field input { display: block; width: 100%; margin-top: 4px; min-height: 46px; padding: 8px 12px; font: inherit; font-weight: normal; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); }
label.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.back { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 8px 0; cursor: pointer; min-height: 44px; }

/* Result + tracking */
.code { text-align: center; padding: 14px 8px; }
.code .big { font-size: 2.4rem; font-weight: 800; letter-spacing: 0.12em; color: var(--primary); }
.code .check { font-family: ui-monospace, Menlo, Consolas, monospace; }
.stack > * + * { margin-top: 10px; }
.steps { list-style: none; padding: 0; margin: 4px 0; display: flex; justify-content: space-between; gap: 4px; }
.steps li { flex: 1 1 0; text-align: center; font-size: 0.78rem; color: var(--muted); }
.steps li .dot { display: block; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.steps li.done { color: var(--text); }
.steps li.done .dot { background: var(--primary); border-color: var(--primary); }
.steps li.now { color: var(--primary); font-weight: 700; }
.steps li.now .dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--soft); }
.eta { font-size: 1.3rem; font-weight: 700; text-align: center; margin: 8px 0 2px; }
.state-bad { color: var(--bad); font-weight: 700; text-align: center; font-size: 1.15rem; }
.state-good { color: var(--good); font-weight: 700; text-align: center; font-size: 1.15rem; }
.qr { display: block; width: 220px; height: 220px; margin: 8px auto; background: #fff; }
.checked { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.9rem; }

/* Variant picker (bottom sheet) */
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet .panel { width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto; background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
.sheet .panel h2 { font-size: 1.15rem; margin-bottom: 8px; }

@media (min-width: 700px) {
  .app { padding-top: 20px; }
}
