/* Customer pages (mobile-first, 320 px up): menu, option sheet, cart,
   order status and legal pages. Neutral, warm chrome so each bar's own
   logo and cover photo stand out. */

body.customer { font-size: 16px; padding-bottom: env(safe-area-inset-bottom); }
body.customer.has-cartbar { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

/* ---------- Header (home view) ---------- */

.c-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper); border-bottom: 1px solid var(--line);
  transition: box-shadow .2s var(--ease);
}
.c-header.is-stuck { box-shadow: 0 6px 16px -10px rgba(35, 32, 28, .35); }
.c-header__inner {
  max-width: 640px; margin: 0 auto; padding: var(--s-2) var(--s-4);
  min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
}
.c-header__bar, .c-header__title {
  margin: 0; min-width: 0; font-weight: 800; font-size: 1.1rem; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Under a hero the name is already on screen: show it once the hero scrolls away. */
.c-header--hero .c-header__bar { opacity: 0; transition: opacity .2s var(--ease); }
.c-header--hero.is-stuck .c-header__bar { opacity: 1; }
.c-header__table {
  margin: 0 0 0 auto; flex: 0 0 auto; padding: .15rem .7rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9375rem; white-space: nowrap;
}

/* ---------- Menu ---------- */

.c-main { max-width: 640px; margin: 0 auto; padding: var(--s-2) var(--s-4) var(--s-6); }

/* Home: one row per category - index, name, in-cart badge, chevron. */
.c-catnav { margin-top: var(--s-4); }
.c-catlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.c-catlist li { border-bottom: 1px solid var(--line); }
.c-catrow {
  display: flex; align-items: center; gap: var(--s-3); min-height: 68px; padding: var(--s-3) var(--s-1);
  color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s var(--ease);
}
.c-catrow:active { background: var(--paper-2); }
.c-catrow__num { flex: 0 0 2.2ch; color: var(--ink-2); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-catrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-catrow__name { font-size: 1.375rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.c-catrow__meta { color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.c-catrow__badge {
  flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 .45rem;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: .8125rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.c-catrow__chev { flex: 0 0 auto; color: var(--ink-2); font-size: 1.75rem; line-height: 1; }
.c-catrow.is-empty .c-catrow__name { color: var(--ink-2); }

/* Category screen: compact sticky header with "‹" back. */
.c-cathead {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s-2);
  margin: 0 calc(-1 * var(--s-4)); padding: var(--s-2) var(--s-4); min-height: 56px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.c-back {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); margin-left: calc(-1 * var(--s-2));
  border-radius: 999px; color: var(--ink); font-size: 2rem; line-height: 1; text-decoration: none;
}
.c-back:active { background: var(--paper-2); }
.c-cathead__title { flex: 1; min-width: 0; margin: 0; font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-cathead__title:focus { outline: none; }
.c-cathead__title:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.c-cathead__table { margin: 0; flex: 0 0 auto; padding: .1rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .875rem; white-space: nowrap; }
.c-cat { padding-bottom: var(--s-4); }
.c-cat .c-list { margin-top: var(--s-3); }
.c-banner--compact { margin: var(--s-3) 0 0; padding: var(--s-2) var(--s-3); font-size: .9375rem; }
.c-cat__filtered { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); margin: var(--s-3) 0 0; color: var(--ink-2); font-size: .9375rem; }
.c-cat__filtered .linklike { min-height: var(--tap); font-weight: 650; }
.c-banner { background: var(--warn-soft); border: 1px solid #e6d2a6; color: var(--warn); border-radius: var(--r); padding: var(--s-3) var(--s-4); font-weight: 600; margin: var(--s-3) 0; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }

/* Each dish is a light card: a little depth, nothing loud. */
.c-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3);
  padding: var(--s-3); background: var(--card); border: 1px solid #e8e0d3; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(35, 32, 28, .05), 0 4px 12px -8px rgba(35, 32, 28, .18);
}
.c-item__body { min-width: 0; }
.c-item__name { font-size: 1.0625rem; font-weight: 750; margin: 0 0 2px; line-height: 1.3; overflow-wrap: anywhere; }
.c-item__desc {
  margin: 0 0 var(--s-1); color: var(--ink-2); font-size: .9375rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.c-allergens { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.al {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px .55rem 2px 2px; border-radius: 999px;
  font-size: .8125rem; font-weight: 650; line-height: 1.3; color: var(--al-fg); background: var(--al-bg);
}
.al .al-icon { width: 20px; height: 20px; padding: 2px; background: rgba(255, 255, 255, .7); }

/* Allergen legend + filter */
.c-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin: var(--s-3) 0 0; }
.c-tool {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4) 0 var(--s-2);
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  font: inherit; font-size: .9375rem; font-weight: 650; cursor: pointer;
}
.c-tool.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.c-tool__icon { width: 26px; height: 26px; padding: 4px; border-radius: 999px; color: var(--al-fg); background: var(--al-bg); }
.c-tools__note { margin: 0; font-size: .875rem; color: var(--ink-2); }
.c-filter {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-3);
  margin: var(--s-3) 0 0; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  background: var(--ink); color: #fff; border-radius: var(--r); font-size: .9375rem;
}
.c-filter__text { min-width: 0; overflow-wrap: anywhere; }
.c-filter__clear {
  min-height: var(--tap); padding: 0 var(--s-4); border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer;
}
.c-item.is-filtered { display: none; }

.al-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: var(--s-2); }
.al-pick {
  display: flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: var(--s-1) var(--s-3) var(--s-1) var(--s-1);
  border: 2px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink);
  font: inherit; font-size: .9375rem; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.al-pick__icon { width: 36px; height: 36px; padding: 6px; flex: 0 0 auto; border-radius: 999px; color: var(--al-fg); background: var(--al-bg); }
.al-pick__label { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.al-pick__mark { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px; border: 2px solid var(--line); }
.al-pick[aria-checked="true"] { border-color: var(--danger); background: var(--danger-soft); }
.al-pick[aria-checked="true"] .al-pick__mark { border-color: var(--danger); background: var(--danger); box-shadow: inset 0 0 0 3px #fff; }
.c-item__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: var(--s-2); }
.c-item__price { margin: 0; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-from { font-weight: 500; color: var(--ink-2); font-size: .875rem; }
.c-add {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: var(--tap); min-width: var(--tap); padding: 0;
  border-radius: 999px; border: 0; background: var(--accent); color: #fff;
  font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer;
  transition: transform .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.c-add__icon { font-size: 1.5rem; line-height: 1; font-weight: 600; }
/* The whole row of an orderable dish is tappable (plain dishes add at once). */
.c-item.is-orderable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.c-item.is-orderable:active { background: #fdfaf5; }
.c-add:active { transform: scale(.96); }
.c-add[disabled] { background: #c9bfb1; cursor: not-allowed; transform: none; }
.is-soldout .c-item__name, .is-soldout .c-item__price { color: var(--ink-2); }
.c-soldout { font-weight: 700; color: var(--ink-2); font-size: .875rem; min-height: var(--tap); display: inline-flex; align-items: center; }
.c-empty { text-align: center; color: var(--ink-2); padding: 3rem 0; }


/* ---------- Cart bar + toast ---------- */

@keyframes c-rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.c-cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgba(247, 243, 236, 0));
  animation: c-rise .22s var(--ease);
}
.c-cartbar__btn {
  width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 56px; padding: var(--s-2) var(--s-4); border: 0; border-radius: var(--r-lg);
  background: var(--ink); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(35, 32, 28, .55);
}
.c-cartbar__label { flex: 1; text-align: left; }
/* Item count in a small square on the left. */
.c-cartbar__count {
  display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 34px; height: 34px; padding: 0 .35rem;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.c-cartbar__total { font-variant-numeric: tabular-nums; }

/* Snackbar: compact, above the cart bar (JS lifts it over an open sheet's footer). */
.c-snack {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translateX(-50%); width: max-content; max-width: min(calc(100% - 2rem), 480px);
  display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-1) var(--s-1) var(--s-1) var(--s-4);
  background: var(--ink); color: #fff; border-radius: 999px; font-size: .9375rem; font-weight: 600;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45);
}
.c-snack.is-in { animation: c-snack-in .2s var(--ease); }
.c-snack__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: var(--s-2) 0; }
.c-snack__undo {
  flex: 0 0 auto; min-height: 36px; padding: 0 var(--s-3); border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #ffd9cf; font: inherit; font-weight: 750; cursor: pointer;
}
.c-snack__undo:active { transform: scale(.96); }
@keyframes c-snack-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Bottom sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(35, 32, 28, .5); opacity: 0; transition: opacity .24s var(--ease); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto;
  max-height: 92vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 32px -12px rgba(0, 0, 0, .35);
  transform: translateY(100%); transition: transform .24s var(--ease);
  will-change: transform;
}
@supports (height: 100dvh) { .sheet__panel { max-height: 92dvh; } }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: var(--s-2) auto 0; flex: 0 0 auto; }
.sheet__head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3) var(--s-1); flex: 0 0 auto; }
.sheet__title { flex: 1; min-width: 0; margin: 0; padding-left: var(--s-2); font-size: 1.15rem; text-align: left; overflow-wrap: anywhere; }
.sheet__icon { width: var(--tap); height: var(--tap); flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-1) var(--s-4) var(--s-4); -webkit-overflow-scrolling: touch; }
.sheet__foot { flex: 0 0 auto; padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: var(--s-2); background: var(--card); }
.sheet__cta { min-height: 54px; font-size: 1.05rem; border-radius: var(--r); }
.sheet__hint { color: var(--ink-2); margin: 0 0 var(--s-3); }
.sheet__label { margin-top: var(--s-4); }

.opts { display: grid; gap: var(--s-2); }
.opt {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-2) var(--s-4);
  border: 2px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.opt__mark { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--ink-2); flex: 0 0 auto; }
.opt[role="checkbox"] .opt__mark { border-radius: 6px; }
.opt__name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.opt__price { color: var(--ink-2); white-space: nowrap; }
.opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.opt.is-on .opt__mark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: #fff; flex: 0 0 auto; }
.qty__btn { width: var(--tap); height: var(--tap); border: 0; background: none; font-size: 1.4rem; color: var(--ink); cursor: pointer; border-radius: var(--r); }
.qty__btn:active:not([disabled]) { transform: scale(.88); }
.qty__btn[disabled] { color: #c9bfb1; cursor: default; }
.qty__value { min-width: 2ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Lock page scroll while the sheet is open (iOS ignores overflow on body). */
body.sheet-open { overflow: hidden; }

/* ---------- Status page ---------- */

.c-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-4); margin: var(--s-4) 0; }
.c-card h2 { font-size: 1.15rem; }
.c-card .eyebrow { font-size: .875rem; letter-spacing: .04em; }
.c-status__headline { font-size: 1.5rem; margin: var(--s-1) 0 var(--s-4); }
.c-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-1); padding: 0; margin: 0 0 var(--s-4); }
.c-steps li { text-align: center; font-size: .875rem; line-height: 1.25; color: var(--ink-2); padding-top: var(--s-3); border-top: 5px solid var(--line); overflow-wrap: normal; word-break: normal; hyphens: auto; transition: border-color .3s var(--ease), color .3s var(--ease); }
.c-steps li.is-done { border-top-color: var(--ink-2); color: var(--ink); }
.c-steps li.is-current { border-top-color: var(--accent); color: var(--accent); font-weight: 700; }
.c-lines { list-style: none; margin: 0; padding: 0; }
.c-lines li { display: flex; gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px dashed var(--line); }
.c-lines__qty { font-weight: 700; min-width: 2.2ch; }
.c-lines__name { min-width: 0; overflow-wrap: anywhere; }
.c-lines__opts { display: block; color: var(--ink-2); font-size: .9rem; }
.c-total { display: flex; justify-content: space-between; font-size: 1.15rem; margin: var(--s-3) 0 0; }
.c-center { text-align: center; }
.c-status .btn { min-height: 48px; }

/* ---------- Legal pages ---------- */

.legal { line-height: 1.6; padding-top: var(--s-4); }
.legal h1 { font-size: 1.5rem; margin-bottom: var(--s-4); }
.legal h2 { font-size: 1.15rem; margin: var(--s-5) 0 var(--s-2); }
.legal p, .legal li { max-width: 68ch; overflow-wrap: anywhere; }
.legal ul, .legal ol { padding-left: 1.25rem; margin: 0 0 var(--s-4); }
.legal li + li { margin-top: var(--s-1); }
.legal p a, .legal li a { padding: .6rem 0; }
.legal .legal__id { list-style: none; padding: var(--s-3) var(--s-4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.legal table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.legal th, .legal td { text-align: left; padding: var(--s-2); border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---------- Footer (legal links, address) ---------- */

.c-footer { max-width: 640px; margin: 0 auto; padding: var(--s-5) var(--s-4) var(--s-6); color: var(--ink-2); font-size: .875rem; border-top: 1px solid var(--line); }
.c-footer p { margin-bottom: var(--s-2); }
.c-footer a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: var(--tap); text-underline-offset: 3px; }
.c-footer__name { color: var(--ink); font-size: 1rem; margin-bottom: var(--s-1); }
.c-footer__contact { list-style: none; margin: 0 0 var(--s-2); padding: 0; }
.c-footer__contact li { overflow-wrap: anywhere; }
.c-footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); list-style: none; padding: 0; margin: var(--s-1) 0 var(--s-2); }
.c-footer__credit { margin-top: var(--s-2); }

/* ---------- Bar cover photo + logo (above the sticky header) ---------- */

.c-hero { max-width: 640px; margin: 0 auto; position: relative; }
.c-hero__inner { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-2); }
.c-hero__logo { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 14px; object-fit: cover; background: var(--card); border: 1px solid var(--line); }
.c-hero__name { margin: 0; min-width: 0; font-weight: 800; font-size: 1.4rem; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -.01em; }
.c-hero--cover { height: 168px; overflow: hidden; background: var(--ink); }
.c-hero__cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-hero--cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .72)); }
.c-hero--cover .c-hero__inner { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding-bottom: var(--s-3); }
.c-hero--cover .c-hero__name { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.c-hero--cover .c-hero__logo { border-color: rgba(255, 255, 255, .7); }
@media (min-width: 720px) { .c-hero--cover { height: 220px; border-radius: 0 0 var(--r) var(--r); } }

@media (prefers-reduced-motion: reduce) {
  .c-cartbar, .c-snack.is-in { animation: none; }
}

/* ---------- Dish photos + lightbox ---------- */

.c-item--photo { grid-template-columns: auto minmax(0, 1fr) auto; }
.c-item__photo {
  display: block; width: 80px; height: 80px; padding: 0; border: 0; border-radius: var(--r);
  background: var(--paper-2); overflow: hidden; cursor: zoom-in; align-self: start;
  box-shadow: 0 1px 2px rgba(35, 32, 28, .12);
  -webkit-tap-highlight-color: transparent;
}
.c-item__thumb { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--ease); }
.c-item__photo:active .c-item__thumb { transform: scale(.96); }
@media (min-width: 560px) { .c-item__photo { width: 88px; height: 88px; } }
@media (max-width: 359px) { .c-item__photo { width: 64px; height: 64px; } }
.is-soldout .c-item__thumb { filter: grayscale(1); opacity: .7; }

.lightbox { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: var(--s-4); padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom)); }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(20, 18, 16, .82); opacity: 0; transition: opacity .22s var(--ease); }
.lightbox__panel {
  position: relative; width: min(90vw, 720px); max-height: 100%; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6);
  opacity: 0; transform: scale(.94); transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.lightbox.is-open .lightbox__backdrop { opacity: 1; }
.lightbox.is-open .lightbox__panel { opacity: 1; transform: none; }
.lightbox__frame { background: #1c1a17; display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 70vh; min-height: 0; }
.lightbox__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lightbox__close {
  position: absolute; top: var(--s-2); right: var(--s-2); z-index: 1; width: var(--tap); height: var(--tap);
  border-radius: 999px; border: 0; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox__caption { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.lightbox__text { min-width: 0; }
.lightbox__title { font-size: 1.1rem; margin: 0; overflow-wrap: anywhere; }
.lightbox__price { margin: 2px 0 0; font-weight: 800; }
.lightbox__price:empty { display: none; }
.lightbox__add { padding: 0 var(--s-4) 0 var(--s-3); }

/* ---------- Micro-interactions ---------- */

@keyframes c-bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes c-pop { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
.c-cartbar__count.is-bump { animation: c-bump .38s var(--ease); }
.c-add.is-added { animation: c-pop .3s var(--ease); }

/* Hero: a little more presence for the bar's own photo and logo. */
.c-hero__logo { box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); }
.c-hero--cover .c-hero__name { font-size: 1.6rem; }
@media (min-width: 720px) { .c-hero__name { font-size: 1.75rem; } }

@media (prefers-reduced-motion: reduce) {
  .c-cartbar__count.is-bump, .c-add.is-added { animation: none; }
}

/* Narrow phones: keep the four status steps on one line each without breaking words. */
@media (max-width: 380px) {
  .c-steps li { font-size: .75rem; }
}

/* ---------- In-cart state on dish cards ---------- */

.c-item { transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.c-item.is-incart { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), 0 4px 12px -8px rgba(35, 32, 28, .18); }
.c-item__badge {
  display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 var(--s-1); padding: 1px .55rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8125rem; font-weight: 750;
}
.c-item__badge::before { content: "✓"; font-weight: 800; }
.c-qty {
  display: inline-flex; align-items: center; min-height: var(--tap); border-radius: 999px;
  background: var(--accent); color: #fff; box-shadow: 0 2px 6px -2px rgba(166, 61, 42, .5);
}
.c-qty__btn {
  width: var(--tap); height: var(--tap); border: 0; border-radius: 999px; background: none; color: inherit;
  font: inherit; font-size: 1.35rem; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease);
}
.c-qty__btn:active { transform: scale(.86); }
.c-qty__btn.is-added { animation: c-pop .3s var(--ease); }
.c-qty__val { min-width: 1.6ch; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Product sheet: all choices on one screen ---------- */

.pgroup { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); scroll-margin: var(--s-4); }
.pgroup:first-child { padding-top: var(--s-1); }
.pgroup__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pgroup__name { margin: 0; font-size: 1.05rem; font-weight: 800; }
.pgroup__req { flex: 0 0 auto; padding: 1px .55rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: .75rem; font-weight: 700; }
.pgroup__req.is-req { background: var(--ink); color: #fff; }
.pgroup__hint { margin: 2px 0 var(--s-2); color: var(--ink-2); font-size: .875rem; }
.pgroup__hint.is-warn { color: var(--danger); font-weight: 650; }

/* Sizes (and quick one-choice dishes) as big tiles with the full price. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr)); gap: var(--s-2); }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 72px; padding: var(--s-2); border: 2px solid var(--line); border-radius: var(--r); background: #fff;
  color: var(--ink); font: inherit; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .12s var(--ease);
}
.tile:active { transform: scale(.97); }
.tile__name { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tile__price { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile.is-on { border-color: var(--accent); background: var(--accent-soft); }
.tile.is-on .tile__price { color: var(--accent); }
.opt:active { transform: scale(.985); }

.pnote__row { padding: var(--s-3) 0 0; }
.pnote__toggle { min-height: var(--tap); font-weight: 650; text-decoration: none; }
.pnote { padding-top: var(--s-2); }
.pnote label { font-size: .9375rem; }

.pfoot { display: flex; align-items: center; gap: var(--s-3); }
.pfoot__cta { flex: 1; min-width: 0; }
.pfoot__need { margin: 0; color: var(--ink-2); font-size: .875rem; text-align: center; }
.pfoot__need:empty { display: none; }
.pfoot > .pfoot__need { flex: 1; font-weight: 650; color: var(--ink); }
.pfoot__cta.is-disabled { background: #c9bfb1; border-color: #c9bfb1; }
.pfoot .qty { border-radius: 999px; }

/* Step sheet: one group per step, progress dots, review. */
.pstep__dish { margin: 0; color: var(--ink-2); font-size: .875rem; font-weight: 700; overflow-wrap: anywhere; }
.pdots { list-style: none; display: flex; gap: 6px; margin: var(--s-2) 0 var(--s-3); padding: 0; }
.pdots__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .2s var(--ease), background-color .2s var(--ease); }
.pdots__dot.is-done { background: var(--ink-2); }
.pdots__dot.is-current { width: 22px; background: var(--accent); }
.pstep__hint { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: .9375rem; }
.pstep__hint strong { color: var(--ink); }
.pstep__hint.is-warn { color: var(--danger); font-weight: 650; }
.preview { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.preview li { border-bottom: 1px solid var(--line); }
.preview__line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-3); align-items: center; width: 100%;
  min-height: 56px; padding: var(--s-2) 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.preview__group { grid-column: 1; color: var(--ink-2); font-size: .8125rem; font-weight: 700; }
.preview__choice { grid-column: 1; font-weight: 700; overflow-wrap: anywhere; }
.preview__edit { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: .875rem; font-weight: 700; }
.pfoot--solo .pfoot__cta { width: 100%; }
/* Keep the panel from jumping in height between steps. */
.sheet[data-kind="steps"] .sheet__panel { min-height: min(560px, 70vh); }

/* Press feedback on the main actions. */
.sheet__cta:active:not([disabled]), .c-cartbar__btn:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  .c-qty__btn.is-added { animation: none; }
  .pdots__dot { transition: none; }
  .tile, .c-qty__btn, .qty__btn { transition: none; }
}

/* ---------- Cart: "Tu pedido" with payment buttons ---------- */

.cart { list-style: none; margin: 0; padding: 0; }
.cart__notice { margin: var(--s-1) 0 var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: .9375rem; }
/* Stepper on the left, name (+ options, note) in the middle, price on the right. */
.cline {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); align-items: start;
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
}
.cline__info { display: flex; flex-direction: column; min-width: 0; padding-top: 6px; }
.cline__name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.cline__sub { color: var(--ink-2); font-size: .875rem; line-height: 1.35; overflow-wrap: anywhere; }
.cline__unit { color: var(--ink-2); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.cline__total { padding-top: 6px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cline__notebtn { align-self: flex-start; min-height: 36px; font-size: .875rem; font-weight: 650; text-decoration: none; }
.cline__note { margin-top: var(--s-1); min-height: 40px; padding: .35rem .6rem; font-size: .9375rem; }
.cline.is-error { background: var(--danger-soft); border-radius: var(--r-sm); padding-left: var(--s-2); padding-right: var(--s-2); }
.cline.is-error .cline__name { color: var(--danger); }
.qty--sm { border-radius: 999px; }
.qty--sm .qty__btn { width: 38px; height: 38px; font-size: 1.25rem; display: inline-grid; place-items: center; }
.qty__btn--remove { color: var(--danger); }
.cart__more { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: var(--s-1); font-weight: 650; text-decoration: none; }
.cart__who { margin-top: var(--s-3); }
.cart__wholine { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; }
.cart__wholine .linklike { min-height: var(--tap); font-weight: 650; }
.cart__label { font-size: .9375rem; }
.cart__noterow { margin-top: 0; }
.cart__notebtn { min-height: var(--tap); font-weight: 650; text-decoration: none; }
.cart__note { margin-top: var(--s-1); }
.sheet__body.is-sending { pointer-events: none; opacity: .6; }

.sheet[data-kind="cart"] .sheet__foot { gap: var(--s-2); }
.cart__error {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: .9375rem;
}
.cart__errtext { margin: 0; flex: 1 1 12rem; font-weight: 600; }
.cart__erract { flex: 0 0 auto; background: var(--card); color: var(--danger); border-color: var(--danger-line); }
.cart__min { margin: 0; color: var(--warn); font-size: .875rem; font-weight: 600; }
/* Divider + big total. */
.cart__total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding-top: var(--s-1); font-weight: 800; font-size: 1.15rem; }
.cart__count { color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.cart__sum { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Each payment button sends the order. */
.payact { display: grid; gap: var(--s-2); }
.payact__btn { flex-direction: column; gap: 0; min-height: 56px; border-radius: var(--r); font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.payact__btn.is-busy { flex-direction: row; gap: var(--s-2); cursor: progress; }
.payact__sub { font-size: .8125rem; font-weight: 600; opacity: .85; }
.payact__btn--alt { background: var(--card); color: var(--ink); border: 2px solid var(--ink); }
.payact__btn--alt:hover { background: var(--paper-2); border-color: var(--ink); }
.payact__btn--alt .spinner { border-color: rgba(35, 32, 28, .25); border-top-color: var(--ink); }
.payact__btn[disabled] { background: #c9bfb1; border-color: #c9bfb1; color: #fff; opacity: 1; }
.payact__btn.is-busy[disabled] { background: var(--accent); border-color: var(--accent); }
.payact__btn--alt.is-busy[disabled] { background: var(--card); color: var(--ink); border-color: var(--ink); }
.payact__legal { margin: 0; color: var(--ink-2); font-size: .75rem; line-height: 1.4; }
.payact__legal a { color: var(--ink-2); text-underline-offset: 2px; }
.payact__btn:active:not([disabled]) { transform: scale(.98); }

.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: c-spin .8s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }

/* ---------- Inline name prompt (first visit, skippable) ---------- */

.c-hello {
  position: relative; margin: var(--s-3) 0 0; padding: var(--s-3) var(--s-6) var(--s-3) var(--s-3);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.c-hello__label { display: block; margin: 0 0 var(--s-2); font-weight: 700; font-size: .9375rem; }
.c-hello__opt { font-weight: 500; color: var(--ink-2); font-size: .8125rem; }
.c-hello__row { display: flex; gap: var(--s-2); }
.c-hello__row input { flex: 1; min-width: 0; }
.c-hello__save { flex: 0 0 auto; }
.c-hello__skip {
  position: absolute; top: 2px; right: 2px; width: var(--tap); height: var(--tap); border: 0; border-radius: 999px;
  background: none; color: var(--ink-2); font-size: 1.4rem; line-height: 1; cursor: pointer;
}

/* Wider screens: a centred, narrower sheet reads better than a full-width one. */
@media (min-width: 760px) {
  .sheet__panel { max-width: 560px; bottom: var(--s-4); border-radius: 20px; max-height: calc(100vh - 2rem); }
  .sheet__grip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* ---------- Full-height cart and step sheet chrome ---------- */

/* The cart is a full-height panel on phones, centred (max 560 px) on wider screens. */
.sheet[data-kind="cart"] .sheet__panel {
  top: 0; max-width: 560px; max-height: none; border-radius: 0;
  padding-top: env(safe-area-inset-top);
}
.sheet[data-kind="cart"] .sheet__grip { display: none; }
.sheet[data-kind="cart"] .sheet__head { padding-top: var(--s-2); }
@media (min-width: 760px) {
  .sheet[data-kind="cart"] .sheet__panel { top: var(--s-4); bottom: var(--s-4); border-radius: 20px; max-height: none; }
}
.sheet__back { font-size: 1.6rem; }
.sheet__title:focus { outline: none; }
.sheet__title:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* Slide between option steps (none with reduced motion: JS skips the class). */
@keyframes c-step-fwd { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes c-step-back { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__body.is-step-fwd { animation: c-step-fwd .2s var(--ease); }
.sheet__body.is-step-back { animation: c-step-back .2s var(--ease); }
.sheet[data-kind="steps"] .sheet__body { overflow-x: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sheet__body.is-step-fwd, .sheet__body.is-step-back { animation: none; }
}

/* ---------- Status page: success ---------- */

.c-done { text-align: center; padding-top: var(--s-5); }
.c-done .c-steps { text-align: left; }
.c-check { display: grid; place-items: center; margin: 0 auto var(--s-3); }
.c-check svg { display: block; }
.c-check__ring { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2.5; }
.c-check__tick { fill: none; stroke: var(--ok); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 0; }
.c-done.is-placed .c-check svg { animation: c-check-pop .45s var(--ease) both; }
.c-done.is-placed .c-check__tick { animation: c-check-draw .4s .25s var(--ease) both; }
@keyframes c-check-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes c-check-draw { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
.c-wait { width: 44px; height: 44px; margin: 0 auto var(--s-3); border-radius: 999px; border: 4px solid var(--line); border-top-color: var(--accent); animation: c-spin .9s linear infinite; }
.c-done .c-status__headline { margin: 0 0 var(--s-1); font-size: 1.6rem; letter-spacing: -.01em; }
.c-status__sub { margin: 0 auto var(--s-2); max-width: 32ch; color: var(--ink-2); }
.c-done__meta {
  display: inline-block; margin: 0 0 var(--s-4); padding: .15rem .75rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9375rem; overflow-wrap: anywhere;
}
.c-status__pay { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-2); }
.c-status__pay:empty { display: none; }
.c-status__pay .badge { font-size: .875rem; padding: .2rem .7rem; }
.c-done__actions { display: grid; gap: var(--s-2); margin: var(--s-4) 0; }
.c-done__actions .btn { min-height: 52px; font-size: 1.05rem; border-radius: var(--r); }
.c-done__actions .btn:active { transform: scale(.98); }
.c-lines__price { margin-left: auto; padding-left: var(--s-2); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .c-done__actions.has-two { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .c-done.is-placed .c-check svg, .c-done.is-placed .c-check__tick { animation: none; }
  .c-wait { animation-duration: 2.4s; }
}

/* Table sessions: closed table page (and the in-page state after a 410). */
.c-closed__card { padding-top: var(--s-5); padding-bottom: var(--s-5); }
.c-closed__hint { margin: var(--s-2) 0 0; color: var(--ink-2); }
.c-done__closed { margin: 0; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-align: center; }
.c-done__closed strong { display: block; }

/* "La cuenta de la mesa": entry on the menu home and the bill page. */
.c-done__actions.has-two > :last-child:nth-child(3) { grid-column: 1 / -1; }
.c-billlink {
  display: flex; align-items: center; gap: var(--s-3); min-height: 56px; margin: var(--s-3) 0 0; padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink);
  font-weight: 800; font-size: 1.05rem; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.c-billlink:active { background: var(--paper-2); }
.c-billlink__text { flex: 1; min-width: 0; }
.c-billlink__sub { display: block; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.c-billlink__chev { flex: 0 0 auto; color: var(--ink-2); font-size: 1.75rem; line-height: 1; }
.c-bill__summary .c-status__headline { margin-bottom: var(--s-1); }
.c-bill__intro { margin: 0 0 var(--s-3); color: var(--ink-2); }
.c-bill__totals { margin: 0; display: grid; gap: var(--s-1); }
.c-bill__row { display: flex; justify-content: space-between; gap: var(--s-2); font-variant-numeric: tabular-nums; }
.c-bill__row dt { color: var(--ink-2); font-weight: 600; }
.c-bill__row dd { margin: 0; font-weight: 700; white-space: nowrap; }
.c-bill__row--total { font-size: 1.25rem; padding-bottom: var(--s-1); border-bottom: 1px solid var(--line); }
.c-bill__row--total dt { color: var(--ink); font-weight: 800; }
.c-bill__row--due.is-due dd, .c-bill__row--due.is-due dt { color: var(--danger); font-weight: 800; }
.c-bill__hint { margin: var(--s-2) 0 var(--s-3); }
.c-bill__more { min-height: 52px; font-size: 1.05rem; border-radius: var(--r); }
.c-bill__orders h2 { font-size: 1.15rem; margin: var(--s-4) 0 0; }
.c-bill__list { list-style: none; margin: 0; padding: 0; }
.c-bill__order { margin: var(--s-3) 0; }
.c-bill__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: var(--s-1); }
.c-bill__ref { font-weight: 800; font-variant-numeric: tabular-nums; }
.c-bill__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-3) 0 0; }
.c-bill__foot strong { font-size: 1.1rem; white-space: nowrap; }
