/* Akhdemny QR menu. Tokens are the app's (constants/colors.ts); dark mode keeps the same
   warmth instead of inverting it. Read on a cheap phone under shop light: big prices,
   high contrast, nothing that moves unless it has to. */
:root {
  --bg: #FBF6EE;        /* app `base` */
  --surface: #FFFFFF;
  --ink: #2E2117;       /* app `ink` — primary buttons */
  --on-ink: #FBF6EE;
  --text: #1A1A1A;
  --muted: #74665A;
  --line: #E8E0D5;      /* app `border` */
  --brand: #E85D2C;     /* saffron */
  --brand-deep: #C53A2B;/* chili */
  --brand-soft: #FDEBE0;
  --star: #E8A93C;
  --ok: #4A7C59;
  --skel: #EFE6DA;
  --shadow: 0 1px 2px rgba(46, 33, 23, .06), 0 6px 18px rgba(46, 33, 23, .07);
  --display: "Cairo", "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
  --body: "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
  --gutter: 16px;
  --bar: 108px;   /* button + the one-line note under it */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110D;
    --surface: #211913;
    --ink: #F4ECE1;
    --on-ink: #1F1611;
    --text: #F4ECE1;
    --muted: #B3A391;
    --line: #3A2E25;
    --brand: #F0763F;
    --brand-deep: #F08A6E;
    --brand-soft: #3A2419;
    --skel: #2A2019;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 640px; margin: 0 auto; padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom, 0px)); }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.banner {
  aspect-ratio: 16 / 7;
  background: var(--skel);
  overflow: hidden;
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: end;
  padding: 0 var(--gutter);
  margin-top: -34px;
  position: relative;
}
.logo {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--surface);
  object-fit: cover;
  box-shadow: var(--shadow);
}
.logo-fallback {
  display: grid; place-items: center;
  font: 800 30px/1 var(--display);
  color: var(--brand);
}
.name {
  margin: 0;
  font: 800 1.5rem/1.25 var(--display);
  text-wrap: balance;
  padding-bottom: 2px;
}
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 8px var(--gutter) 0;
  color: var(--muted);
  font-size: .9rem;
}
.meta .star { color: var(--star); }
.meta strong { color: var(--text); font-weight: 700; }
.pill-closed {
  display: inline-block;
  margin: 10px var(--gutter) 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: .85rem;
}

/* ── Section rail (sticky) ─────────────────────────────────────────── */
.rail {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 12px var(--gutter);
  margin-top: 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-weight: 400;
  font-size: .92rem;
  white-space: nowrap;
}
.rail a[aria-current="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ── Sections + items ──────────────────────────────────────────────── */
.section { padding: 0 var(--gutter); }   /* the jump offset is html's scroll-padding-top */
.section h2 {
  display: flex; align-items: baseline; gap: 8px;
  margin: 26px 0 6px;
  font: 800 1.2rem/1.3 var(--display);
}
.section h2 span { color: var(--muted); font: 400 .85rem var(--body); }

.item { border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 14px 0;
  list-style: none;
}
summary.row { cursor: pointer; }
summary.row::-webkit-details-marker { display: none; }
.thumb {
  width: 88px; height: 88px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--skel);
}
.thumb-fallback {
  display: grid; place-items: center;
  color: var(--muted);
  font: 800 1.6rem var(--display);
}
.info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.info h3 { margin: 0; font: 700 1.02rem/1.35 var(--body); }
.desc {
  margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
details[open] .desc { -webkit-line-clamp: unset; display: block; }
.price { font: 800 1.05rem/1.2 var(--display); color: var(--brand-deep); }
.more { color: var(--muted); font-size: .8rem; font-weight: 400; }
.more::after { content: " ▾"; }
details[open] .more::after { content: " ▴"; }

/* The signature: size prices printed as a column strip, like the menu board over the oven. */
.ladder {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(56px, auto);
  margin-top: 2px;
  border: 1.5px solid var(--brand);
  border-radius: 10px;
  overflow: hidden;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}
.ladder div { text-align: center; padding: 3px 8px 4px; }
.ladder div + div { border-inline-start: 1.5px solid var(--brand); }
.ladder small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; line-height: 1.3; }
.ladder b { display: block; font: 800 .98rem/1.2 var(--display); color: var(--brand-deep); white-space: nowrap; }

.out .thumb, .out .info h3, .out .price, .out .ladder { opacity: .45; }
.badge-out {
  align-self: start;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: var(--bg);   /* 5:1 on light, 7:1 on the dark theme's lighter chili */
  font-size: .78rem;
  font-weight: 700;
}

.opts { padding: 0 0 14px; margin-inline-start: 100px; display: grid; gap: 12px; }
.opts h4 { margin: 0 0 4px; font: 700 .92rem var(--body); }
.opts h4 span { color: var(--muted); font-weight: 400; font-size: .82rem; }
.opts ul { margin: 0; padding: 0; list-style: none; }
.opts li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .92rem;
}
.opts li:last-child { border-bottom: 0; }
.opts li b { font-family: var(--display); font-weight: 800; white-space: nowrap; color: var(--brand-deep); }

.foot { padding: 28px var(--gutter) 8px; color: var(--muted); font-size: .8rem; text-align: center; }

/* ── The one action ────────────────────────────────────────────────── */
.bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.bar-inner { max-width: 640px; margin: 0 auto; display: grid; gap: 4px; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
  text-decoration: none;
  font: 800 1.08rem var(--display);
}
.cta::before {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent);
}
.bar-note { margin: 0; text-align: center; font-size: .78rem; color: var(--muted); }
.bar-note a { font-weight: 700; }

/* ── States ─────────────────────────────────────────────────────────── */
.notice { padding: 48px var(--gutter) 16px; text-align: center; }
.notice h1 { font: 800 1.35rem/1.35 var(--display); margin: 0 0 8px; text-wrap: balance; }
.notice p { color: var(--muted); margin: 0 0 18px; }
.retry {
  font: 700 1rem var(--body);
  padding: 10px 22px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.skel > div { background: var(--skel); border-radius: 10px; }
.skel-banner { aspect-ratio: 16 / 7; border-radius: 0 !important; }
.skel-line { height: 18px; margin: 14px var(--gutter) 0; }
.skel-line.w60 { width: 60%; height: 24px; margin-top: 18px; }
.skel-line.w40 { width: 40%; }
.skel-row { height: 88px; margin: 18px var(--gutter) 0; }
@media (prefers-reduced-motion: no-preference) {
  .skel > div { animation: pulse 1.2s ease-in-out infinite alternate; }
  @keyframes pulse { to { opacity: .55; } }
  html { scroll-behavior: smooth; }
}

@media (min-width: 560px) {
  .name { font-size: 1.8rem; }
  .banner { border-radius: 0 0 18px 18px; }
}
