/* ==========================================================================
   Public menu page
   ========================================================================== */

:root {
  --accent: #e8572a; /* replaced by the brand color from the admin settings */
  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-ring: color-mix(in srgb, var(--accent) 26%, transparent);

  --page: #ffffff;
  --backdrop: #f2efeb;
  --surface-2: #f6f4f1;
  --ink: #1d1a18;
  --ink-2: #4d4642;
  --muted: #847a73;
  --line: #ece7e1;
  --line-strong: #ddd5cc;

  --wa: #128c4b;
  --wa-strong: #0d7a3f;
  --danger: #c0262d;
  --hot: #c62828;
  --hot-soft: #fdecea;
  --veg: #2e7d32;
  --veg-soft: #e7f4e6;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgb(29 26 24 / 0.06);
  --shadow: 0 2px 6px rgb(29 26 24 / 0.05), 0 16px 36px -14px rgb(29 26 24 / 0.22);
  --shadow-lg: 0 30px 80px -20px rgb(29 26 24 / 0.45);

  --font: "Rubik", "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 16px;
  --navbar-h: 68px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --gutter: 28px; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--backdrop);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body:has(dialog[open]) { overflow: hidden; }

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Cover + intro ---------- */

.cover {
  position: relative;
  height: 210px;
  overflow: hidden;
  background:
    radial-gradient(90% 140% at 85% 0%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, transparent 60%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.22));
}

@media (min-width: 768px) {
  .cover { height: 300px; }
}

@media (min-width: 1200px) {
  .cover { height: 360px; }
}

.page {
  position: relative;
  min-height: 60vh;
  margin-top: calc(var(--radius-xl) * -1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--page);
}

.intro { padding: 26px 0 6px; }

.intro.has-logo { padding-top: 0; }

.intro__logo {
  width: 88px;
  height: 88px;
  margin-top: -44px;
  margin-bottom: 14px;
  border: 4px solid var(--page);
  border-radius: 50%;
  background: var(--page);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.intro__name {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.intro__tagline {
  max-width: 60ch;
  margin: 6px 0 0;
  color: var(--ink-2);
}

.intro__info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.875rem;
}

.intro__info li,
.intro__info a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.intro__info a { color: inherit; text-decoration: none; }
.intro__info a:hover { color: var(--accent-strong); }
.intro__info svg { width: 16px; height: 16px; flex: none; color: var(--muted); }

/* ---------- Sticky navbar: back + category pills ---------- */

.navbar-sentinel { height: 1px; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.navbar.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 24px -20px rgb(29 26 24 / 0.5);
}

.navbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--navbar-h);
}

.back-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  transition: background 0.15s, transform 0.15s var(--ease);
}

.back-btn:hover { background: var(--line); }
.back-btn:active { transform: scale(0.92); }
.back-btn svg { width: 20px; height: 20px; }
[dir="rtl"] .back-btn svg { transform: scaleX(-1); }
[data-view="home"] .back-btn { display: none; }

.pills {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  margin-inline-end: calc(var(--gutter) * -1);
  padding: 14px var(--gutter) 14px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.pills::-webkit-scrollbar { display: none; }

.pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--page);
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.pill:hover { background: var(--accent-soft); }

.pill.is-active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Search ---------- */

.main { padding-bottom: 40px; }

.search {
  position: relative;
  display: block;
  margin: 6px 0 22px;
}

.search svg {
  position: absolute;
  top: 50%;
  inset-inline-start: 16px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 48px;
  padding-block: 0;
  padding-inline: 46px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search input::placeholder { color: var(--muted); }

.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--page);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

@media (min-width: 900px) {
  .search { max-width: 420px; }
}

/* ---------- Category tiles (home) ---------- */

.tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2.4 / 1;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.18) 0%, rgb(0 0 0 / 0.42) 100%);
}

.tile--plain::after {
  background: radial-gradient(rgb(255 255 255 / 0.14) 1px, transparent 1px) 0 0 / 16px 16px;
}

.tile__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.tile__name {
  padding: 0 16px;
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.45);
}

@media (hover: hover) {
  .tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .tile:hover .tile__img { transform: scale(1.06); }
}

@media (min-width: 700px) {
  .tiles { gap: 18px; }
  .tile { aspect-ratio: 16 / 9; }
}

/* ---------- Views (set by app.js on <body data-view>) ---------- */

.js .cat-section { display: none; }
.js [data-view="category"] .cat-section.is-current,
.js [data-view="search"] .cat-section { display: block; }
.js [data-view="category"] .tiles,
.js [data-view="search"] .tiles { display: none; }

/* ---------- Dishes ---------- */

.cat-section { padding-bottom: 24px; }
.js [data-view="category"] .cat-section.is-current { animation: fade-up 0.35s var(--ease); }

.cat-section__head { margin: 6px 0 22px; }

.cat-section__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cat-section__desc {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dishes {
  display: grid;
  align-items: start;
  gap: 34px 22px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.dish {
  position: relative;
  border-radius: var(--radius-lg);
}

.dish:not(.has-img) {
  padding: 18px;
  background: var(--surface-2);
}

.dish__media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.dish__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

@media (hover: hover) {
  .dish:hover .dish__media img { transform: scale(1.04); }
}

.dish__badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgb(29 26 24 / 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dish__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dish__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

/* the whole card opens the dish details */
.dish__open {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: start;
}

.dish__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.dish__open:focus-visible { outline: none; }
.dish:has(.dish__open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }

.dish__sizes {
  flex: none;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dish__desc {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.dish__ingr {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.dish__ingr strong { color: var(--ink-2); font-weight: 500; }

.dish__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.dish__price {
  direction: ltr; /* keeps "10.00 – 14.00" in order on Arabic pages */
  unicode-bidi: isolate;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.dish__ctrl {
  position: relative;
  z-index: 2;
}

.is-soldout .dish__media img { filter: grayscale(1); opacity: 0.7; }
.is-soldout .dish__price { color: var(--muted); }

.soldout {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dish:not(.has-img) .tag:not(.tag--hot, .tag--veg, .tag--star) { background: var(--page); }
.tag--hot { background: var(--hot-soft); color: var(--hot); }
.tag--veg { background: var(--veg-soft); color: var(--veg); }
.tag--star { background: var(--accent-soft); color: var(--accent-strong); }

.empty-note {
  padding: 64px 16px;
  color: var(--muted);
  font-size: 1.0625rem;
  text-align: center;
}

/* ---------- Buttons: round +, stepper ---------- */

.round-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 85%, transparent);
  transition: background 0.15s, transform 0.15s var(--ease);
}

.round-btn:hover { background: var(--accent-strong); }
.round-btn:active { transform: scale(0.9); }
.round-btn svg { width: 22px; height: 22px; }

.round-btn__badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid var(--page);
  border-radius: 999px;
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 85%, transparent);
}

.stepper.pop,
.round-btn.pop { animation: pop 0.28s var(--ease); }

.stepper button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
  color: inherit;
  transition: background 0.15s, transform 0.15s var(--ease);
}

.stepper button:hover { background: rgb(255 255 255 / 0.3); }
.stepper button:active { transform: scale(0.88); }
.stepper button:disabled { opacity: 0.35; }
.stepper svg { width: 18px; height: 18px; }

.stepper__qty {
  min-width: 30px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stepper--soft {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.stepper--soft button {
  background: var(--page);
  box-shadow: var(--shadow-sm);
}

.stepper--soft button:hover { background: var(--page); color: var(--accent-strong); }

/* ---------- Floating cart bar ---------- */

.cart-bar {
  position: fixed;
  z-index: 30;
  inset-inline: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(560px, calc(100% - 2 * var(--gutter)));
  height: 62px;
  margin-inline: auto;
  padding-inline: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: rise 0.4s var(--ease);
  transition: background 0.15s;
}

.cart-bar:hover { background: #000; }

.cart-bar__count {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent);
  font-variant-numeric: tabular-nums;
}

.cart-bar.bump .cart-bar__count { animation: bump 0.35s var(--ease); }
.cart-bar__label { flex: 1; text-align: start; }
.cart-bar__total { font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 26px 0 120px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .container { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer strong { color: var(--ink-2); font-weight: 600; }

/* ---------- Dialogs (shared) ---------- */

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--page);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(20 16 14 / 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  transition: background 0.15s;
}

.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

/* Phone: sheets slide up from the bottom */
.dish-modal,
.drawer {
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto 0 0;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
}

.dish-modal[open],
.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.35s var(--ease);
}

/* ---------- Dish details ---------- */

.dish-modal__close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  background: rgb(255 255 255 / 0.92);
  box-shadow: var(--shadow);
}

.dish-modal__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dish-modal__media {
  aspect-ratio: 4 / 3;
  max-height: 46vh;
  width: 100%;
  background: var(--surface-2);
}

.dish-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-modal__body { padding: 22px 20px 8px; }

.dish-modal__media[hidden] + .dish-modal__body { padding-top: 64px; }

.dish-modal__name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
}

.dish-modal__desc {
  margin: 10px 0 0;
  color: var(--ink-2);
}

.sizes {
  margin: 20px 0 8px;
  padding: 0;
  border: 0;
}

.sizes legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.sizes__list { display: grid; gap: 8px; }

.size-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.size-opt:hover { border-color: var(--line-strong); }

.size-opt input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.size-opt__name { flex: 1; font-weight: 500; }
.size-opt__price { font-weight: 600; font-variant-numeric: tabular-nums; }

.size-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Extras groups */
.opt-group {
  margin: 22px 0 8px;
  padding: 0;
  border: 0;
  scroll-margin: 80px;
}

.opt-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
}

.opt-group__name { font-size: 0.95rem; font-weight: 600; }

.opt-group__rule {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.opt-group__rule.is-required { background: var(--accent-soft); color: var(--accent-strong); }
.opt-group__rule.is-done { background: #e5f4ea; color: var(--wa); }
.opt-group__rule.is-done::before { content: "✓"; font-weight: 700; }

.opt-list {
  display: grid;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.opt + .opt { border-top: 1px solid var(--line); }
.opt:hover { background: var(--surface-2); }
.opt:has(input:checked) { background: var(--accent-soft); }
.opt:has(input:disabled) { cursor: not-allowed; opacity: 0.45; }

.opt input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}

.opt__name { flex: 1; font-weight: 500; }
.opt__price { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.opt__price.is-free { color: var(--wa); font-weight: 500; }

.opt-group.has-error .opt-list { border-color: var(--danger); }
.opt-group.has-error .opt-group__rule { background: rgb(192 38 45 / 0.1); color: var(--danger); }

.opt-group__error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

.dish-modal__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.btn-accent {
  flex: 1;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 85%, transparent);
  transition: background 0.15s, transform 0.15s var(--ease);
}

.btn-accent:hover { background: var(--accent-strong); }
.btn-accent:active { transform: scale(0.98); }
.btn-accent:disabled { background: var(--line-strong); box-shadow: none; }

/* ---------- Order drawer ---------- */

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 10px;
}

.drawer__head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.drawer__body {
  flex: 1;
  padding: 0 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer__foot {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.cart-list { margin: 0; padding: 0; list-style: none; }

.cart-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row__thumb {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--surface-2);
  object-fit: cover;
}

.cart-row__thumb--empty {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
}

.cart-row__name { font-weight: 600; line-height: 1.3; }
.cart-row__size { color: var(--muted); font-weight: 400; }

.cart-row__extras {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}
.cart-row__unit { color: var(--muted); font-size: 0.8125rem; }

.cart-row__line {
  font-weight: 600;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.cart-row .stepper {
  height: 36px;
  padding: 3px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

.cart-row .stepper button {
  width: 30px;
  height: 30px;
  background: var(--page);
  box-shadow: var(--shadow-sm);
}

.cart-row .stepper button:hover { background: var(--page); }
.cart-row .stepper__qty { min-width: 26px; }

.cart-empty {
  padding: 36px 12px;
  color: var(--muted);
  text-align: center;
}

.order-form { display: grid; gap: 14px; margin-top: 24px; }
.order-form h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; }

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--page);
  font-size: 16px; /* stops iOS from zooming in */
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea { min-height: 76px; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.field [aria-invalid="true"] { border-color: var(--danger); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgb(192 38 45 / 0.16); }
[dir="rtl"] .field input[type="tel"] { direction: ltr; text-align: right; }

.field__error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

.field__error:empty { display: none; }

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-weight: 500;
}

.total-row strong {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  box-shadow: 0 12px 26px -12px rgb(18 140 75 / 0.8);
  transition: background 0.15s, transform 0.15s var(--ease), opacity 0.15s;
}

.btn-wa:hover { background: var(--wa-strong); }
.btn-wa:active { transform: scale(0.98); }
.btn-wa:disabled { opacity: 0.45; box-shadow: none; }
.btn-wa svg { width: 24px; height: 24px; }

/* ---------- Confirmation ---------- */

.modal {
  width: min(420px, calc(100% - 2 * var(--gutter)));
  margin: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal[open] { animation: pop-in 0.3s var(--ease); }

.done { padding: 34px 24px 24px; text-align: center; }

.done__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e5f4ea;
  color: var(--wa);
}

.done__icon svg { width: 34px; height: 34px; }
.done h2 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 600; }
.done p { margin: 0 0 24px; color: var(--ink-2); }
.done__actions { display: grid; gap: 10px; }

.btn-dark,
.btn-ghost {
  height: 50px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.btn-dark { border: 0; background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { border: 1px solid var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-2); }

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  .dish-modal {
    width: min(560px, calc(100% - 48px));
    max-height: min(88vh, 860px);
    margin: auto;
    border-radius: var(--radius-xl);
  }
  .dish-modal[open] { animation-name: pop-in; }
  .dish-modal__body { padding: 24px 28px 8px; }
  .dish-modal__foot { padding: 16px 28px 20px; }

  .drawer {
    width: 460px;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    margin-inline-start: auto;
    border-radius: 0;
  }
  .drawer[open] { animation-name: drawer-in; }
  [dir="rtl"] .drawer[open] { animation-name: drawer-in-rtl; }
  .drawer__head { padding: 26px 26px 10px; }
  .drawer__body { padding: 0 26px 24px; }
  .drawer__foot { padding: 18px 26px 22px; }
}

@media (min-width: 1100px) {
  .dishes { gap: 40px 28px; }
}

/* ---------- Animations ---------- */

@keyframes rise { from { transform: translateY(150%); } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes pop { from { transform: scale(0.8); opacity: 0.4; } }
@keyframes pop-in { from { transform: scale(0.95); opacity: 0; } }
@keyframes fade-up { from { transform: translateY(10px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-in-rtl { from { transform: translateX(-100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
