:root {
  --navy: #1B2A4A;
  --orange: #F2A65A;
  --clay: #B94A0E;
  --clay-dark: #8A3409;
  --cream: #FFF7EC;
  --peach: #FCE3CC;
  --line: #EADFCF;
  --muted: #5B6478;
  --soft: #C9D1E3;
  --green: #2F6B47;
  --green-soft: #DCEBDD;
  --white: #FFFFFF;
  --radius: 18px;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 480px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; background: var(--cream); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--clay); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Typography */
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1.1; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
.muted { color: var(--muted); }
.price { font-family: var(--display); font-weight: 800; color: var(--clay); }
.old { color: var(--muted); text-decoration: line-through; font-size: 13px; }

/* Layout */
.screen { flex: 1; display: flex; flex-direction: column; padding-bottom: 92px; }
.screen.no-nav { padding-bottom: 0; }
.pad { padding: 16px 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* Header */
.hero-head { background: var(--navy); color: var(--cream); padding: 20px 20px 16px; border-radius: 0 0 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.hero-head .muted { color: var(--soft); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--navy); }
.icon-btn.ghost { border: 0; background: rgba(255,247,236,.12); color: var(--cream); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Search */
.search { display: flex; align-items: center; gap: 10px; height: 48px; background: var(--cream); color: var(--navy); border-radius: 14px; padding: 0 14px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; min-width: 0; }

/* Category chips */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 16px 20px 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 700; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--cream); border-color: var(--navy); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.offer { display: block; text-decoration: none; color: inherit; }
.offer-top { height: 96px; position: relative; display: flex; align-items: flex-end; padding: 12px; }
.badge { position: absolute; top: 12px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 5px 10px; }
.badge.left { left: 12px; background: var(--navy); color: var(--cream); }
.badge.right { right: 12px; background: var(--cream); color: var(--navy); }
.badge.soldout { left: 12px; background: var(--muted); color: var(--white); }
.logo { width: 44px; height: 44px; border-radius: 14px; background: var(--cream); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--clay); flex: none; }
.offer-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.slot { font-size: 13px; font-weight: 700; color: var(--green); }
.offer.is-soldout { opacity: .6; }

/* Buttons */
.btn { min-height: 54px; border: 0; border-radius: 16px; background: var(--clay); color: var(--white); font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; text-decoration: none; width: 100%; }
.btn:disabled { background: var(--muted); cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--navy); border: 2px solid var(--navy); }
.btn.orange { background: var(--orange); color: var(--navy); }
.btn.outline-light { background: transparent; color: var(--cream); border: 2px solid rgba(255,247,236,.4); }
.btn.small { min-height: 44px; font-size: 15px; width: auto; }
.footer-bar { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; }

/* Stepper */
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.stepper button { width: 44px; height: 48px; border: 0; background: transparent; font-size: 22px; }
.stepper output { min-width: 24px; text-align: center; font-weight: 800; font-size: 17px; }

/* Lists / info */
.info { display: flex; gap: 12px; align-items: flex-start; }
.info .icon { stroke: var(--green); flex: none; margin-top: 2px; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); }
.divider { height: 1px; background: var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--peach); color: var(--clay-dark); font-size: 13px; font-weight: 800; border-radius: 999px; padding: 6px 12px; }
.note { display: flex; gap: 10px; background: #E6EFE8; color: #23503A; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.note .icon { stroke: var(--green); flex: none; }
.warn { background: var(--peach); color: var(--clay-dark); }
.warn .icon { stroke: var(--clay); }

/* Forms */
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 800; font-size: 16px; padding: 0; margin-bottom: 10px; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.radio:has(input:checked) { border: 2px solid var(--clay); }
.radio input { width: 20px; height: 20px; accent-color: var(--clay); margin: 0; }
.pm { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 800; font-size: 14px; }
.input { height: 52px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--white); font-size: 16px; font-weight: 700; width: 100%; }
.input:focus { border: 2px solid var(--navy); outline: none; }
.phone { display: flex; align-items: center; gap: 10px; height: 54px; border: 2px solid var(--navy); border-radius: 14px; padding: 0 14px; background: var(--white); }
.phone input { flex: 1; border: 0; outline: none; font-size: 17px; font-weight: 700; background: transparent; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.error { color: #A11D1D; font-size: 14px; font-weight: 700; }

/* Pickup code */
.code { display: flex; gap: 8px; justify-content: center; }
.code span { width: 56px; height: 68px; border-radius: 14px; background: var(--peach); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 36px; color: var(--clay-dark); }
.success-head { background: var(--green); color: var(--white); padding: 28px 24px 24px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 8px; }
.success-head p { margin: 0; color: var(--green-soft); }
.stat { background: var(--navy); color: var(--cream); border-radius: 18px; padding: 14px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; color: var(--orange); }
.stat span { font-size: 13px; color: var(--soft); }
.qr { width: 120px; height: 120px; image-rendering: pixelated; }

/* Status pill */
.pill { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.pill.paid { background: var(--green-soft); color: #23503A; }
.pill.cash { background: var(--peach); color: var(--clay-dark); }
.pill.done { background: #E3E7F0; color: var(--navy); }

/* Welcome */
.welcome { background: var(--navy); color: var(--cream); min-height: 100vh; min-height: 100dvh; padding: 56px 28px 36px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.welcome h1 { font-size: 44px; color: var(--cream); }
.welcome p { margin: 0; }
.welcome .lead { font-size: 19px; color: #F6D9BC; }
.welcome .sub { font-size: 15px; color: var(--soft); }
.brand { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 800; font-size: 32px; }
.rings { position: absolute; right: -170px; top: -150px; opacity: .16; pointer-events: none; }
.welcome .stat { background: rgba(255,247,236,.08); }

/* Bottom nav */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--white); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav a { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 800; }
.nav a[aria-current="page"] { color: var(--clay); }
.nav .icon { width: 22px; height: 22px; }

/* Empty */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .icon { width: 48px; height: 48px; stroke: var(--soft); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: var(--cream); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90%; z-index: 10; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Offline banner */
.offline { background: var(--peach); color: var(--clay-dark); font-weight: 700; font-size: 13px; text-align: center; padding: 8px 12px; }

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