/* ===== Platform chrome: shared by every customer-facing page =====
   1) Arabic typography (one font on every element, controls included)
   2) native controls follow the page's dark/light mode
   3) the "Made by RESTASERV" badge (comet border)
   Client colours come from the --brand-* variables the server emits; the
   Arabic fonts from --ar-heading / --ar-body (default IBM Plex Sans Arabic). */

/* ---------- native controls + color scheme ---------- */
button, input, select, textarea, optgroup, option { font-family: inherit; }
html[data-brand-mode="dark"] { color-scheme: dark; }
html[data-brand-mode="light"] { color-scheme: light; }

/* ---------- Arabic font on EVERYTHING when the page is Arabic ---------- */
html[lang="ar"] *,
html[lang="ar"] *::placeholder,
html[lang="ar"] option,
html[lang="ar"] optgroup {
  font-family: var(--ar-body, 'IBM Plex Sans Arabic'), 'IBM Plex Sans Arabic', system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html[lang="ar"] :is(h1, h2, h3, h4, h5, h6, .category-title, .menu-card .name, .menu-tabs-detail-name, .brand-pay-title h2, .hero > span, .landing-restaurant-name, .ed-header h1) {
  font-family: var(--ar-heading, 'IBM Plex Sans Arabic'), 'IBM Plex Sans Arabic', system-ui, sans-serif !important;
  line-height: 1.4;
  font-style: normal !important;
}

/* ---------- Made by RESTASERV badge ---------- */
.rs-badge {
  --rs-ink: var(--brand-text, #222);
  --rs-line: var(--brand-border, rgba(0, 0, 0, 0.18));
  --rs-muted: var(--brand-muted, color-mix(in srgb, var(--brand-text, #222) 65%, transparent));
  --rs-bg: var(--brand-bg, #fff);
  position: fixed; bottom: calc(18px + var(--rs-badge-offset, 0px)); inset-inline-end: 18px; z-index: 60;
  display: block; border-radius: 17px; padding: 2px; overflow: hidden; text-decoration: none;
  color: var(--rs-ink); background: var(--rs-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: rsbin 0.9s 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) backwards;
  /* No transition on `bottom`: the offset only changes when a fixed bar appears or disappears. */
  transition: transform 0.3s;
}
.rs-badge:hover { transform: translateY(-3px); }
/* Pages with per-row Add/qty controls (they sit at each row's inline-end): the
   badge docks at the opposite, inline-START corner so the two never meet. */
.rs-badge--start { inset-inline-end: auto; inset-inline-start: 18px; }
.rs-badge::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; margin: -180px 0 0 -180px;
  background: conic-gradient(from 0deg, transparent 0, transparent 68%, #e2432f 100%);
  animation: rsbspin 3.2s linear infinite;
}
.rs-badge .in {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding-block: 6px; padding-inline: 6px 16px;
  background: var(--rs-bg); border-radius: 15px;
}
.rs-badge .mk { flex: none; position: relative; width: 27px; height: 42px; }
.rs-badge .mk img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* The mark follows the surface under it (the pill's --rs-bg): light = black shape + red dot (.mk-b), dark = white
   shape + red dot over a thin black contour (.mk-o behind .mk-f). All three <img> are always in the DOM and only
   opacity changes, so there is never a flash of the wrong mark on load. No transition: the pill's own background
   does not transition either (the header toggle flips data-brand-mode at once), so mark and pill change together.
   Dark = html[data-brand-mode="dark"] (brand layer, flips with the header toggle) or, for clients without the
   brand layer, the server-set data-tone="dark" on the badge (its pill is their bg_color). */
.mk .mk-o, .mk .mk-f { opacity: 0; }
html[data-brand-mode="dark"] .mk .mk-b, .rs-badge[data-tone="dark"] .mk .mk-b { opacity: 0; }
html[data-brand-mode="dark"] .mk .mk-o, html[data-brand-mode="dark"] .mk .mk-f,
.rs-badge[data-tone="dark"] .mk .mk-o, .rs-badge[data-tone="dark"] .mk .mk-f { opacity: 1; }
.rs-badge .tx { display: flex; flex-direction: column; line-height: 1.15; }
.rs-badge small { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rs-muted); }
.rs-badge b { font-size: 13px; letter-spacing: 0.06em; font-weight: 800; }
.rs-badge .ar { flex: none; transition: transform 0.3s; }
.rs-badge:hover .ar { transform: translate(2px, -2px); }
[dir="rtl"] .rs-badge .ar { transform: scaleX(-1); }
[dir="rtl"] .rs-badge:hover .ar { transform: scaleX(-1) translate(2px, -2px); }
html[lang="ar"] .rs-badge b { letter-spacing: 0.06em !important; text-transform: uppercase !important; font-family: system-ui, sans-serif !important; }
html[lang="ar"] .rs-badge small { font-size: 11px; }
/* The last content must never hide behind the fixed badge -- plain flow
   height, not a body:has() selector (unsupported in some embedded/older
   browsers this app is actually opened in, e.g. an in-app or older WebView
   browser scanning a restaurant's QR code -- a page relying only on :has()
   there got no reserved space at all). Reuses the same --rs-badge-offset
   chrome.js already computes to clear the sticky cart bar, so this grows
   together with the badge's own position instead of needing a second,
   separately-tuned height for that case. */
.rs-badge-spacer { height: calc(18px + 70px + var(--rs-badge-offset, 0px)); }
@keyframes rsbin { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rsbspin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .rs-badge { bottom: calc(12px + var(--rs-badge-offset, 0px)); inset-inline-end: 12px; }
  .rs-badge--start { inset-inline-end: auto; inset-inline-start: 12px; }
  .rs-badge-spacer { height: calc(12px + 70px + var(--rs-badge-offset, 0px)); }
  .rs-badge small { display: none; }
  .rs-badge .in { padding-inline: 6px 12px; }
}
/* Collapses to logo-only once the page has scrolled (public/js/chrome.js
   toggles .collapsed) -- expands again on tap (same script) or hover/focus
   (pure CSS, for the rare touch+pointer hybrid device). A full-size badge is
   fixed over the bottom-end corner of the viewport, so on any narrower-than-
   desktop width (not just phones -- a tablet or a narrow desktop window
   under ~1000px) it can sit directly on top of the last visible menu row's
   own "+ Add" button while scrolling; shrinking its footprint here is the
   the badge is also docked at the inline-start corner on pages with per-row
   controls (.rs-badge--start), so it never covers one. Desktop (above this) has enough width that a
   menu row's Add button never shares the bottom-end corner with the badge,
   so it stays full-size there. */
@media (max-width: 1000px) {
  .rs-badge.collapsed .tx,
  .rs-badge.collapsed .ar { display: none; }
  .rs-badge.collapsed .in { padding-inline: 6px; }
  .rs-badge.collapsed:hover .tx,
  .rs-badge.collapsed:focus-within .tx { display: flex; }
  .rs-badge.collapsed:hover .ar,
  .rs-badge.collapsed:focus-within .ar { display: inline-block; }
  .rs-badge.collapsed:hover .in,
  .rs-badge.collapsed:focus-within .in { padding-inline: 6px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-badge, .rs-badge::before { animation: none; }
}

/* ---------- admin logo ---------- */
.admin-logo { height: 28px; width: auto; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; flex: none; }
