/* =============================================================================
   Public menu page (views/menu/index.php)
   Same look as the original site; tokens live in base.css.
   ========================================================================== */

:root {
  --pad: clamp(1rem, 4vw, 2.5rem);
  --ctl: 5.75rem;             /* width of the add / +− control column */
  --send: var(--success);     /* "send order" button */
}

html { scroll-padding-top: 4.75rem; }
body:has(dialog[open]) { overflow: hidden; }

/* ---------- Header ---------- */
.hero { text-align: center; padding: 2.5rem var(--pad) 1.75rem; }
.brand-row {
  display: flex; justify-content: center; align-items: center;
  gap: clamp(.75rem, 4vw, 2rem);
}
.wheat {
  --w: clamp(2rem, 7vw, 3rem);
  width: var(--w); height: calc(var(--w) * 3);
  color: var(--gold); transform: rotate(14deg);
}
.wheat-flip { transform: rotate(-14deg); }
.brand { margin: 0; display: grid; justify-items: center; font-weight: 400; }
.brand-name {
  font-family: var(--display);
  font-size: clamp(4.5rem, 19vw, 8.5rem);
  line-height: 1.15; color: var(--crust);
}
.brand-kind {
  font-family: var(--display);
  font-size: clamp(1.3rem, 5vw, 2rem);
  line-height: 1.6; padding: 0 1.5em;
  color: var(--paper); background: var(--crust); border-radius: var(--pill);
}
.slogan { margin: 1rem 0 0; font-size: 1.25rem; font-weight: 600; color: var(--crust); }

/* Open / closed status under the slogan */
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: .75rem 0 0; padding: .2rem .9rem;
  border-radius: var(--pill); font-weight: 600; font-size: .95rem;
}
.status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.status--open { background: var(--success-soft); color: var(--success); }
.status--closed { background: var(--danger-soft); color: var(--danger); }

.lead { margin: .5rem auto 1.25rem; max-width: 34rem; color: var(--muted); }

.search input {
  width: min(100%, 30rem); min-height: 3rem; padding: 0 1.25rem;
  border: 2px solid var(--crust); border-radius: var(--pill); background: var(--paper);
}
.search input::placeholder { color: var(--muted); }

/* ---------- Category bar + cart button ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem var(--pad);
  background: var(--dough); border-bottom: 2px solid var(--line);
}
.cats {
  flex: 1; display: flex; gap: .35rem;
  overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: none; padding: .4rem .95rem; border-radius: var(--pill);
  color: var(--crust); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.cats a:hover { background: var(--line); }
.cats a[aria-current] { background: var(--crust); color: var(--paper); }

/* The cart button: an icon with a count, so it never reads as just another category */
.cart-btn {
  flex: none; display: inline-flex; align-items: center; gap: .55rem;
  min-height: 2.75rem; padding: 0 1rem 0 .85rem;
  border: 2px solid var(--crust); border-radius: var(--pill);
  background: var(--paper); color: var(--crust); font-weight: 700;
  box-shadow: 0 2px 0 var(--line);
  transition: background-color .15s, color .15s;
}
.cart-btn:hover { background: var(--gold-soft); }
.cart-btn--full { background: var(--crust); color: var(--paper); }
.cart-btn--full:hover { background: var(--crust-dark); }
.cart-btn-icon { position: relative; display: inline-grid; place-items: center; }
.cart-btn-icon .icon { width: 1.45rem; height: 1.45rem; }
.cart-count {
  position: absolute; top: -.55rem; inset-inline-end: -.7rem;
  display: grid; place-items: center;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem;
  border: 2px solid var(--paper); border-radius: var(--pill);
  background: var(--gold); color: var(--ink);
  font-size: .78rem; font-weight: 700; line-height: 1;
}
.cart-btn-total { padding-inline-start: .55rem; border-inline-start: 1px solid currentColor; }
.cart-btn-total:empty { display: none; }

/* ---------- Menu ---------- */
.menu { max-width: 72rem; margin: 0 auto; padding: 2rem var(--pad) 3rem; }
.empty-menu { text-align: center; color: var(--muted); padding: 3rem 0; }
.cat { margin-bottom: 3rem; }
.cat-title { display: flex; align-items: center; gap: 1rem; margin: 0 0 .75rem; }
.cat-title span {
  font-family: var(--display); font-weight: 400;
  font-size: 1.7rem; line-height: 1.6; padding: 0 1.75rem;
  background: var(--crust); color: var(--paper); border-radius: var(--pill);
}
.cat-title::after { content: ""; flex: 1; height: 2px; background: var(--gold); opacity: .5; }

.items { list-style: none; margin: 0; padding: 0; columns: 2 24rem; column-gap: 3.5rem; }
.item { break-inside: avoid; padding: .4rem 0; }

.row { display: flex; align-items: baseline; gap: .6rem; }
.name { font-weight: 600; }
.leader { flex: 1 1 1rem; min-width: 1rem; border-bottom: 2px dotted var(--gold); opacity: .6; }
.price {
  flex: none; min-width: 4.75rem; padding: 0 .7rem; text-align: center;
  background: var(--crust); color: var(--paper); border-radius: var(--pill);
  font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.price small { font-weight: 500; font-size: .75em; }
.ctl { flex: none; width: var(--ctl); }

/* Sold-out entries stay visible but can't be added */
.row--soldout .name, .row--soldout .price { opacity: .55; }
.soldout {
  margin-inline-start: .35rem; padding: 0 .5rem;
  border-radius: var(--pill); background: var(--line); color: var(--ink);
  font-size: .8rem; font-weight: 700; opacity: 1;
}

.item-name { font-weight: 700; }
.variants {
  list-style: none; margin: .15rem 0 0; padding: 0;
  padding-inline-start: .9rem; border-inline-start: 3px solid var(--gold);
}
.variants li { padding: .3rem 0; }
.variants .name { font-weight: 500; }

.add {
  width: 100%; min-height: 2.5rem;
  border: 2px solid var(--crust); border-radius: var(--pill);
  background: transparent; color: var(--crust); font-weight: 700;
}
.add:hover { background: var(--crust); color: var(--paper); }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 2.5rem;
  background: var(--gold); color: var(--ink); border-radius: var(--pill);
}
.stepper button {
  width: 2.25rem; height: 2.5rem; border: 0; border-radius: var(--pill);
  background: none; font-size: 1.25rem; font-weight: 700; line-height: 1;
}
.stepper output { font-weight: 700; font-variant-numeric: tabular-nums; }

.no-results { text-align: center; padding: 2rem var(--pad) 4rem; margin: 0; color: var(--muted); }

/* ---------- Footer ---------- */
.foot {
  padding: 2rem var(--pad) 2.5rem; text-align: center;
  background: var(--crust); color: var(--paper);
}
.foot p { margin: .2rem 0; }
.foot a { color: inherit; font-weight: 700; }
.foot-brand { font-family: var(--display); font-size: 1.8rem; }


/* ---------- Floating cart bar (visible whenever the cart has something) ---------- */
.cart-bar {
  position: fixed; z-index: 20;
  inset-inline: 0; bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: .85rem;
  width: min(calc(100% - 2rem), 30rem); min-height: 3.6rem; margin: 0 auto;
  padding: .45rem .5rem .45rem 1.1rem; padding-inline: 1.1rem .5rem;
  border: 0; border-radius: var(--pill);
  background: var(--crust); color: var(--paper);
  font-weight: 700; font-size: 1.02rem; text-align: start;
  box-shadow: 0 10px 30px rgb(42 23 9 / .35), 0 2px 6px rgb(42 23 9 / .25);
}
.cart-bar:hover { background: var(--crust-dark); }
.cart-bar-icon { position: relative; display: inline-grid; place-items: center; }
.cart-bar-icon .icon { width: 1.5rem; height: 1.5rem; }
.cart-bar .cart-count { border-color: var(--crust); }
.cart-bar-label { flex: 1; }
.cart-bar-total {
  padding: .45rem 1rem; border-radius: var(--pill);
  background: var(--gold); color: var(--ink); white-space: nowrap;
}
/* Room at the end of the page so the bar never covers the footer */
body.has-cart .foot { padding-bottom: 6.5rem; }

/* ---------- Shared small buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--pill);
  background: none; color: inherit;
}
.icon-btn:hover { background: var(--line); }
.icon-btn .icon { width: 1.3rem; height: 1.3rem; }

.text-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 2.5rem; padding: 0 .6rem; border: 0; border-radius: var(--pill);
  background: none; color: var(--muted); font-weight: 600; font-size: .95rem;
}
.text-btn:hover { background: var(--line); color: var(--ink); }
.text-btn--danger { color: var(--danger); }
.text-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.outline-btn {
  min-height: 2.75rem; padding: 0 1.4rem;
  border: 2px solid var(--crust); border-radius: var(--pill);
  background: transparent; color: var(--crust); font-weight: 700;
}
.outline-btn:hover { background: var(--crust); color: var(--paper); }

/* ---------- Cart drawer ---------- */
.cart {
  position: fixed; inset-block: 0; inset-inline: auto 0;
  width: min(28rem, 100%); max-width: 100%;
  height: 100vh; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--dough); color: var(--ink);
  box-shadow: -8px 0 30px rgb(42 23 9 / .25);
}
.cart[open] { display: flex; flex-direction: column; }
.cart::backdrop { background: rgb(42 23 9 / .55); }

.cart-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1rem .8rem 1.1rem; padding-inline: 1.1rem .6rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.cart-head-icon {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; background: var(--gold-soft); color: var(--crust);
}
.cart-head-icon .icon { width: 1.35rem; height: 1.35rem; }
.cart-head-text { flex: 1; display: flex; align-items: baseline; gap: .6rem; }
.cart-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.8rem; line-height: 1.3; color: var(--crust); }
.cart-head-count { color: var(--muted); font-weight: 600; }

.cart-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* Lines: one card per item */
.cart-items { padding: 1rem 1rem .25rem; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .55rem .75rem;
  padding: .8rem .9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.line-main { display: grid; gap: .1rem; }
.line-name { font-weight: 700; line-height: 1.35; }
.line-meta { color: var(--muted); font-size: .88rem; }
.line-total { font-size: 1.05rem; color: var(--crust); white-space: nowrap; }
.line-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.line .ctl { width: 8.5rem; }
.line-remove {
  display: inline-flex; align-items: center; gap: .3rem;
  min-height: 2.5rem; padding: 0 .75rem;
  border: 0; border-radius: var(--pill);
  background: none; color: var(--danger); font-weight: 700; font-size: .92rem;
}
.line-remove:hover { background: var(--danger-soft); }
.cart-items .text-btn { margin: .4rem auto 0; display: flex; }

/* Empty cart */
.cart-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: .4rem; padding: 3rem 1.5rem; text-align: center; }
.cart-empty-icon {
  display: grid; place-items: center; width: 5rem; height: 5rem; margin-bottom: .5rem;
  border-radius: 50%; background: var(--gold-soft); color: var(--crust);
}
.cart-empty-icon .icon { width: 2.4rem; height: 2.4rem; }
.cart-empty h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--crust); }
.cart-empty p { margin: 0 0 .75rem; color: var(--muted); }

/* Checkout form */
.checkout {
  margin: .75rem 1rem 1rem; padding: 1rem 1rem .25rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.checkout h3 { margin: 0 0 .75rem; font-size: 1.15rem; color: var(--crust); }
.field { margin-bottom: .9rem; }
.field > label { display: block; font-weight: 600; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .55rem .8rem;
  border: 2px solid var(--line); border-radius: .7rem; background: var(--white);
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--crust); outline: none; }
.field input[dir="ltr"] { text-align: right; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: .3rem 0 0; color: var(--danger); font-size: .9rem; font-weight: 600; }

.method { margin: 0 0 .9rem; padding: 0; border: 0; }
.method legend { padding: 0; margin-bottom: .25rem; font-weight: 600; }
.method label { display: inline-flex; align-items: center; gap: .4rem; margin-inline-end: 1.25rem; min-height: 2.5rem; }
.method input { width: 1.15rem; height: 1.15rem; accent-color: var(--crust); }

/* Honeypot for bots: off-screen, never seen by people */
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cart-foot {
  position: sticky; bottom: 0; margin-top: auto;
  padding: .9rem 1.1rem 1.1rem;
  background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgb(42 23 9 / .08);
}
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.total strong { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--crust); }
.total-note { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); }
.form-error {
  margin: .5rem 0; padding: .6rem .8rem;
  border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger);
  font-weight: 600; font-size: .95rem;
}

.send {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; min-height: 3.1rem; margin-top: .4rem;
  border: 0; border-radius: var(--pill);
  background: var(--send); color: var(--white); font-weight: 700; font-size: 1.1rem;
}
.send:hover { filter: brightness(1.1); }
.send:disabled { filter: saturate(.4); opacity: .85; }
.send[aria-busy="true"]::before {
  content: ""; width: 1.1rem; height: 1.1rem;
  border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* Success panel after sending */
.sent { flex: 1; padding: 2.5rem 1.5rem; text-align: center; outline: none; background: var(--paper); }
.sent-icon { width: 4rem; height: 4rem; color: var(--success); }
.sent h3 { margin: .5rem 0; font-family: var(--display); font-weight: 400; font-size: 1.8rem; color: var(--crust); }
.sent p { margin: 0 0 .75rem; }
.sent-number {
  display: inline-block; padding: .2rem 1rem;
  border-radius: var(--pill); background: var(--gold-soft); font-weight: 600;
}
.sent-help { color: var(--muted); font-size: .95rem; }
.sent a { color: var(--crust); font-weight: 700; }

/* ---------- Items sold by weight ---------- */
.weight-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  width: 100%; min-height: 2.5rem; padding: 0 .6rem;
  border: 0; border-radius: var(--pill);
  background: var(--gold); color: var(--ink); font-weight: 700; white-space: nowrap;
}
.weight-chip .icon { width: 1rem; height: 1rem; }
.weight-chip:hover { filter: brightness(1.05); }

/* Weight picker: a bottom sheet on phones, a centered card on bigger screens */
.picker {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: 100%; max-height: 92dvh; margin: 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 -10px 30px rgb(42 23 9 / .25);
}
.picker::backdrop { background: rgb(42 23 9 / .55); }
.picker-body { display: grid; gap: 1rem; padding: 1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); }

.picker-head { display: flex; align-items: flex-start; gap: .75rem; }
.picker-head > div { flex: 1; }
.picker-icon {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; background: var(--gold-soft); color: var(--crust);
}
.picker-title { margin: 0; font-size: 1.2rem; line-height: 1.35; color: var(--crust); }
.picker-sub { margin: .1rem 0 0; color: var(--muted); font-size: .92rem; }

.segmented {
  display: flex; gap: .25rem; margin: 0; padding: .25rem;
  border: 0; border-radius: var(--pill); background: var(--dough);
}
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: grid; place-items: center; min-height: 2.6rem; padding: 0 .75rem;
  border-radius: var(--pill); font-weight: 700; color: var(--muted);
}
.segmented label:has(input:checked) span { background: var(--crust); color: var(--paper); }
.segmented label:has(input:focus-visible) span { outline: 3px solid var(--gold); outline-offset: 2px; }

.picker-readout { display: grid; justify-items: center; gap: .1rem; text-align: center; }
.picker-main { font-family: var(--display); font-size: 2.6rem; line-height: 1.2; color: var(--crust); }
.picker-second { color: var(--muted); font-size: 1.1rem; font-weight: 600; }

.picker-range { display: flex; align-items: center; gap: .6rem; }
.picker-range input[type="range"] { flex: 1; min-width: 0; height: 2.75rem; accent-color: var(--crust); cursor: pointer; }
.round-btn {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 2px solid var(--crust); border-radius: 50%;
  background: var(--paper); color: var(--crust); font-size: 1.4rem; font-weight: 700; line-height: 1;
}
.round-btn:hover { background: var(--gold-soft); }
.picker-limits { display: flex; justify-content: space-between; margin-top: -.6rem; padding: 0 3.35rem; color: var(--muted); font-size: .85rem; }

.picker-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.picker-chips:empty { display: none; }
.chip-btn {
  min-height: 2.4rem; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: var(--pill);
  background: var(--white); color: var(--ink); font-weight: 600;
}
.chip-btn:hover { border-color: var(--crust); }
.chip-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }

.picker-foot { display: grid; justify-items: center; gap: .25rem; }

@media (min-width: 40rem) {
  .picker {
    inset: 0; width: min(27rem, calc(100% - 2rem)); margin: auto; max-height: calc(100dvh - 2rem);
    border-radius: 22px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 30rem) {
  :root { --ctl: 5.25rem; }
  .cart-btn { padding: 0 .85rem; }
  .cart-btn-total { display: none; }
  .price { min-width: 4.25rem; padding: 0 .5rem; }
  .cart-bar { font-size: .95rem; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .cart[open] { animation: drawer .25s var(--ease); }
  .cart[open]::backdrop, .picker[open]::backdrop { animation: fade .22s ease-out; }
  .picker[open] { animation: sheet .25s var(--ease); }
  .cart-bar:not([hidden]) { animation: rise .3s var(--ease); }
  .bump { animation: bump .35s ease-out; }
}
@keyframes drawer { from { transform: translateX(-100%); } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@keyframes rise { from { transform: translateY(150%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes bump { 40% { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
