/* جوار design system — bright, warm-neutral, themeable per restaurant.
   Type: Thmanyah Sans (UI/body) + Thmanyah Serif Display (headings).
   Brand accent is the single CSS variable `--accent`; the neutral base stays
   constant so every restaurant feels at home while the app stays one brand. */

/* ---- Fonts (self-hosted woff2) ---- */
@font-face {
  font-family: "Thmanyah Sans";
  src: url("/static/fonts/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("/static/fonts/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("/static/fonts/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("/static/fonts/thmanyahsans-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif";
  src: url("/static/fonts/thmanyahserifdisplay-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif";
  src: url("/static/fonts/thmanyahserifdisplay-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* Accent is themeable per restaurant; default = warm, appetising terracotta. */
  --accent: #ec5f33;
  --accent-press: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --accent-fg: #ffffff;

  /* جوار platform identity — the SECOND brand colour, from the logo (green).
     Unlike --accent this is FIXED: it is not re-themed per restaurant, so the
     masthead and platform chrome always read as جوار. */
  --brand: #0b7d48;
  --brand-press: #0a6b3e;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #ffffff);

  --bg: #f6f4f1;          /* warm off-white page */
  --surface: #ffffff;     /* cards */
  --surface-2: #f3f1ed;   /* sunken inputs / subtle fills */
  --fg: #20242c;          /* near-black, slightly warm */
  --muted: #5f636b;      /* ≥4.5:1 on both --bg and --surface (6.0 / 5.5) */
  --line: #e7e3dd;        /* hairline borders */

  --ok: #1f9d57;
  --ok-soft: #e7f6ec;
  --bad: #d6453f;
  --bad-soft: #fbeae9;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 12px 28px -18px rgba(28, 25, 23, .28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root { --accent-press: #bd4c29; --accent-soft: #fdeee8; --brand-soft: #e6f1ec; --ring: 0 0 0 3px rgba(11, 125, 72, .25); }
}

* { box-sizing: border-box; }

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

html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  font-family: "Thmanyah Sans", -apple-system, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 22px 16px 56px; overflow-x: hidden; }

/* ---- Site masthead: the جوار two-colour logo, on every page. The green rule
   under it carries the brand's second colour as a structural element (the app
   body is otherwise all-terracotta). ---- */
.sitehead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 12px;
  margin: 0 0 16px;
  border-bottom: 2px solid var(--brand);
}
.sitehead .brand { display: inline-flex; align-items: center; gap: 9px; line-height: 0; }
.sitehead .brand-mark { height: 30px; width: auto; display: block; }
.sitehead .brand-name {
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand);
  letter-spacing: -.01em;
}

/* Pre-launch notice: a slim single-line strip, not a card. */
.prelaunch-strip {
  text-align: center;
  margin-bottom: 14px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: .85em;
  border-bottom: 1px solid var(--line);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  font-weight: 700;
  line-height: 1.2;
  margin: .1em 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: 1.85rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: .5em 0; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}

/* ---- Forms ---- */
label {
  display: block;
  margin: .7em 0 .25em;
  color: var(--muted);
  font-size: .85em;
  font-weight: 500;
}
input, select, button, textarea {
  font: inherit;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fbfaf8;
  color: var(--fg);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
/* A tick box is never a full-width field (the rule above would stretch it across the row). */
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; }
input::placeholder { color: #8a8e95; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
  background: #fff;
}
/* Keyboard focus ring on the interactive elements that aren't inputs (which get it above). */
button:focus-visible, .btn:focus-visible, a:focus-visible, .menu-nav a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
select {
  appearance: none;
  /* single chevron (data-URI can't read a CSS var, so the stroke mirrors --muted #5f636b) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%235f636b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-position: left 12px center;
  background-size: 12px 8px;
  background-repeat: no-repeat;
  padding-left: 28px;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;                 /* content-sized by default (not full-width) */
  padding: 9px 16px;
  line-height: 1.25;
  white-space: nowrap;         /* never wrap the label onto a second line */
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  cursor: pointer;
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-press); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--line);
}
button.secondary:hover, .btn.secondary:hover { background: #f3f1ed; }
/* A button that should fill its container (stacked form submits). */
.btn-block, button.btn-block { width: 100%; }
/* Disabled buttons (e.g. the pay CTA at an empty cart, or the server-rendered «مغلق الآن»):
   flat + muted, no accent fill, no shadow, not-allowed cursor. */
button:disabled, button[disabled], .btn:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
button:disabled:hover, .btn:disabled:hover { background: var(--surface-2); }

/* ---- Layout helpers ---- */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
/* Cards in a row keep a readable floor so they wrap (stack) on phones instead of squashing. */
.row > .card { min-width: 200px; }
/* Headings sitting beside a button/link in a row shouldn't carry their block margins,
   which otherwise throw the vertical alignment off. */
.row > h1, .row > h2, .row > h3 { margin: 0; }
/* A form used purely as a flex wrapper around one button shouldn't add its own size. */
.row > form { margin: 0; }

/* ---- Text utilities ---- */
.muted { color: var(--muted); }
.err { color: var(--bad); font-weight: 500; }
.ok  { color: var(--ok); font-weight: 500; }

a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* ---- Pills / tags ---- */
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-press);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: .78em;
  font-weight: 600;
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
td, th { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }

/* ---- Menu item rows (staff builder + customer menu) ---- */
.item-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.item-row:last-child { border-bottom: none; }
.thumb {
  width: 64px; height: 64px;
  flex: 0 0 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .72em; color: var(--muted); text-align: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; align-items: center; }
.item-actions input[type="file"] { max-width: 200px; padding: 7px 9px; }

/* ---- Section jump-bar: a sticky horizontal strip of category chips at the top of the menu.
   Tapping a chip jumps straight to that section. Chips are generated from the live category
   list, so a new section appears here and a deleted one disappears automatically. Shared by
   the customer menu and the staff menu builder. ---- */
.menu-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.menu-nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font-size: .88em;
  font-weight: 600;
}
.menu-nav a:hover { border-color: var(--brand); color: var(--brand-press); background: var(--brand-soft); }
.menu-nav::-webkit-scrollbar { height: 6px; }
.menu-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
/* Anchored section heading / item card clears the sticky jump-bar when jumped to (also used
   to return the staff builder to the exact item after an edit/add-on instead of the page top). */
.menu-section, .menu-edit-card { scroll-margin-top: 70px; }
/* Customer identity header: the restaurant's own moment at the top of its menu — logo (when
   present) + serif name + a short accent hairline (the per-restaurant --accent) + one muted modes
   line. No-logo = tasteful absence (name + hairline only), never an empty box. Flat, no glow. */
.rest-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}
.rest-logo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
}
.rest-identity-body { min-width: 0; }
.rest-name { font-size: 1.6rem; margin: 0; }
.rest-hairline {
  width: 44px;
  height: 2px;
  margin-top: 6px;
  border-radius: 1px;
  background: var(--accent);
}
.rest-modes { margin-top: 7px; font-size: .85em; }

/* Category heading: the Serif's cheapest premium moment — a short accent hairline
   under the name (as wide as the text). Flat, no glow. */
.menu-section h3 {
  font-size: 1.35rem;
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent);
}

/* ---- Customer menu: each category is a heading with a HORIZONTAL row of item cards
   (swipe sideways). Cards never wrap/stack — always side by side, on phone too. ---- */
.menu-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.item-box {
  flex: 0 0 180px;             /* fixed width -> a row of cards, no stacking */
  min-width: 0;                /* override flex's default min-width:auto so the inner
                                  textarea can't force the card (and page) wider */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfaf8;
}
.item-box .box-thumb {
  width: 100%; aspect-ratio: 1 / 1;   /* square -> larger, clearer food photo */
  border-radius: 10px; overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);                /* no-photo fallback icon inherits this */
}
.item-box .box-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-box .box-thumb .thumb-fallback { width: 38%; height: 38%; }
.item-box .name { font-weight: 700; line-height: 1.3; font-size: 1em; }
.item-box .price { color: var(--accent-press); font-weight: 700; font-size: .88em; margin-top: -2px; }
.item-box .qty { display: flex; flex-direction: column; gap: 4px; }
/* Qty stepper: −/+ buttons flank the editable number input. Buttons are ≥44px tap targets and
   type="button" (a bare <button> inside the order form would SUBMIT it). The input keeps its
   name/min/max/value and stays directly typable (narrow, centered). Flat — surface-2, no glow. */
.item-box .stepper { display: flex; align-items: stretch; gap: 6px; }
.item-box .stepper .step {
  flex: 0 0 44px; min-height: 44px; padding: 0;
  font-size: 1.35rem; font-weight: 700; line-height: 1;
  background: var(--surface-2); color: var(--fg); border: 1px solid var(--line);
  box-shadow: none;
}
.item-box .stepper .step:hover { background: var(--line); }
.item-box .stepper input { flex: 1; min-width: 0; text-align: center; padding: 8px; }
/* Notes behind a native toggle (zero JS): closed <details> still submits its textarea. */
.note-toggle > summary {
  cursor: pointer; list-style: none;
  font-size: .82em; font-weight: 500; color: var(--brand); padding: 2px 0;
}
.note-toggle > summary::-webkit-details-marker { display: none; }
.note-toggle[open] > summary { margin-bottom: 4px; }
.item-box textarea { font-size: .8em; min-height: 50px; line-height: 1.4; resize: vertical; }
/* Thin, unobtrusive scrollbar for the horizontal strips. */
.menu-grid::-webkit-scrollbar { height: 7px; }
.menu-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.addons { display: flex; flex-direction: column; gap: 4px; }
.addon { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; font-size: .9em; color: var(--fg); font-weight: 400; }
.addon input { width: auto; accent-color: var(--accent); }
.req { color: var(--bad); font-weight: 600; font-size: .9em; }

/* Sticky order summary with the "other apps" comparison. */
.cart-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -3px 14px rgba(0,0,0,.07);
}
/* Receipt motif: flat, framed by hairline rules top+bottom (no grey box), the saving as a
   serif figure — the day's quiet premium moment. */
.compare {
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 1.7;
}
.compare s { opacity: .8; }
.compare .saved {
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  color: var(--ok);
  font-size: 1.2em;
}
.compare .commission { color: var(--muted); font-size: .82em; margin-top: 2px; }

/* ---- Staff: add-on (modifier) editor under each menu item ---- */
.modifiers-edit {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 0 12px; border-bottom: 1px solid var(--line);
}
.mod-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-press);
  font-size: .82em; font-weight: 600;
}
.chip-del {
  width: auto; padding: 0 5px; line-height: 1;
  background: transparent; color: var(--accent-press);
  border: none; font-size: 1.1em; font-weight: 700; box-shadow: none;
}
.chip-del:hover { background: transparent; color: var(--bad); }
.addon-add { display: flex; gap: 6px; flex: 1; min-width: 220px; }
.addon-add input { flex: 1; }
.addon-add input[type="number"] { max-width: 110px; }

/* ---- Staff menu: editable item cards in a grid (not one long column) ---- */
.menu-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
  gap: 14px;
  margin-top: 10px;
}
.menu-edit-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfaf8;
}
.menu-edit-card.is-off { opacity: .55; }
.menu-edit-card form { margin: 0; }
.menu-edit-card .name { font-weight: 700; }
.menu-edit-card .price { color: var(--accent-press); font-weight: 700; font-size: .9em; }
.edit-thumb {
  width: 100%; aspect-ratio: 4 / 3;
  border-radius: 10px; overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .8em; color: var(--muted);
}
.edit-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-fields { display: flex; flex-direction: column; gap: 6px; }
.edit-fields input[name="name"] { font-weight: 600; }
/* In the narrow edit card, the add-on editor stacks instead of crowding one line. */
.menu-edit-card .modifiers-edit { border-bottom: none; padding: 6px 0 0; }
.menu-edit-card .addon-add { flex-direction: column; min-width: 0; align-items: stretch; gap: 6px; }

/* Hide a control visually while keeping it accessible / clickable via its label. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Status colour helpers (optional, used where present) ---- */
.pill-ok  { background: var(--ok-soft);  color: var(--ok);  border-color: transparent; }
.pill-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* ============================================================================
   Landing (public page at «/»). One section, same token vocabulary as above.
   Flat — only the existing --shadow; no glow/gradient/gold. Motion is opt-in and
   progressively enhanced: hidden states exist ONLY under the JS-added `.js-anim`
   root class, so with no JS (or reduced motion) everything renders visible.
   ============================================================================ */
:root { --ease-spring: cubic-bezier(.32, .72, 0, 1); }

/* Masthead actions cluster — pushed to the far end (left, in RTL) of the green rule. */
.sitehead-actions { display: flex; gap: 8px; margin-inline-start: auto; }
/* Compact masthead button (pairs with .btn / .btn.secondary). */
.btn-sm { padding: 7px 12px; font-size: .9em; }

/* Skip-to-content: off-screen until keyboard-focused, then a real chip. */
.skip-link {
  position: absolute;
  right: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: top .15s var(--ease-spring);
}
.skip-link:focus { top: 8px; outline: none; box-shadow: var(--ring); }

/* ---- Hero (single-column, centered text block; no visual/mock) ---- */
.land-hero {
  padding: 32px 0 24px;
  text-align: center;
}
.land-hero > * { max-width: 56ch; margin-inline: auto; }
.land-hero h1 {
  font-size: clamp(2rem, 6vw, 2.6rem);
  color: var(--brand);          /* SOLID brand green — not a gradient */
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 auto .4em;
}
/* margin uses `auto` inline so the max-width:56ch block itself stays centered
   (a plain `margin:0 …` shorthand would zero the inline margins and pin it to the
   RTL start edge, making the text look right-drifted even though it is text-align:center). */
.hero-sub { font-size: 1.1rem; text-wrap: pretty; text-align: center; margin: 0 auto 18px; }
.hero-services { text-wrap: pretty; text-align: center; margin: 0 auto 12px; }
.hero-proof { margin: 0 auto; font-size: .9em; text-align: center; }

/* ---- Section rhythm (hero sits above; the tagline/how/faq sections land here later) ---- */
.land-sec { margin: 64px 0; }
.land-sec > h2 { text-align: center; font-size: 1.6rem; text-wrap: balance; }
.q-accent { color: var(--accent); }

/* ---- Feature flow: each feature is its own full-width block that reveals on scroll.
   A big brand-soft icon tile faces a text side; the tile alternates to the opposite edge
   on even rows for rhythm (≥640px), collapsing to a centered single column on phones. ---- */
.feature-flow { display: flex; flex-direction: column; gap: 56px; margin-top: 28px; }
.feature { margin: 0; display: flex; align-items: center; gap: 26px; }
.feature:nth-child(even) { flex-direction: row-reverse; }
.feature-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
}
.feature-icon svg { width: 34px; height: 34px; }
.feature-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.feature-text h3, .feature-text p { margin: 0; }
.feature-text h3 { font-size: 1.5rem; }
/* Small brand-accent line under each feature title, pinned to the title's start (right in RTL). */
.feature-text h3::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-block-start: 8px;
  margin-inline-start: 0;
}
.feature-text p { font-size: .95rem; color: var(--muted); }

/* Before/after menu photos — two real optimized shots sit side by side, filling their slots. */
.ba-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.ba-slot {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.ba-slot img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.ba-label {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .72em;
  font-weight: 600;
}

/* Payment-method chips: neutral text pills; real logo SVGs arrive later, no layout change. */
.pay-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pay-chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .8em;
}

/* ---- Store showcase: a small grid of active-restaurant cards under the hero, so a visitor
   sees a real order page. Auto-fit cards, a square 3-up photo strip, serif name. Tokens only. ---- */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.showcase-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--fg);
}
.showcase-card:hover { text-decoration: none; border-color: var(--brand); }
.showcase-head { display: flex; align-items: center; gap: 12px; }
.showcase-logo { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.showcase-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.showcase-name {
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  font-weight: 700; font-size: 1.25rem; line-height: 1.2;
}
.showcase-modes { font-size: .82em; }
.showcase-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.showcase-photo { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.showcase-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-cta { color: var(--brand); font-weight: 700; }

/* ---- Reveal-on-scroll gating (progressive enhancement; driven by landing.js later).
   Hidden states apply ONLY under .js-anim — never added without JS or when the viewer
   prefers reduced motion — so the page is fully visible by default. ---- */
.js-anim .reveal { opacity: 0; transform: translateY(16px); }
.js-anim .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease-spring), transform .7s var(--ease-spring);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .tr-word, .skip-link, .faq-chevron { transition: none; }
}

/* ---- Tagline reveal: two centered serif lines; «بدون عمولة» stays green.
   The per-word light-up is S7 (landing.js); here only the static end-state is set. ---- */
.tagline { text-align: center; }
.tagline .tr-line { margin: 0 auto; max-width: 18ch; }
.tagline .tr-line + .tr-line { margin-top: .1em; }
.tr-word {
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  line-height: 1.3;
}
.tr-brand { color: var(--brand); }

/* Per-word light-up (S7, driven by landing.js): each word starts dim and fades to ink,
   staggered by its --i; the brand words settle green instead. Cascade note:
   `.js-anim .tr-word` (0,2,0) overrides base `.tr-brand` (0,1,0) so brand words also START
   dim; on reveal, the brand rule below sits AFTER the ink rule at equal (0,4,0) specificity,
   so source order lets «بدون عمولة» win to --brand while the rest land on --fg. */
.js-anim .tr-word { color: color-mix(in srgb, var(--fg) 30%, var(--bg)); }
.js-anim .tagline.is-in .tr-word {
  color: var(--fg);
  transition: color .5s var(--ease-spring);
  transition-delay: calc(var(--i) * 110ms);
}
.js-anim .tagline.is-in .tr-brand { color: var(--brand); }
@supports not (color: color-mix(in srgb, red, blue)) {
  .js-anim .tr-word { color: #b9bcc2; }
}

/* ---- How it works: a vertical stack of numbered steps (number + title only); the big
   Western numeral carries the accent hairline motif and reveals step-by-step on scroll. ---- */
.steps { display: flex; flex-direction: column; align-items: center; gap: 34px; margin-top: 20px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.step h3 { margin: 0; }
.step-num {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: "Thmanyah Serif", "Thmanyah Sans", serif;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--brand);
}

/* ---- FAQ: honest disclosure in flat, framed <details>. ---- */
.faq { margin-top: 8px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
  margin: 8px 0;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chevron {
  flex: none;
  width: 13px;
  height: 9px;
  color: var(--muted);
  transition: transform .25s var(--ease-spring);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-item > .muted { margin: 10px 0 0; }

/* ---- Contact box: the final call, tinted with brand-soft. ---- */
.contact-box {
  background: var(--brand-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.contact-box h2 { margin: 0; font-size: 1.6rem; text-wrap: balance; }
.contact-box p { margin: 0; max-width: 46ch; }
.contact-methods { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.contact-method { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); }
.contact-method svg { flex: none; width: 18px; height: 18px; color: var(--brand); }

/* ---- S8 polish: pretty-wrap the landing body copy (headings already balance above) and
   give <summary> the same branded focus ring the other interactives get (it matches none of
   the button/.btn/a focus-visible selectors, so without this it falls back to the UA outline). ---- */
.feature-text p, .faq-item > .muted, .contact-box p { text-wrap: pretty; }
.faq-item summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* ---- Staff summary: growth dashboard (W5). KPI delta chip + trend bars.
   Colour comes from the existing --ok/--bad tokens; the SVG bars/triangle inherit
   their fill from currentColor / inline --accent (newest bar) | --muted (past bars,
   readable mid-grey — --line was near-invisible on the card). No new palette. ---- */
/* Delta chip is a rounded PILL: soft-tinted background (existing --ok-soft/--bad-soft) with the
   matching ink; the triangle carries direction so colour is never the only signal. */
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: .9em;
  padding: 3px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-delta.up { color: var(--ok); background: var(--ok-soft); }
.kpi-delta.down { color: var(--bad); background: var(--bad-soft); }

/* KPI card: a header row (muted label at the start, delta pill at the end) over an oversized
   tabular headline, then the «مقابل…» caption, the sparkline, and the avg/peak line. */
.card.kpi { padding: 18px 18px 16px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-lbl { color: var(--muted); font-weight: 600; font-size: .92em; }
.card.kpi h2 { font-size: 2.3rem; line-height: 1.05; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-vs { color: var(--muted); font-size: .78em; margin: 0; }
.kpi-cap { color: var(--muted); font-size: .78em; margin: 8px 0 0; }

/* Summary tables: figures hug the row-end (left, in RTL) with tabular digits; phones read LTR so
   the leading zero and grouping stay natural. Classes are unique to this page. */
td.num, th.num { text-align: left; font-variant-numeric: tabular-nums; }
td.tel { text-align: left; direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }

/* Trend bars: rounded (rx in the SVG), past bars --muted / newest --accent; a hover dim + a subtle
   grow-in from the baseline (motion opt-out honoured). */
.trend { width: 100%; height: auto; display: block; margin-top: 6px; }
.trend rect { cursor: pointer; transition: opacity .12s; }
.trend rect:hover { opacity: .82; }
@media (prefers-reduced-motion: no-preference) {
  .trend rect { transform-box: fill-box; transform-origin: bottom; animation: trend-grow .5s var(--ease-spring) both; }
}
@keyframes trend-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Hover/tap tooltip for a trend bar — a single body-level box that summary.js positions near the
   cursor (SVG <rect> can't carry a CSS ::after). Hidden until JS shows it; tokens only, no new
   palette. Sits above the sticky nav (z-index 30). */
.chart-tip {
  position: absolute;
  display: none;
  z-index: 40;
  padding: 5px 10px;
  background: var(--fg);
  color: #fff;
  border-radius: 8px;
  font-size: .78em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
}
/* KPI sparkline: a slim full-width area trace under each headline; --accent line over a soft
   --accent-soft fill with an --accent end-dot (all server-rendered, no new palette). */
.spark { width: 100%; height: 44px; display: block; margin: 10px 0 2px; }

/* Time-range rail: an underline tab strip choosing the dashboard window. The active tab carries an
   --accent underline (deliberately the terracotta, NOT the nav's --brand green) so the two rails
   never read as the same control. Scrolls sideways on a phone rather than wrapping. */
.range-tabs {
  display: flex;
  gap: 18px;
  margin: 4px 0 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.range-tabs .range-tab {
  flex: 0 0 auto;
  padding: 8px 2px;
  margin-bottom: -1px;                 /* sit the tab's own border on the rail's hairline */
  color: var(--muted);
  font-weight: 600;
  font-size: .92em;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.range-tabs .range-tab:hover { color: var(--fg); text-decoration: none; }
.range-tabs .range-tab.active { color: var(--fg); font-weight: 700; border-bottom-color: var(--accent); }

/* Fulfilment-mode filter: rounded pill chips on a sunken --surface-2 rest state. The active chip
   fills solid --accent with white text — a filled shape, deliberately unlike the time rail's
   underline, so the two controls never read as one. Scrolls sideways on a phone, never wraps. */
.mode-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mode-chips .mode-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .86em;
  font-weight: 600;
}
.mode-chips .mode-chip:hover { color: var(--fg); text-decoration: none; }
.mode-chips .mode-chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* ---- M2: sparkline draw-in + loading dim. Motion-gated (hidden initial states live ONLY inside
   the no-preference gate, so reduced-motion / no-JS viewers get the fully-painted server sparkline
   instantly). Tokens/opacity only — no new palette. The #dash swap is enhanced by summary.js. ---- */
@media (prefers-reduced-motion: no-preference) {
  .spark polygon { opacity: 0; animation: spark-fade .7s ease .15s forwards; }
  .spark polyline { stroke-dasharray: 100; stroke-dashoffset: 100; animation: spark-draw .9s var(--ease-spring) forwards; }
  .spark circle { opacity: 0; animation: spark-fade .4s ease .8s forwards; }
  /* The .12s delay means a fast swap settles before this transition would ever visibly dim. */
  #dash { transition: opacity .15s ease .12s; }
}
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes spark-fade { to { opacity: 1; } }
/* Loading dim is NOT motion (holds under reduced-motion too); only its transition is gated above. */
#dash[aria-busy="true"] { opacity: .55; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .land-sec { margin: 48px 0; }
  .feature, .feature:nth-child(even) { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .feature-text { width: 100%; }
  .feature-text h3::after { margin-inline: auto; }  /* centre the accent line under the centred title */
  .pay-chips { justify-content: center; }
}
