/* Al Naseej — new menu page. Phone first: app-like bottom bar and a bottom-sheet cart.
   From 1024px the cart becomes a side panel next to a wider grid. Always the warm light theme,
   which shows the food photos best. */

/* Brand guide (docs/brand/brand-guide.pdf): teal #2DB39F, brown #764633, dark brown #411A0E; the logo font Amin for titles. */
@font-face {
  font-family: 'Amin';
  src: url('../fonts/brand/Amin-Font-Bold.otf') format('opentype');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --teal: #2db39f;
  --teal-d: #1b7d6f;
  --teal-l: #e2f4f1;
  --coffee: #411a0e;
  --coffee-2: #764633;
  --cream: #fbf7f2;
  --sand: #f3ebe2;
  --paper: #fff;
  --ink: #1d1512;
  --muted: #7a6a61;
  --line: #eadfd4;
  --danger: #b3261e;
  --radius: 20px;
  --tabbar: 64px;
  --display: 'Amin', 'Reem Kufi', 'Cairo', sans-serif;
  --heading: var(--coffee);  --photo-bg: radial-gradient(circle at 50% 40%, #fff 0, var(--sand) 75%);
  --shadow: 0 4px 14px rgba(65, 26, 14, .07);
  color-scheme: light;
}

/* English pages: Amin is Arabic-only, and Reem Kufi's Latin letters crowd together, so the
   display slots (titles, headings, slogans) use Cairo's heavy weights for Latin text. */
:root[lang='en'] { --display: 'Cairo', sans-serif; }

/* Dark: roasted-coffee surfaces, the same teal, cream text. Chosen with the moon button or by the device. */
:root[data-theme="dark"] {
  /* The old menu page dark palette, which the owner prefers: deep roasted brown with teal. */
  --teal-d: #2db39f;
  --teal-l: #12302b;
  --cream: #170d09;
  --sand: #22140e;
  --paper: #1f130d;
  --ink: #f4ece6;
  --muted: #b8a89e;
  --line: #3a2619;
  --danger: #ff8a80;
  --heading: #f4ece6;
  --photo-bg: radial-gradient(circle at 50% 40%, #2a1a12 0, #1f130d 75%);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* The title area stays plain (the owner found the weave behind it busy). */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle { border-color: rgba(244, 236, 230, .32); background: rgba(244, 236, 230, .08); } /* night: the circle stands out from the dark bar */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: 'Cairo', system-ui, sans-serif; color: var(--ink); background: var(--cream);
  line-height: 1.6; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--paper);
  position: sticky; top: 0; z-index: 30;
}
.top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-brand img { height: 46px; width: auto; }
.top-brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.top-brand strong { font-family: var(--display); font-size: 1.1rem; color: var(--heading); }
.top-brand small { font-size: .75rem; color: var(--teal-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: none; }
.top-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.open-pill { font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--muted); white-space: nowrap; }
.open-pill.is-open { background: var(--teal-l); color: var(--teal-d); }
.open-pill::before { content: '●'; margin-inline-end: 4px; }
.lang { font-weight: 800; color: var(--teal-d); padding: 6px 8px; }

/* The Sadu weave under the header: the same line as the menu's category headings (owner, 2026-11-11). */
.weave {
  height: 8px; opacity: .55;
  background:
    linear-gradient(135deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    linear-gradient(225deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    var(--coffee-2);
}
/* No weave between the header and the «القائمة» title (owner, 2026-11-15). */
.menu-page .weave { display: none; }

/* ---------- intro ---------- */
.intro { padding: 18px 16px 6px; }
.intro h1 { font-family: var(--display); color: var(--heading); font-size: 2rem; margin: 0; line-height: 1.2; }
.intro p { margin: 2px 0 10px; color: var(--muted); }
.notice { background: var(--sand); padding: 8px 12px; border-radius: 12px; font-weight: 700; color: var(--heading); }
.notice.teal { background: var(--teal-l); color: var(--teal-d); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 12px; height: 48px;
}
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; background: transparent; font: inherit; width: 100%; height: 100%; color: var(--ink); }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
.reorder {
  margin-top: 10px; width: 100%; border: 2px dashed var(--teal); background: var(--teal-l); color: var(--teal-d);
  border-radius: 14px; padding: 10px; font-weight: 800; cursor: pointer;
}

/* ---------- categories (sticky, highlights the one in view) ---------- */
.cats {
  position: sticky; top: 66px; z-index: 20; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px; background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(8px);
}
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: none; padding: 7px 16px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-weight: 700; color: var(--heading); font-size: .95rem; white-space: nowrap; transition: background .2s, color .2s;
}
.cats a.active { background: var(--coffee); color: #fff; border-color: var(--coffee); }
/* A tap gives a short press instead of the phone's blue flash (owner, 2026-11-13); the keyboard still gets a ring. */
.cats a { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; transition: background .2s, color .2s, transform .12s; }
.cats a:active { transform: scale(.94); }
.cats a:focus { outline: none; }
.cats a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- product grid ---------- */
.cat-section { padding: 6px 16px 14px; }
.cat-section h2 { display: flex; align-items: center; gap: 10px; font-family: var(--display); color: var(--heading); font-size: 1.35rem; margin: 10px 0 12px; }
.cat-section h2::after {
  content: ''; flex: 1; height: 8px; border-radius: 4px; opacity: .55;
  background:
    linear-gradient(135deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    linear-gradient(225deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    var(--coffee-2);
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative; background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  /* The teal line under each card, as on the home page's favourites (owner, 2026-11-10). */
  border-bottom: 4px solid var(--teal);
}
.card-open {
  display: flex; flex-direction: column; width: 100%; border: 0; background: none; padding: 0; text-align: start; cursor: pointer;
}
.card-photo {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%;
  background: var(--photo-bg);
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-photo img { transform: scale(1.04); }
.bean {
  width: 44%; aspect-ratio: 3 / 4; border-radius: 50%; transform: rotate(-20deg); opacity: .8;
  background: linear-gradient(90deg, var(--teal) 0 47%, transparent 47% 53%, var(--coffee) 53%);
}
.card-name { padding: 8px 12px 0; font-weight: 800; font-size: .98rem; line-height: 1.35; min-height: 2.7em; }
.card-price { padding: 2px 12px 12px; padding-inline-end: 56px; color: var(--teal-d); font-weight: 900; }
.card-price small { color: var(--muted); font-weight: 600; margin-inline-end: 3px; }
.card-add {
  position: absolute; inset-inline-end: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--teal); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--teal) 45%, transparent); transition: transform .15s;
}
.card-add:active { transform: scale(.9); }
.card-add.done { background: var(--coffee); }
.card.sold-out .card-photo img { filter: grayscale(1); opacity: .5; }
.card.sold-out .card-open { cursor: not-allowed; }
.card.sold-out { border-bottom-color: var(--muted); }
.sold-tag {
  position: absolute; top: 10px; inset-inline-start: 10px; background: var(--danger); color: #fff;
  font-size: .8rem; font-weight: 800; padding: 2px 10px; border-radius: 999px;
}
.qty-tag {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; background: var(--coffee); color: #fff;
  font-size: .82rem; font-weight: 900; padding: 2px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.empty-search { text-align: center; color: var(--muted); padding: 30px 16px; }
.vat { text-align: center; color: var(--muted); font-size: .85rem; padding: 4px 16px 24px; }

/* ---------- cart: bottom sheet on phones ---------- */
.cart {
  position: fixed; z-index: 60; inset-inline: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px rgba(23, 10, 5, .25);
  transform: translateY(105%); transition: transform .28s ease;
}
.cart.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(23, 10, 5, .45); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.cart-head h2 { margin: 0; font-family: var(--display); color: var(--heading); }
.x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sand); color: var(--ink, inherit); cursor: pointer; font-size: 1rem; }
.cart-scroll { overflow-y: auto; padding: 0 18px 12px; flex: 1; }
.cart-empty { color: var(--muted); text-align: center; padding: 24px 0; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.lines .thumb { width: 52px; height: 52px; border-radius: 12px; background: var(--sand); object-fit: cover; }
.lines .txt strong { display: block; line-height: 1.3; }
.lines .txt small { color: var(--muted); display: block; line-height: 1.3; }
.lines .txt .price { color: var(--teal-d); font-weight: 800; font-size: .9rem; }
.stepper { display: inline-flex; align-items: center; background: var(--sand); border-radius: 999px; }
.stepper button { width: 34px; height: 34px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; }
.stepper output { min-width: 22px; text-align: center; font-weight: 800; }
.checkout { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; }
.sum strong { font-size: 1.4rem; color: var(--heading); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--sand); padding: 5px; border-radius: 16px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 4px; border-radius: 12px; font-weight: 800; font-size: .9rem; }
.seg input:checked + span { background: var(--paper); color: var(--heading); box-shadow: 0 2px 8px rgba(65, 26, 14, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--teal); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-weight: 700; font-size: .92rem; }
.field small { color: var(--muted); }
.field input, .field textarea {
  font: inherit; border: 1px solid var(--line); background: var(--cream); border-radius: 12px; padding: 10px 12px; min-height: 48px; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--teal); border-color: transparent; }
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.error { color: var(--danger); font-weight: 800; font-size: .95rem; margin: 0; white-space: pre-line; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.cart-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.btn-main {
  width: 100%; min-height: 56px; border: 0; border-radius: 16px; background: var(--teal); color: #fff;
  font-weight: 900; font-size: 1.1rem; cursor: pointer;
}
.btn-main:disabled { opacity: .55; }

/* Floating cart summary above the tab bar */
.cart-float {
  position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; border-radius: 18px;
  background: var(--coffee); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(23, 10, 5, .35);
}
/* Back-to-top arrow: appears once the page is scrolled well down, floats above the tab bar. */
.to-top {
  position: fixed; z-index: 46; inset-inline-end: 14px;
  bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom));
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: var(--teal);
  box-shadow: 0 8px 18px rgba(23, 10, 5, .3);
}
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cart-float > span:nth-child(2) { flex: 1; text-align: start; }
.cart-float .count { background: var(--teal); border-radius: 10px; padding: 3px 10px; font-size: .88rem; }
.cart-float.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.04); } }

/* App-style bottom bar */
.tabbar {
  position: fixed; z-index: 45; inset-inline: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: var(--muted); font-size: .78rem; font-weight: 700; cursor: pointer;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar .active { color: var(--teal-d); }
.tabbar .disabled { opacity: .45; pointer-events: none; }
.tabbar .dot {
  position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: .72rem; display: grid; place-items: center; padding: 0 5px;
}

/* ---------- product sheet ---------- */
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; margin: auto auto 0;
  border-radius: 26px 26px 0 0; background: var(--paper); color: var(--ink); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
dialog.sheet::backdrop { background: rgba(23, 10, 5, .5); }
#sheet-form { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-photo { position: relative; background: var(--photo-bg); height: 240px; flex: none; display: grid; place-items: center; }
.sheet-photo img { height: 100%; width: 100%; object-fit: cover; }
.sheet-photo .bean { width: 90px; }
/* On the photo the button is always light, so the ✕ is always dark – in dark mode it used to inherit the light text and vanish. */
.sheet-photo .x { position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(255, 255, 255, .92); color: #1d1512; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.sheet-body { overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.sheet-body h2 { margin: 0; font-family: var(--display); color: var(--heading); font-size: 1.6rem; line-height: 1.25; }
.sheet-body .desc { color: var(--muted); margin: -8px 0 0; }
.group h3 { margin: 0 0 8px; font-size: 1rem; }
.group h3 small { color: var(--muted); font-weight: 600; margin-inline-start: 6px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.sizes button, .opts button {
  border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 10px; cursor: pointer; font-weight: 700;
}
.sizes button { display: flex; flex-direction: column; align-items: center; }
.sizes button small { color: var(--teal-d); font-weight: 800; }
.sizes button.on, .opts button.on { border-color: var(--teal); background: var(--teal-l); color: var(--teal-d); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.sheet-foot { display: flex; gap: 12px; align-items: center; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.sheet-foot .stepper button { width: 44px; height: 44px; }
.sheet-foot .btn-main { flex: 1; }

.toast {
  position: fixed; z-index: 80; inset-inline: 0; top: 80px; margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  background: var(--coffee); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 800;
  box-shadow: 0 10px 24px rgba(23, 10, 5, .3); animation: up .2s ease;
}

/* ---------- tablets ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .intro, .cat-section { padding-inline: 24px; }
  .cats { padding-inline: 24px; }
  dialog.sheet { margin: auto; border-radius: 26px; }
}

/* ---------- wide screens: top navigation, side cart, no bottom bar ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .top { padding: 12px 32px; }
  .top-nav { display: flex; gap: 4px; margin-inline-start: 24px; }
  .top-nav a { padding: 8px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); }
  .top-nav a:hover { background: var(--sand); color: var(--ink); }
  .top-nav a.active { background: var(--coffee); color: #fff; }
  /* The nav shows the «تواصل معنا» link on wide screens, so the header's contact bubble goes. */
  #contact-open { display: none; }
  /* The cart is a fixed side panel here, so its close button goes; the item sheet keeps its ✕. */
  .tabbar, .cart-float, .scrim, #cart-close { display: none !important; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
  .intro { padding: 24px 0 8px; display: grid; grid-template-columns: 1fr minmax(280px, 380px); align-items: end; gap: 8px 24px; }
  .intro h1, .intro p, .intro .notice { grid-column: 1; }
  .intro .search { grid-column: 2; grid-row: 1 / span 2; }
  .cats { top: 70px; padding: 12px 0; }
  .cat-section { padding: 6px 0 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
  .cart {
    position: sticky; top: 86px; inset: auto; transform: none; max-height: calc(100vh - 106px); margin-top: 24px;
    border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(65, 26, 14, .08);
  }
  dialog.sheet { max-width: 720px; }
  dialog.sheet[open] { flex-direction: row; }
  #sheet-form { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .sheet-photo { width: 42%; height: auto; min-height: 380px; }
  .sheet-body { width: 58%; max-height: 70vh; }
  .sheet-foot { width: 100%; }
}

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

/* ---------- sizes on the card: "S 0.800 · M 1.000" ---------- */
.card-sizes { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px; padding-inline-end: 56px; }
/* Room inside the pill's frame (owner: the frame sat too tight on the size and the price). */
.card-sizes .size {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .86rem; color: var(--teal-d);
  background: var(--teal-l); border-radius: 10px; padding-block: 4px; padding-inline: 4px 10px; white-space: nowrap;
}
.card-sizes .size b {
  display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px;
  background: var(--teal); color: #fff; font-size: .75rem;
}
/* Dark mode mirrors the light pill's three tones (soft tint, clear price, solid badge) – the flat #12302b looked murky on the brown card. */
:root[data-theme="dark"] .card-sizes .size { background: rgba(45, 179, 159, .14); box-shadow: inset 0 0 0 1px rgba(45, 179, 159, .35); color: #a6eee2; }
:root[data-theme="dark"] .card-sizes .size b { background: var(--teal); color: #10251f; }
/* Sizes in the product sheet: the letter in a circle, then the name and price. */
.sizes .code {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; margin-bottom: 2px;
  background: var(--sand); color: var(--heading); font-weight: 900;
}
.sizes button.on .code { background: var(--teal); color: #fff; }
/* Size in the cart line */
.lines .size-tag { display: inline-block; background: var(--teal); color: #fff; border-radius: 6px; font-size: .72rem; font-weight: 800; padding: 0 6px; margin-inline-start: 4px; vertical-align: middle; }

/* ---------- cart: a clear delete button per line ---------- */
.lines li { grid-template-columns: 52px 1fr auto auto; }
.line-del {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--danger); cursor: pointer;
  display: grid; place-items: center;
}
.line-del svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.line-del:hover { background: var(--sand); }
.clear-cart { display: block; margin: 10px auto 0; border: 0; background: none; color: var(--danger); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---------- dark tweaks ---------- */
:root[data-theme="dark"] .cats a.active { background: var(--teal); border-color: var(--teal); color: #08251f; }
:root[data-theme="dark"] .top-nav a.active { background: var(--teal); color: #08251f; }
:root[data-theme="dark"] .cart-float, :root[data-theme="dark"] .toast { background: var(--teal); color: #06231e; border: 0; }
:root[data-theme="dark"] .cart-float .count { background: #06231e; color: #fff; }
:root[data-theme="dark"] .card-add.done { background: #3a3632; }
:root[data-theme="dark"] .open-pill { background: var(--sand); }
/* Night: the checked segment was paper-on-sand, both near-black, so the chosen pickup/payment method vanished (owner). Teal fill like the other active states. */
:root[data-theme="dark"] .seg { box-shadow: inset 0 0 0 1px var(--line); } /* night: the track edges against the near-identical cart panel */
:root[data-theme="dark"] .seg span { color: var(--muted); }
:root[data-theme="dark"] .seg input:checked + span { background: var(--teal); color: #08251f; box-shadow: none; }
:root[data-theme="dark"] .card.sold-out .card-photo img { opacity: .35; }

.lines li.clear-row { display: block; border: 0; padding: 0; }

/* Room under the last row: the tab bar, plus the floating cart bar when it shows. */
.content { padding-bottom: 16px; }
body.has-float { padding-bottom: calc(var(--tabbar) + 86px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { body.has-float { padding-bottom: 0; } }

/* Photos never grow past their frame (a tall photo used to cover the sizes in the product sheet). */
.card-photo, .sheet-photo { overflow: hidden; }
.card-photo img, .sheet-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet-photo { height: min(240px, 32vh); }
.sheet-body { flex: 1 1 auto; min-height: 0; }
@media (min-width: 1024px) { .sheet-photo { height: auto; } }

/* As on the old menu page: the line under the title in bold teal. */
:root[data-theme="dark"] .intro > p:not(.notice) { color: var(--teal); font-weight: 700; }

/* A tighter title area so the items come sooner. */
.intro { padding-top: 14px; }
.intro h1 { font-size: 1.7rem; }
.intro > p:not(.notice) { margin-bottom: 12px; }

/* Night: the category heading's sadu line kept its day brown and faded into the dark page (owner, 2026-11-11). */
:root[data-theme="dark"] .cat-section h2::after {
  opacity: 1;
  background:
    linear-gradient(135deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    linear-gradient(225deg, var(--teal) 25%, transparent 25%) -4px 0 / 8px 8px,
    #411a0e;
}

/* The weave keeps its day look at night too (owner, 2026-11-15): the teal-over-coffee-2
   Sadu line is the brand's constant, in both themes. */


/* Product sheet: the whole photo, never cropped (owner, 2026-11-11). The photos are portrait, so a
   blurred copy fills the sides of the frame. */
.sheet-photo { height: min(320px, 40vh); }
.sheet-photo img { object-fit: contain; }
.sheet-photo img.bg { object-fit: cover; filter: blur(18px) brightness(.85); transform: scale(1.2); }

/* ---------- offers on the menu (2026-11-11) ---------- */
.offer-tag {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; max-width: calc(100% - 20px);
  background: var(--teal); color: #fff; font-weight: 900; font-size: .78rem; line-height: 1.3;
  padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
/* A new item the owner flagged (2026-11-14): the same corner tag in the brand's coffee colour. */
.new-tag {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2;
  background: var(--coffee); color: #f6ece5; font-weight: 900; font-size: .78rem; line-height: 1.3;
  padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.card .offer-ends { display: block; padding: 0 12px; font-size: .78rem; font-weight: 800; color: #9a3412; }
:root[data-theme="dark"] .card .offer-ends { color: #fdba74; }
.card-price s, .lines .price s, .sizes small s { color: var(--muted); font-weight: 600; font-size: .85em; margin-inline-start: 4px; }
.card.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px var(--teal); } }
.saved { margin: -6px 0 6px; color: var(--teal-d); font-weight: 800; text-align: end; }
.gift-tag { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 800; }
:root[data-theme="dark"] .gift-tag { background: rgba(251, 191, 36, .16); color: #fcd34d; }
.lines li.is-gift { background: rgba(45, 179, 159, .07); border-radius: 14px; }
.gift-row {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px;
  background: #fef3c7; color: #78350f; font-weight: 700;
}
:root[data-theme="dark"] .gift-row { background: rgba(251, 191, 36, .14); color: #fde68a; }
.btn-gift { align-self: flex-start; border: 0; border-radius: 999px; padding: 8px 16px; background: var(--teal); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.combo-slot { border: 1px solid var(--line); border-radius: 16px; padding: 4px 12px 10px; }
.gift-head { display: flex; align-items: center; justify-content: space-between; }
.gift-head .x { display: inline-grid !important; place-items: center; }
.gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gift-grid button {
  display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 800;
}
.gift-grid img, .gift-grid .bean { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--photo-bg); }
/* Item sheet options: they took the browser's light button colours at night (owner, 2026-11-11). */
.sizes button, .opts button { color: var(--ink); font-family: inherit; }
:root[data-theme="dark"] .sizes button, :root[data-theme="dark"] .opts button { background: #24160f; border-color: #4a3020; color: var(--ink); }
:root[data-theme="dark"] .sizes button.on, :root[data-theme="dark"] .opts button.on { background: rgba(45, 179, 159, .16); border-color: var(--teal); color: #a6eee2; }
:root[data-theme="dark"] .sizes button small s, :root[data-theme="dark"] .card-price s { color: #9c8a80; }
:root[data-theme="dark"] .combo-slot { border-color: #4a3020; }

/* Sizes on offer: today's price and the old one struck through, as in the item sheet (owner, 2026-11-11). */
.card-sizes .size s { color: var(--muted); font-weight: 600; font-size: .8em; }
:root[data-theme="dark"] .card-sizes .size s { color: #9c8a80; }

/* The red corner ribbon on offer cards (model ب, owner 2026-11-11; public/mockups/offer-ribbons.html).
   A band across the top corner from the top edge to the side edge, both ends cut by the card, so it
   wraps the corner: top right in Arabic, top left in English. */
.has-ribbon { position: relative; overflow: hidden; }
.ribbon {
  position: absolute; z-index: 3; width: 150px; height: 24px; top: 20px; inset-inline-start: -43px;
  display: grid; place-items: center; transform: rotate(-45deg); pointer-events: none;
  background: linear-gradient(#e0483d, #c0352b); color: #fff;
  font-weight: 900; font-size: .74rem; line-height: 1; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
[dir="rtl"] .ribbon { transform: rotate(45deg); }
/* New items (2026-11-14): the same corner strip in the brand's teal, so «جديد» reads apart from the red offers. */
.ribbon-new { background: linear-gradient(#35c4ae, #229e8b); }
/* Night: the category heading line looks exactly as by day (owner, 2026-11-11) – the day line's
   colours as they show at 55% on the cream page, drawn solid so the dark page does not dim them. */
:root[data-theme="dark"] .cat-section h2::after {
  opacity: 1;
  background:
    linear-gradient(135deg, #8ad2c4 25%, transparent 25%) -4px 0 / 8px 8px,
    linear-gradient(225deg, #8ad2c4 25%, transparent 25%) -4px 0 / 8px 8px,
    #b2968a;
}

/* Item sheet, model أ (owner, 2026-11-11; public/mockups/item-sheet.html): the whole photo as a framed
   print – centred, rounded, with a thin frame and a soft shadow – on a soft band, without the blurred copy.
   Only below 1024px, where the wide, short frame left the photo narrow; wide screens keep the tall photo
   panel beside the details (it fitted well there). */
@media (max-width: 1023px) {
  .sheet-photo { height: auto; display: grid; place-items: center; padding: 18px 16px 8px; background: var(--photo-bg); }
  .sheet-photo img.bg { display: none; }
  .sheet-photo img:not(.bg) {
    position: static; width: auto; max-width: 100%; height: min(290px, 36vh); object-fit: contain;
    border-radius: 18px; border: 5px solid var(--paper); box-shadow: 0 10px 24px rgba(65, 26, 14, .25);
  }
  :root[data-theme="dark"] .sheet-photo img:not(.bg) { box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
  .sheet-photo .bean { width: 90px; height: 120px; }
}

/* Night item sheet, like the day one (owner, 2026-11-11): a band behind the photo that stands apart
   from the sheet (a warm lighter brown), and a visible frame around the photo. */
@media (max-width: 1023px) {
  :root[data-theme="dark"] .sheet-photo { background: radial-gradient(circle at 50% 40%, #5a3a28 0, #3a2418 70%, #2c1b12 100%); }
  :root[data-theme="dark"] .sheet-photo img:not(.bg) { border-color: #6b4a36; }
}

/* Coupon in the cart */
.coupon-off { margin: -6px 0 6px; color: var(--teal-d); font-weight: 800; text-align: end; }
.coupon-open { align-self: flex-start; border: 0; background: none; padding: 4px 0; color: var(--teal-d); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1; min-width: 0; font: inherit; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  border: 1px dashed var(--teal); background: var(--cream); border-radius: 12px; padding: 10px 12px; min-height: 48px; color: var(--ink);
}
.coupon-row input:focus { outline: 2px solid var(--teal); border-color: transparent; }
.coupon-apply { flex: 0 0 auto; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--heading); color: var(--paper); font: inherit; font-weight: 800; cursor: pointer; }
.coupon-msg { margin: 6px 0 0; color: var(--teal-d); font-weight: 700; font-size: .9rem; }
.coupon-msg.bad { color: var(--danger); }

/* Item options: each group a card of rows – radio or check box, the name, the price at the end. */
.mod-group { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); }
.mod-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--sand); }
.mod-head h3 { margin: 0; font-size: 1rem; color: var(--heading); }
.mod-rule { flex: none; font-size: .76rem; font-weight: 800; color: var(--muted); background: var(--paper); padding: 2px 10px; border-radius: 999px; }
.mod-rule.req { color: var(--teal-d); background: var(--teal-l); }
.mods { display: flex; flex-direction: column; }
.mod {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px;
  border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: start; cursor: pointer;
}
.mods .mod:first-child { border-top: 0; }
.mod:hover:not(:disabled) { background: rgba(45, 179, 159, .05); }
.mod.on { background: rgba(45, 179, 159, .08); }
.tick {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #cbbcae; background: var(--paper); transition: background .15s, border-color .15s;
}
.many .tick { border-radius: 7px; }
.mod.on .tick { border-color: var(--teal); background: var(--teal); }
.one .mod.on .tick::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.many .mod.on .tick::after { content: ''; width: 10px; height: 5px; margin-top: -3px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.mod-name { flex: 1; font-weight: 700; line-height: 1.35; }
.mod.on .mod-name { font-weight: 800; color: var(--heading); }
.mod-price { flex: none; font-weight: 800; font-size: .9rem; color: var(--teal-d); white-space: nowrap; }
.mod-price.out { color: var(--muted); font-weight: 700; }
.mods.full .mod:not(.on) { opacity: .5; }
.mod:disabled { cursor: not-allowed; opacity: .5; }
.mod:disabled .mod-name { text-decoration: line-through; }
:root[data-theme="dark"] .mod-group { background: #24160f; border-color: #4a3020; }
:root[data-theme="dark"] .mod-head { background: #4a2f20; border-bottom: 1px solid #5e3d2a; } /* night: the group title band stands out like the sand band by day */
:root[data-theme="dark"] .mod-rule { background: rgba(255, 255, 255, .07); }
:root[data-theme="dark"] .mod-rule.req { background: rgba(45, 179, 159, .16); color: #a6eee2; }
:root[data-theme="dark"] .mod-head .mod-rule:not(.req) { background: rgba(0, 0, 0, .25); color: #e6d6ca; }
:root[data-theme="dark"] .mod { border-top-color: #3a2619; }
:root[data-theme="dark"] .mod.on { background: rgba(45, 179, 159, .12); }
:root[data-theme="dark"] .tick { border-color: #6b4a38; background: transparent; }
:root[data-theme="dark"] .mod.on .tick { border-color: var(--teal); background: var(--teal); }
:root[data-theme="dark"] .mod-price { color: #5fd6c4; }

/* Item sheet on phones (2026-11-12, after Cortado): once the options are scrolled the photo folds away
   and a slim bar keeps the item's name and ✕ at the top. */
.sheet-mini { display: none; }
@media (max-width: 1023px) {
  #sheet-form { position: relative; }
  .sheet-body > .sheet-photo { margin: -16px -18px 0; flex-shrink: 0; }
  #sheet-form.mini .sheet-mini {
    position: absolute; inset: 0 0 auto; z-index: 5; border-radius: 26px 26px 0 0;
    display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 18px;
    border-bottom: 1px solid var(--line); background: var(--paper);
  }
  .sheet-mini b { flex: 1; font-size: 1.05rem; font-weight: 900; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-mini .x { display: inline-grid; place-items: center; flex: none; }
}
/* The option cards (overflow: hidden) were squeezed to nothing inside the flex column of the sheet: never shrink them. */
.sheet-body > * { flex-shrink: 0; }

/* Item sheet, all cards (owner, 2026-11-12; public/mockups/size-notes-cards.html): the size and the
   item's notes are cards like the option groups. */
label.mod-group { display: block; }
label.mod-group .mod-head { display: flex; }
.mod-notes { display: block; padding: 12px 14px; }
.mod-notes textarea { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.5; min-height: 76px; resize: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--sand); color: var(--ink); }
.mod-price s { color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
:root[data-theme="dark"] .mod-notes textarea { background: #2e1d14; border-color: #4a3020; }
.mod-notes textarea:focus { outline: 2px solid var(--teal); border-color: transparent; }
.sheet-foot .btn-main { white-space: nowrap; padding-inline: 14px; }
/* Checkout: an empty required field turns red with a plain message under it (2026-11-12). */
.field.bad input, .field.bad textarea { border-color: var(--danger); outline: 1px solid var(--danger); }
.field .field-err { color: var(--danger); font-weight: 800; font-size: .88rem; }
:root[data-theme="dark"] .field .field-err { color: #ff8a80; }
:root[data-theme="dark"] .field.bad input { border-color: #ff8a80; outline-color: #ff8a80; }
/* Phones (2026-11-12): the top bar was crowded – the logo already carries the name, so the name text
   goes; the round buttons are a touch smaller and closer. */
@media (max-width: 520px) {
  .top { gap: 8px; padding-inline: 12px; }
  .top-brand > span { display: none; }
  .top-end { gap: 6px; }
  .top-end .theme-toggle { width: 36px; height: 36px; }
  .top-end .lang { padding-inline: 4px; }
}

/* ---------- payment simulator: the fake hosted page's method picker ---------- */
.sim-title { font-weight: 800; color: var(--heading); margin: 10px 0 2px; }
.sim-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.sim-method { cursor: pointer; }
.sim-method input { position: absolute; opacity: 0; pointer-events: none; }
.sim-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px 14px; border-radius: 16px; text-align: center; min-height: 128px; justify-content: center;
  background: var(--cream); border: 2px solid var(--line); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sim-badge {
  width: 54px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 900; font-size: .82rem; color: #fff;
}
.sim-badge.card { background: linear-gradient(135deg, #16355f 0%, #2db39f 100%); font-size: 1.25rem; }
.sim-badge.benefit { background: #e4002b; }
.sim-name { font-weight: 800; color: var(--heading); font-size: .98rem; }
.sim-hint { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.sim-method input:checked + .sim-card {
  border-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, var(--paper));
  box-shadow: 0 4px 14px rgba(45, 179, 159, .18);
}
.sim-method input:checked + .sim-card::after {
  content: '✓'; position: absolute; top: -9px; inset-inline-end: -9px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--teal); color: #08251f; font-weight: 900;
  display: grid; place-items: center; font-size: .8rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.sim-method input:focus-visible + .sim-card { outline: 2px solid var(--teal); }
.sim-fail-btn {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; text-decoration: underline; padding: 8px;
}
.sim-fail-btn:hover { color: var(--danger); }
@media (max-width: 420px) { .sim-methods { grid-template-columns: 1fr; } .sim-card { min-height: 0; flex-direction: row; text-align: start; padding: 14px; } .sim-card .sim-hint { display: none; } }
