/* =========================================================
   Burgers MVC — customer ordering page (index.html only; UI only, no business logic).
   Tracker and staff pages keep css/styles.css.
   ========================================================= */
:root {
  --bg: #2b1a12;          /* dark brown page */
  --bg-deep: #1e120c;     /* docked bar, checkout panel */
  --cream: #fff4e2;       /* cards */
  --cream-2: #fbebd2;     /* inputs, quiet buttons */
  --line: #e6d0ae;        /* input borders */
  --rule: #ead7ba;        /* row dividers */
  --ink: #2b1a12;
  --muted: #6e5444;       /* secondary text on cream (6.3:1) */
  --on-dark: #fff4e2;
  --on-dark-2: #fff4e2b8; /* secondary text on dark brown */
  --gold: #ffc233;        /* primary CTA + step numbers */
  --red: #d3361f;         /* selected states */
  --red-ink: #c2311c;     /* red text on cream (4.8:1) */
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --text: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --col: 460px;           /* the mobile ordering column, centered on desktop */
}
* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--on-dark); font: 400 1rem/1.4 var(--text); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- TEST MODE strip (always visible while test ordering is on) ---------- */
.test-banner {
  position: sticky; top: 0; z-index: 20; margin: 0; min-height: 34px; padding: 6px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px;
  background: var(--red); color: var(--cream); font: 700 .8rem/1.2 var(--text); text-align: center;
}
.test-banner b { letter-spacing: .1em; }

/* ---------- Header: logo, headline, compact status ---------- */
.hero { max-width: var(--col); margin: 0 auto; padding: 20px 16px 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
/* The JPEG is a square with white corners; the clip only trims that white, never the logo's own ring. */
.logo {
  display: block; width: 112px; height: 112px; object-fit: contain;
  clip-path: circle(47.6% at 49.9% 49.4%);
}
.hero h1 { margin: 4px 0 0; font: 700 1.875rem/1.05 var(--display); letter-spacing: .01em; color: var(--cream); }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 7px 14px; border-radius: 999px;
  font: 700 .75rem/1.2 var(--text); letter-spacing: .06em; text-transform: uppercase;
}
.status .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.status.is-open { background: #ffc23324; color: var(--gold); }
.status.is-open .dot { background: var(--gold); }
.status.is-closed { background: #fff4e214; color: var(--cream); flex-wrap: wrap; justify-content: center; }
.status.is-closed .dot { background: #e2563f; }
.status.is-closed b { font-weight: 700; }
.status .sep { opacity: .6; }
#open-until:not(:empty)::before { content: "· "; opacity: .8; }
.closed-banner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.closed-help { font: 400 .8125rem/1.3 var(--text); color: var(--on-dark-2); }
.track-banner {
  display: block; margin-top: 6px; padding: 10px 16px; border-radius: 999px; text-decoration: none;
  background: var(--cream); color: var(--ink); font: 600 .95rem/1.2 var(--display);
}

/* ---------- Flow ---------- */
.flow { max-width: var(--col); margin: 0 auto; padding: 18px 16px 120px; display: flex; flex-direction: column; gap: 34px; }
.step { scroll-margin-top: 48px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-no {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--ink); font: 700 .8125rem/1 var(--text);
}
.step-head h2 { flex: 1; margin: 0; font: 600 1.25rem/1.2 var(--display); color: var(--cream); }
.step-aside { font: 500 .8125rem/1.2 var(--text); color: var(--on-dark-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contents { display: contents; }
.err { display: none; margin: 10px 0 0; color: #ffb4a6; font: 700 .875rem/1.3 var(--text); }
.panel .err { color: var(--red-ink); margin-top: 6px; }
.invalid .err, .err.show { display: block; }

/* Selected-state check badge (red) */
.opt[aria-checked="true"]::after, .chip[aria-pressed="true"] .check, .toggle[aria-pressed="true"] .check {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff4e2' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--red);
}

/* ---------- Option cards (burger, type, method) ---------- */
.opt {
  position: relative; width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: flex-start;
  padding: 14px; border-radius: 18px; border: 2px solid transparent; background: var(--cream); color: var(--ink); text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.opt[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 3px #d3361f38; }
.opt[aria-checked="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; }
.opt-title { font: 600 1.125rem/1.2 var(--display); }
.opt-desc { font: 400 .8125rem/1.35 var(--text); color: var(--muted); }
.opt-price { margin-top: auto; padding-top: 6px; font: 700 1.125rem/1.2 var(--text); font-variant-numeric: tabular-nums; }
.opt-price.pending { font: 500 .8125rem/1.3 var(--text); color: var(--muted); }

.burger .art { width: 100%; height: 72px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 10px; }
.burger .burger-art { display: block; width: 78px; height: auto; }

.type { min-height: 138px; }
.type .opt-add { margin-top: 4px; font: 700 .8125rem/1.3 var(--text); color: var(--red-ink); }
.type .opt-price { font-size: 1rem; }

.method { min-height: 160px; }
.method::before {
  content: ""; width: 28px; height: 28px; margin-bottom: 8px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b1a12' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1 12H6L5 8z'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3E%3C/svg%3E");
}
.method[data-method="CAMPUS_DELIVERY"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b1a12' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0C18.5 15.4 12 21 12 21z'/%3E%3Ccircle cx='12' cy='10' r='2.4'/%3E%3C/svg%3E");
}
.method .opt-title { font-size: 1.0625rem; order: 1; }
.method .method-price { order: 2; margin-top: 4px; font: 700 .75rem/1.2 var(--text); letter-spacing: .08em; color: var(--red-ink); }
.method .opt-desc { order: 3; margin-top: 2px; }
.delivery-scope {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--gold); color: var(--ink);
  display: grid; gap: 3px; font: 700 .82rem/1.3 var(--text);
}
.delivery-scope > b { letter-spacing: .03em; }
.delivery-scope span { font-weight: 600; }
.delivery-scope span b { color: var(--red-ink); }
.pickup-note { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff4e214; color: var(--cream); font: 500 .9375rem/1.35 var(--text); }
.pickup-note b { color: var(--gold); }

/* ---------- Sauce chips ---------- */
.chip {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 14px; border: 2px solid transparent; background: var(--cream); color: var(--ink); text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.chip[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 3px #d3361f38; }
.chip-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chip-copy b { font: 700 1rem/1.25 var(--text); }
.chip-copy small { font: 500 .75rem/1.3 var(--text); color: var(--muted); }
.check { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid #cdb494; }

/* ---------- Panels (extras, details, review) ---------- */
.panel { border-radius: 18px; background: var(--cream); color: var(--ink); }
.rows { display: flex; flex-direction: column; padding: 4px 16px; }
.stepper, .toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.rows > * + * { border-top: 1px solid var(--rule); }
.row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-copy b { font: 700 1rem/1.25 var(--text); }
.row-copy small { font: 400 .8125rem/1.3 var(--text); color: var(--muted); }
.step-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--ink); color: var(--cream);
}
.step-btn[data-delta="-1"] { background: #f1dfc3; color: var(--ink); }
.step-btn:disabled { opacity: .4; }
.step-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.step-qty { min-width: 28px; text-align: center; font: 700 1.1875rem/1 var(--text); font-variant-numeric: tabular-nums; }
.toggle { width: 100%; min-height: 68px; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--ink); text-align: left; }
.toggle-price { font: 700 .9375rem/1 var(--text); }
/* Coke already in the Combo: read-only, branded, not green */
.toggle.included { cursor: default; }
.toggle.included .toggle-price { font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toggle.included .check { border-color: var(--ink); background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc233' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- Fields ---------- */
.form { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.field label, .field .label { display: block; margin-bottom: 6px; font: 700 .8125rem/1.2 var(--text); }
.opt-label { font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  display: block; width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--cream-2); color: var(--ink); font-size: 16px; /* 16px: no iOS zoom */
}
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: #8a6f5c; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.invalid input { border-color: var(--red); }
.on-dark { margin-top: 14px; }
.on-dark label { color: var(--cream); }
.on-dark input { min-height: 52px; border: 0; background: var(--cream); }
.pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment {
  min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--cream-2); color: var(--ink);
  font: 700 .9375rem/1 var(--text); letter-spacing: .06em;
}
.payment[aria-checked="true"] { border-color: var(--red); background: var(--red); color: var(--cream); }
.digital-payments {
  margin-top: 10px; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--cream-2); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.digital-payments p { grid-column: 1 / -1; margin: 0 0 2px; color: var(--muted); font: 700 .78rem/1.2 var(--text); }
.digital-payment {
  min-height: 44px; padding: 6px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--cream); color: var(--ink); font: 700 .78rem/1.1 var(--text);
}
.digital-payment[aria-checked="true"] { border-color: var(--red); background: var(--red); color: var(--cream); }
.sms-consent {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream-2); cursor: pointer;
}
.sms-consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--red); }
.sms-consent span { display: grid; gap: 3px; }
.sms-consent b { font: 700 .9rem/1.2 var(--text); }
.sms-consent small { font: 500 .72rem/1.35 var(--text); color: var(--muted); }

/* ---------- Review ---------- */
.review { padding: 18px 18px 16px; }
.review h3 { margin: 0 0 6px; font: 600 1.25rem/1.2 var(--display); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font: 600 .9375rem/1.3 var(--text); }
.lines li b { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.lines li.free b { font-size: .75rem; letter-spacing: .08em; color: var(--muted); }
.lines li.delivery-review { margin: 4px -8px 0; padding: 10px 8px; border-radius: 10px; background: #ffc23324; color: var(--ink); }
.lines li.delivery-review b { max-width: 58%; text-align: right; white-space: normal; color: var(--red-ink); font-size: .78rem; letter-spacing: .03em; }
.lines li.payment-review { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--rule); }
.lines li.payment-review b { white-space: normal; text-align: right; color: var(--red-ink); }
.lines .empty { color: var(--muted); font-weight: 500; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; padding-top: 12px; border-top: 1.5px dashed #dcc3a0; }
.total-row span { font: 600 1.25rem/1 var(--display); letter-spacing: .02em; }
.total-row b { font: 700 1.625rem/1 var(--display); font-variant-numeric: tabular-nums; }

/* Final checkout: the only CTA once the review is on screen (the Continue bar hides) */
.checkout { margin-top: 14px; padding: 16px; border-radius: 22px; background: var(--bg-deep); box-shadow: 0 -10px 30px #00000059; }
.cta {
  display: block; width: 100%; min-height: 58px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--gold); color: var(--ink); font: 700 1.0625rem/1.2 var(--text); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 6px 18px #ffc23340;
}
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta[aria-busy="true"] { opacity: .75; }
.cta.closed { background: #fff4e21a; color: var(--on-dark-2); box-shadow: none; font-size: .875rem; }
.cta-note { margin: 12px 0 0; text-align: center; font: 400 .8125rem/1.35 var(--text); color: var(--on-dark-2); }
.submit-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--red); color: #fff; font: 700 .9rem/1.3 var(--text); }

footer { padding: 0 0 28px; text-align: center; font: 500 .8125rem var(--text); color: var(--on-dark-2); }

/* ---------- Sticky total + Continue ---------- */
.bar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; max-width: var(--col); margin: 0 auto;
  display: flex; align-items: center; gap: 16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg-deep); border-top: 1px solid #fff4e214; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px #00000059;
  transition: transform .2s, opacity .2s;
}
.bar.hide { transform: translateY(110%); opacity: 0; pointer-events: none; }
.bar-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-copy small { font: 700 .6875rem/1.2 var(--text); letter-spacing: .1em; color: var(--on-dark-2); }
.bar-copy b { font: 700 1.625rem/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--cream); }
.bar-cta {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; border-radius: 999px; white-space: nowrap;
  background: var(--gold); color: var(--ink); text-decoration: none; font: 700 1rem/1 var(--text); letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
@media (max-width: 350px) {
  .flow { padding-left: 12px; padding-right: 12px; }
  .grid2 { gap: 10px; }
  .opt, .chip { padding-left: 12px; padding-right: 12px; }
  .hero h1 { font-size: 1.625rem; }
  .bar-cta { padding: 0 18px; }
}

/* Manual digital payment before order placement */
.digital-checkout { margin-top: 12px; padding: 14px; border: 2px solid var(--choc-ink); border-radius: 14px; background: #fff8e6; }
.digital-total { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:8px; }
.digital-total span { font:800 .78rem/1 var(--text); letter-spacing:.08em; color:var(--muted); }
.digital-total b { font:800 1.65rem/1 var(--display); color:var(--ketchup-dk); }
.pay-instruction { margin:0 0 10px; font:700 .9rem/1.35 var(--text); }
.payment-qr { display:grid; place-items:center; gap:6px; margin:10px 0; text-align:center; }
.payment-qr img { width:190px; height:190px; max-width:70vw; border:8px solid #fff; border-radius:12px; image-rendering:pixelated; }
.payment-qr small { max-width:280px; color:var(--muted); font:600 .72rem/1.35 var(--text); }
.pay-open { display:block; min-height:46px; padding:13px 12px 10px; border-radius:11px; background:var(--choc); color:var(--cream); text-align:center; text-decoration:none; font:800 .9rem/1 var(--display); }
.pay-handle { margin:10px 0 !important; padding:10px; border-radius:10px; background:var(--cream); border:1.5px dashed var(--line); text-align:center; font:800 .92rem/1.25 var(--text); overflow-wrap:anywhere; }
.paid-confirm { display:flex !important; gap:10px; align-items:flex-start; margin:10px 0 0 !important; padding:11px; border-radius:11px; background:#fff; border:2px solid var(--line); cursor:pointer; }
.paid-confirm input { width:22px !important; height:22px !important; min-height:0 !important; margin:0; flex:0 0 auto; accent-color:var(--red); }
.paid-confirm span { display:grid; gap:3px; }
.paid-confirm b { font:800 .92rem/1.1 var(--display); }
.paid-confirm small { color:var(--muted); font:600 .72rem/1.3 var(--text); }
