/* Menu + cart layout. Dark palette comes from theme.css. */

/* ------------------------------------------------------------ sticky bars ---
   Two stacked sticky rows: the site header, then the order-type switch and the
   category chips. Both have to be opaque — content scrolls under them. */
.menu-bar {
  position: sticky; top: var(--header-h); z-index: 39;
  background: rgba(20, 16, 12, .96); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.menu-bar .container { padding-top: 8px; }

.order-mode { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; padding-bottom: var(--sp-2); }
.order-mode .lbl { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.order-mode .hint { font-size: var(--fs-xs); color: var(--ink-3); }
/* The hint is a full sentence; on a phone it pushed the chips off screen.
   (.seg going full-width on phones lives in components.css — checkout needs it
   too.) */
@media (max-width: 640px) { .order-mode .lbl, .order-mode .hint { display: none; } }

/* Menu layout: content + sticky cart on desktop.
   min-width:0 on the columns is not cosmetic: grid columns default to
   min-width:auto, so any single child that refuses to shrink below its
   min-content width silently widens the whole page into a horizontal scroll. */
.menu-layout { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); align-items: start; }
.menu-layout > * { min-width: 0; }
@media (min-width: 940px) { .menu-layout { grid-template-columns: 1fr 340px; } }

/* -------------------------------------------------------------- categories ---*/
.cat-block { margin-bottom: var(--sp-6); scroll-margin-top: 150px; }
.cat-head { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.cat-head h2 { margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.cat-head .count { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; margin-left: auto; white-space: nowrap; }
/* On a phone the heading plus the offer pill already fill the row, so the count
   wrapped onto a line of its own and read as a stray label. */
@media (max-width: 560px) { .cat-head .count { display: none; } }
/* One B1G1 marker per category, in the heading. It used to appear four times
   per category — chip tag, heading badge, full-width banner, and a corner tag
   on every single card — which turned the offer into wallpaper. */
.cat-head .offer {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .04em;
  color: var(--gold); border: 1px solid var(--gold-dim); background: rgba(233, 185, 73, .1);
  padding: 3px 10px; border-radius: var(--r-pill);
}

/* -------------------------------------------------------------- item cards ---
   A row, not a poster. There is no food photography in the system yet, so the
   old 16:10 thumb rendered as an empty dark box with an emoji in it on every
   card — twenty broken-looking holes down the page. A priced row reads as a
   real menu instead, and it fits ~4x more items per screen. When an item does
   get an image_url the same card grows a square thumb at the left. */
.item-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
@media (min-width: 720px) { .item-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .item-grid { grid-template-columns: 1fr; } }
@media (min-width: 1180px) { .item-grid { grid-template-columns: 1fr 1fr; } }

/* A scannable row: photo, name, one line of description, price, Add. Nothing
   else. Everything the card used to carry — base line, priced tier pills, tags —
   now lives in the detail sheet a tap away, because three rows of controls per
   card wrapped the dish name, stacked the tags, and pushed each card past 260px
   on a phone. */
.item-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.item-card:hover { border-color: var(--brand); background: var(--surface-2); }
.item-card .thumb { flex: 0 0 auto; width: 68px; height: 68px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.item-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-card .title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.item-card h3 { margin: 0; font-size: var(--fs-md); font-weight: 700; }
/* One line, clipped. A description is a teaser here; the sheet shows all of it. */
.item-card .desc {
  font-size: var(--fs-xs); color: var(--ink-2); margin: 0; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-card .offer-tag { font-size: .64rem; padding: 2px 7px; }

/* Price + Add, right edge — the natural arc of a thumb. */
.item-card .side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.price-single { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--gold); white-space: nowrap; line-height: 1.1; }
.price-single .dash { color: var(--ink-3); margin: 0 1px; }
.item-card .add-btn { min-width: 64px; min-height: 38px; font-size: var(--fs-sm); padding: 8px 14px; }
.card-stepper { border-color: var(--brand); }
.card-stepper button { background: var(--brand-soft); color: var(--brand); width: 36px; height: 36px; font-size: 17px; }
.card-stepper span { min-width: 26px; font-size: var(--fs-sm); }

@media (max-width: 400px) {
  .item-card { gap: var(--sp-2); padding: var(--sp-3); }
  .item-card .thumb { width: 58px; height: 58px; }
  .price-single { font-size: 1rem; }
  .item-card .add-btn { min-width: 56px; padding: 8px 10px; }
}

/* -------------------------------------------------------------- item sheet ---
   Tapping a card opens this. The card is a dense row by necessity; the sheet is
   where the dish gets to look like food — photo at full width, description
   unclipped, every option priced. */
.sheet-hero {
  /* Bleeds to the sheet's edges: .modal-body has its own padding, and a photo
     inset on all four sides reads as a thumbnail rather than as the subject. */
  margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-4);
  aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden;
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.sheet-desc { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; margin: 0 0 var(--sp-3); }
.sheet-tags { margin-bottom: var(--sp-2); }
/* Quantity and Add share the footer so both are in the thumb zone. */
.sheet-foot { display: flex; align-items: center; gap: var(--sp-3); }
.sheet-foot .stepper { flex: 0 0 auto; }
.sheet-foot .stepper button { width: 42px; height: 42px; font-size: 18px; }
.sheet-foot .btn { min-height: 46px; }
/* Prices under the option labels — the whole range readable at once. */
.opt small { color: var(--brand); }
.opt.active small { color: var(--gold); }
.opt:disabled { opacity: .4; cursor: not-allowed; }
.opt:disabled small { color: var(--ink-3); }

/* ---------------------------------------------------------------- sold out ---
   Dimmed and unorderable, but still listed with its price. Hiding it would make
   the menu look different every day and lose the "ask me tomorrow" signal. */
.badge-out { background: rgba(211, 59, 44, .16); color: #ff8b7d; border: 1px solid rgba(211, 59, 44, .4); }
.item-card.sold-out { opacity: .62; }
.item-card.sold-out:hover { border-color: var(--line); background: var(--surface); }
.item-card.sold-out .thumb img { filter: grayscale(1); }
.item-card.sold-out .price-single { color: var(--ink-3); }
.opt small { display: block; font-size: .66rem; font-weight: 700; margin-top: 3px; }
.cart-gone { font-size: var(--fs-xs); color: #ff8b7d; background: rgba(211, 59, 44, .12); border: 1px solid rgba(211, 59, 44, .32); border-radius: var(--r-md); padding: 8px 10px; margin-bottom: var(--sp-3); line-height: 1.45; }

/* ------------------------------------------------------------------- cart ---*/
.cart-panel { position: sticky; top: calc(var(--header-h) + 74px); }
.cart-panel .card-pad { padding: var(--sp-4); }
.cart-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.cart-title h3 { font-family: var(--font-display); }
.cart-items { display: flex; flex-direction: column; gap: var(--sp-3); max-height: 46vh; overflow-y: auto; margin-bottom: var(--sp-3); }
.cart-line { display: flex; gap: var(--sp-2); align-items: center; }
.cart-line + .cart-line { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.cart-line .cl-main { flex: 1; min-width: 0; }
.cart-line .cl-name { font-weight: 700; font-size: var(--fs-sm); }
.cart-line .cl-variant { font-size: var(--fs-xs); color: var(--ink-3); }
.cart-line .cl-price { font-weight: 800; font-size: var(--fs-sm); white-space: nowrap; }
.cart-totals { border-top: 1px dashed var(--line); padding-top: var(--sp-3); font-size: var(--fs-sm); }
.cart-totals .row-between { margin-bottom: 6px; }
.cart-totals .grand { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; border-top: 1px solid var(--line); padding-top: var(--sp-2); margin-top: var(--sp-2); }
.free-note { color: #4cc76c; font-weight: 700; font-size: var(--fs-xs); }

/* Mobile cart bar + drawer. Kept saffron: it is the one control on the page
   that must never be missed, and it is the only bright thing left. */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 -8px 26px rgba(0, 0, 0, .5); gap: var(--sp-3);
}
.cart-bar .cb-count { font-weight: 800; }
.cart-bar .cb-total { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
@media (max-width: 939px) {
  .cart-panel.desktop { display: none; }
  .cart-bar.show { display: flex; }
  main { padding-bottom: 90px; }
}

/* Cart count pill in header */
.cart-pill { position: relative; }
.cart-pill .count { position: absolute; top: -6px; right: -6px; background: var(--accent-red); color: #fff; font-size: 0.65rem; font-weight: 800; min-width: 18px; height: 18px; border-radius: var(--r-pill); display: grid; place-items: center; padding: 0 4px; }

/* ------------------------------------------------- sold-out cart lines ---
   A dead row states its own state and carries its own fix. Previously the only
   signal was a footnote under the list, leaving the customer to match it to a
   row and tap − until it went away. */
.cart-line.dead .cl-name { color: var(--ink-2); }
.cart-line.dead .cl-price.struck { color: var(--ink-3); text-decoration: line-through; }
.cl-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.cl-act { padding: 6px 11px; font-size: .72rem; }
.cart-gone { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.cart-gone .btn { flex: 0 0 auto; }

/* --------------------------------------------------------------- menu intro ---
   Static heading + copy above the API-rendered list. Small on purpose: the
   customer came here for the items, this is mainly what a crawler reads. */
.menu-intro { padding: var(--sp-5) 0 var(--sp-4); max-width: 72ch; }
.menu-intro h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin: 0; }
.menu-intro p { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; }
