/* Fonts are hosted with the site (works offline, no third-party requests). Licence: fonts/OFL-licence.txt */
@font-face { font-family: 'Figtree'; src: url('../fonts/figtree-var.woff') format('woff'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('../fonts/bricolage-var.woff') format('woff'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('../fonts/baloo2-700.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --wine: #6b1f2e;
  --wine-deep: #3f0f1b;
  --wine-soft: #f2e4e4;
  --gold: #d8b26e;
  --gold-soft: #f5ead3;
  --ivory: #fbf8f4;
  --ink: #24161a;
  --muted: #6f5a5f;
  --line: #e8ddd9;
  --chilli: #b42318;
  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --logo: 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --r-s: 8px;
  --r-m: 14px;
  --wrap: 1080px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
@view-transition { navigation: auto; }
a, button, label, summary, select, input[type=checkbox], input[type=radio] { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--wine); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header: sticks to the top and clears the iPhone notch / status bar */
.top { background: var(--wine-deep); color: var(--ivory); position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
.wrap { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font: 700 30px/1 var(--logo); letter-spacing: -0.01em; padding-top: 4px; color: var(--ivory); text-decoration: none; }
.brand span { color: var(--gold); }
.cart-link { color: var(--ivory); text-decoration: none; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(251, 248, 244, 0.35); }
.cart-link b { background: var(--gold); color: var(--ink); min-width: 24px; height: 24px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 14px; padding: 0 6px; }

.top-links { display: flex; align-items: center; gap: 6px; }
.acct-link { color: var(--ivory); text-decoration: none; font-weight: 600; padding: 8px 10px; white-space: nowrap; }
.cart-link { white-space: nowrap; }
@media (max-width: 420px) {
  .brand { font-size: 26px; }
  .top-links { gap: 0; }
  .acct-link { padding: 8px; font-size: 15px; }
  .top .cart-link { padding: 7px 10px; font-size: 15px; }
}
.acct-link:hover { text-decoration: underline; }

/* Sign-in */
.auth h2 { font-size: 24px; }
.auth .sub { margin-bottom: 18px; }
.btn.social { width: 100%; background: #fff; color: var(--ink); border: 1.5px solid var(--line); margin-bottom: 10px; font-weight: 700; }
.btn.social:hover { border-color: var(--ink); filter: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth .field { margin-bottom: 12px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field input[readonly] { background: #f5f0ec; color: var(--muted); }

/* Hero */
.hero { background: var(--wine); color: var(--ivory); padding: 44px 0 40px; }
.hero h1 { font: 800 clamp(38px, 7vw, 72px)/0.98 var(--display); letter-spacing: -0.035em; margin: 0 0 16px; max-width: 15ch; }
.hero p.lede { font-size: 19px; max-width: 46ch; margin: 0 0 32px; color: #f1e3e3; }
.notice { background: var(--gold); color: var(--ink); padding: 10px 0; font-weight: 600; font-size: 15px; }

/* Week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.week::-webkit-scrollbar { display: none; }
.day { border-radius: var(--r-m); padding: 12px 12px 14px; background: rgba(251, 248, 244, 0.08); min-height: 132px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.day .dow { font-size: 14px; opacity: 0.8; }
.day .num { font: 700 32px/1 var(--display); letter-spacing: -0.02em; }
.day .tags { margin-top: auto; display: grid; gap: 4px; font-size: 13px; line-height: 1.25; }
.day.today { box-shadow: inset 0 0 0 2px rgba(251, 248, 244, 0.6); }
button.day { font: inherit; text-align: left; border: 0; cursor: pointer; }
.day.delivery { background: var(--gold); color: var(--ink); }
.day.selected { box-shadow: 0 0 0 3px var(--ivory), 0 0 0 6px var(--gold); }
.day.today.selected { box-shadow: 0 0 0 3px var(--ivory), 0 0 0 6px var(--gold); }
.day.delivery .dow { opacity: 1; }
.tag-delivery { font-weight: 700; }
.tag-deadline { font-weight: 600; }
.day.delivery .tag-deadline { color: var(--wine-deep); }
.day:not(.delivery) .tag-deadline { color: var(--gold); }
.next { margin-top: 22px; font-size: 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.next strong { font: 700 22px/1.2 var(--display); }
.next .left { background: rgba(251, 248, 244, 0.14); padding: 3px 10px; border-radius: 999px; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Menu */
section.menu { padding: 48px 0 24px; }
h2 { font: 800 34px/1.1 var(--display); letter-spacing: -0.025em; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 40px; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 96px; height: 96px; border-radius: var(--r-m); background: var(--wine-soft); object-fit: cover; display: grid; place-items: center; font: 800 36px/1 var(--display); color: var(--wine); }
.item h3 { font: 700 20px/1.2 var(--display); margin: 0 0 4px; letter-spacing: -0.01em; }
.item p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price small { font-weight: 400; color: var(--muted); }

.add { background: var(--wine); color: var(--ivory); border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.add:hover { background: var(--wine-deep); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--wine); border-radius: 999px; overflow: hidden; }
.stepper button { width: 38px; height: 36px; border: 0; background: transparent; font-size: 20px; font-weight: 700; color: var(--wine); cursor: pointer; }
.stepper button:hover { background: var(--wine-soft); }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Day chips above the menu */
.day-chips { display: flex; gap: 8px; overflow-x: auto; margin: -8px 0 8px; padding: 4px 2px 8px; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-m); padding: 9px 14px; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
.day-chip b { display: block; font-size: 16px; }
.day-chip span { font-size: 13px; color: var(--muted); }
.day-chip.on { background: var(--wine); border-color: var(--wine); color: var(--ivory); }
.day-chip.on span { color: var(--wine-soft); }
/* Scarcity badges */
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; margin: 0 0 6px; letter-spacing: 0.01em; }
.badge.hot { background: #fde7e4; color: var(--chilli); }
.badge.warm { background: var(--gold-soft); color: var(--wine-deep); }
.badge.calm { background: var(--wine-soft); color: var(--wine); }
.badge.out { background: #ece7e5; color: var(--muted); }
.item.sold-out .thumb, .item.sold-out h3, .item.sold-out p, .item.sold-out .price { opacity: 0.5; }
.add[disabled] { background: #ddd3d0; color: var(--muted); cursor: not-allowed; }
.stepper button[disabled] { opacity: 0.3; cursor: not-allowed; }
.empty-day { grid-column: 1 / -1; padding: 30px 0; }
/* "Start a new order for another day?" */
.switch-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(36, 22, 26, 0.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.switch-backdrop .dialog { background: #fff; border-radius: 18px; padding: 22px; max-width: 460px; width: 100%; margin-bottom: env(safe-area-inset-bottom); }
.switch-backdrop h2 { font-size: 22px; }
.switch-backdrop p { color: var(--muted); }
@media (min-width: 700px) { .switch-backdrop { align-items: center; } }

/* Steps */
.how { padding: 32px 0 56px; }
.how ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: s; }
.how li { counter-increment: s; padding-left: 52px; position: relative; }
.how li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: var(--wine-deep); font: 800 18px/38px var(--display); text-align: center; }
.how li b { display: block; font-size: 18px; }
.how li span { color: var(--muted); font-size: 15px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 120px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Sticky cart bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--ivory); transform: translateY(110%); transition: transform 0.25s ease; z-index: 10; }
.bar.show { transform: none; }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; }
.bar .sum { font-variant-numeric: tabular-nums; }
.bar .sum b { font-size: 19px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--gold); color: var(--ink); border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 800; font-size: 17px; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.green { background: var(--wine); color: var(--ivory); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }

/* Checkout */
.page { padding: 32px 0 80px; }
.page h1 { font: 800 clamp(32px, 5vw, 46px)/1.05 var(--display); letter-spacing: -0.03em; margin: 0 0 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; }
.stage { margin-bottom: 28px; }
.stage h2 { font-size: 22px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stage h2 i { font-style: normal; width: 32px; height: 32px; border-radius: 50%; background: var(--wine); color: var(--ivory); display: inline-grid; place-items: center; font-size: 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice label { display: block; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; background: #fff; cursor: pointer; height: 100%; }
.choice label b { display: block; font-size: 17px; }
.choice label span { font-size: 14px; color: var(--muted); }
.choice input:checked + label { border-color: var(--wine); box-shadow: inset 0 0 0 1.5px var(--wine); background: var(--wine-soft); }
.choice input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice input:disabled + label { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-s); padding: 11px 12px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--wine); outline: none; box-shadow: 0 0 0 3px var(--wine-soft); }
.field small { color: var(--muted); font-size: 13px; }
.lines { list-style: none; padding: 0; margin: 0 0 12px; }
.lines li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines li .nm { font-weight: 600; }
.lines li .ctl { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
.totals { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font: 800 22px/1.2 var(--display); padding-top: 8px; border-top: 2px solid var(--ink); margin-top: 4px; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.err { background: #fbe9e6; color: var(--chilli); border-radius: var(--r-s); padding: 12px 14px; font-weight: 600; margin: 14px 0 0; }
.empty { text-align: center; padding: 60px 20px; }
.summary-sticky { position: sticky; top: 20px; }

.day-fixed { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px solid var(--wine); background: var(--wine-soft); border-radius: var(--r-s); padding: 12px 14px; }
.small-link { font-weight: 700; color: var(--wine); white-space: nowrap; }

/* Order status */
.status { border-radius: var(--r-m); padding: 26px; margin-bottom: 24px; }
.status.ok { background: var(--wine); color: var(--ivory); }
.status.wait { background: var(--gold-soft); }
.status.bad { background: #fbe9e6; color: var(--chilli); }
.status h1 { margin: 0 0 8px; }
.status p { margin: 0; font-size: 18px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .summary-sticky { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 32px 0 30px; }
  .week { grid-template-columns: repeat(7, 84px); margin-right: -20px; padding-right: 20px; }
  .items { grid-template-columns: 1fr; }
  .item { grid-template-columns: 80px 1fr; }
  .thumb { width: 80px; height: 80px; }
  .fields { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
}
/* Touch screens: bigger tap targets, pressed feedback, and 16px inputs so iOS doesn't zoom in */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .stepper button { width: 44px; height: 42px; }
  .add { padding: 10px 20px; }
  .btn, .add, .stepper button, .cart-link, .choice label { transition: transform 0.08s ease; }
  .btn:active, .add:active, .stepper button:active, .cart-link:active, .choice label:active { transform: scale(0.97); }
  .remove { padding: 8px 4px; }
}
/* Install-app hint */
.install-chip { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--ivory); border-radius: var(--r-m); padding: 12px 12px 12px 16px; font-size: 15px; box-shadow: 0 8px 28px rgba(36, 22, 26, 0.3); }
.install-chip span { flex: 1; }
.install-chip .ic-go { background: var(--gold); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; }
.install-chip .ic-x { background: none; border: 0; color: var(--ivory); font-size: 24px; line-height: 1; padding: 4px 8px; }
body:has(.bar.show) .install-chip, body:has(.paybar.show) .install-chip { bottom: calc(90px + env(safe-area-inset-bottom)); }
/* Mobile pay bar on checkout */
.paybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--ink); color: var(--ivory); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: none; align-items: center; justify-content: space-between; gap: 12px; transform: translateY(110%); transition: transform 0.2s ease; }
.paybar.show { transform: none; }
.paybar b { font-size: 19px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .paybar { display: flex; } body.has-paybar { padding-bottom: 80px; } }

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