/* Shared, template-agnostic base. Per-template look lives in its own file,
   scoped under [data-template="..."] so styles never collide. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }

body.no-scroll { overflow: hidden; }

.em-hidden { display: none !important; }
.em-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;
}

#menu-root { min-height: 100vh; }
.em-status-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f7f7f8;
    font-family: inherit;
}

.em-status-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 32px 26px;
    text-align: center;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.em-status-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .em-status-icon.error {
        background: #fff1f2;
        color: #e11d48;
    }

    .em-status-icon.loading {
        background: #f3f4f6;
    }

.em-status-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.em-status-text {
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
    margin: 0;
}

.em-status-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.em-retry-btn {
    border: 0;
    outline: 0;
    cursor: pointer;
    padding: 11px 22px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

    .em-retry-btn:hover {
        background: #000;
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
    }

.em-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    animation: emSpin 0.8s linear infinite;
}

@keyframes emSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .em-status-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .em-status-title {
        font-size: 18px;
    }
}
/* Loading / error overlay — neutral so it works before a template is applied. */
.em-status {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #444;
  background: #f7f7f8;
}
.em-status .em-spinner {
  width: 38px; height: 38px; margin: 0 auto 16px;
  border: 3px solid #ccc; border-top-color: #555; border-radius: 50%;
  animation: em-spin 0.8s linear infinite;
}
@keyframes em-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Softex promo footer — shared across all 4 templates.
   Full-width band (no border-radius). A 3px accent stripe at
   the top bridges from the menu template's color into the
   Softex dark-navy branding — best of both worlds.
   ============================================================ */

/* The accent bridge uses each template's dominant color.
   Each template CSS defines --sx-top-accent. */
.sx-footer {
  /* Full-width: no margin, no container — flush to the page edges. */
  margin: 0;
  padding: 0;
  border-top: 3px solid var(--sx-top-accent, #2bb673);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[dir="rtl"] .sx-footer { font-family: "Tajawal", -apple-system, "Segoe UI", sans-serif; }

/* Full-width dark card — no rounded corners, no drop shadow */
.sx-card {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(700px 320px at 88% -5%,  rgba(43,182,115,.28), transparent 60%),
    radial-gradient(580px 360px at 5%  120%, rgba(27,115,181,.42), transparent 62%),
    linear-gradient(150deg, #0c2a47, #091e38);
}
/* Subtle grid texture overlay */
.sx-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .45;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 75% 20%, #000 20%, transparent 80%);
  mask-image:         radial-gradient(ellipse 80% 70% at 75% 20%, #000 20%, transparent 80%);
}

/* Inner content max-width — keeps text readable on ultra-wide */
.sx-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Two-column banner: copy left, solution cards right */
.sx-banner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
  padding: 52px 0 44px;
}
.sx-banner .copy { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }

.sx-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: #bfe7d4; background: rgba(43,182,115,.13);
  border: 1px solid rgba(43,182,115,.30); padding: 7px 14px; border-radius: 999px;
}
html[dir="rtl"] .sx-eyebrow { text-transform: none; letter-spacing: 0; font-size: 13px; }
.sx-eyebrow .fa-solid { color: #2bb673; font-size: 11px; }

.sx-h2 {
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.1;
  letter-spacing: -.025em; font-weight: 800; margin: 0;
}
html[dir="rtl"] .sx-h2 { letter-spacing: 0; }
.sx-h2 .hl { color: #7fd6ab; }
.sx-lede {
  color: #bdd0e3; font-size: clamp(14px, 1.3vw, 16px); max-width: 520px;
  line-height: 1.65; margin: 0;
}

.sx-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: #2bb673; color: #04200f;
  font-weight: 800; font-size: 15px; padding: 14px 26px; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(43,182,115,.38), 0 0 0 1px rgba(43,182,115,.25);
  transition: transform .22s, box-shadow .22s, background .2s;
  text-decoration: none; margin-top: 2px;
}
.sx-cta:hover { background: #1f9e61; color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(43,182,115,.44); }
html[dir="ltr"] .sx-cta .fa-solid { transition: transform .22s; }
html[dir="ltr"] .sx-cta:hover .fa-solid { transform: translateX(4px); }
html[dir="rtl"] .sx-cta .fa-solid { transform: scaleX(-1); transition: transform .22s; }
html[dir="rtl"] .sx-cta:hover .fa-solid { transform: scaleX(-1) translateX(4px); }

/* Solution cards */
.sx-sols { display: grid; gap: 10px; }
.sx-sol {
  display: flex; align-items: center; gap: 13px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px; padding: 12px 14px;
  transition: background .2s, transform .18s, border-color .2s;
  text-decoration: none;
}
.sx-sol:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); border-color: rgba(127,214,171,.45); }
.sx-sol .si {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 17px; color: #fff;
  background: linear-gradient(140deg, #15639e, #1b73b5);
}
.sx-sol:nth-child(2) .si { background: linear-gradient(140deg, #2bb673, #1f9e61); }
.sx-sol:nth-child(3) .si { background: linear-gradient(140deg, #1b73b5, #0c2a47); }
.sx-sol:nth-child(4) .si { background: linear-gradient(140deg, #2bb673, #15639e); }
.sx-sol b     { font-size: 14.5px; font-weight: 700; color: #fff; display: block; line-height: 1.2; }
.sx-sol small { font-size: 12px; color: #9db8cc; line-height: 1.3; }

/* "Developed by Softex © year" strip */
.sx-copy {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; color: rgba(255,255,255,.55);
}
.sx-copy .dot { width: 5px; height: 5px; border-radius: 50%; background: #2bb673; flex: none; }
.sx-copy b a { color: #7fd6ab; text-decoration: none; font-weight: 700; }
.sx-copy b a:hover { color: #2bb673; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .sx-banner { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 32px; }
  .sx-lede   { max-width: none; }
}
@media (max-width: 540px) {
  .sx-inner  { padding: 0 16px; }
  .sx-banner { padding: 32px 0 28px; gap: 22px; }
  .sx-cta    { width: 100%; justify-content: center; }
}

/* ============================================================
   Shared "Menu categories" picker — a ≡ button pinned at the
   start of every template's category nav opens a bottom sheet
   listing all categories with item counts. Theme-aware; the
   trigger colours are themed per template via the --em-cats-*
   variables set below.
   ============================================================ */
/* Pinned ≡ trigger: a solid cell at the start of the nav with a divider, so
   chips slide *under* it (never wrap below it) and it stays visible while the
   nav scroll-spy re-centres the active chip. Opaque bg hides scrolling chips. */
.em-cats-btn {
  flex: none; align-self: stretch; min-width: 46px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--em-cats-bg, #ffffff);
  color: var(--em-cats-fg, currentColor);
  border: 0; border-inline-end: 1px solid var(--em-cats-bd, rgba(128, 128, 128, 0.28));
  transition: transform 0.12s ease;
}
.em-cats-btn:active { transform: scale(0.94); }
.em-cats-btn svg { width: 19px; height: 19px; }

/* The ≡ button sits in a sticky wrapper *beside* the scrolling nav (templates
   3–8), so it stays pinned at the start regardless of RTL or the scroll-spy
   auto-centering the rail — it is never inside the horizontal scroller. */
.em-catbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: stretch; }
.em-catbar .em-cats-btn { border-bottom: 1px solid var(--em-cats-bd, rgba(128, 128, 128, 0.28)); }

/* Inside the wrapper the nav is a plain horizontal scroller (no longer sticky). */
[data-template="street"] .em-catbar .st-rail,
[data-template="grill"]  .em-catbar .gr-tabs,
[data-template="bistro"] .em-catbar .bs-nav,
[data-template="sweet"]  .em-catbar .sw-rail,
[data-template="royal"]  .em-catbar .ry-rail,
[data-template="book"]   .em-catbar .ck-toc {
  position: static; top: auto; z-index: auto;
  flex: 1 1 auto; min-width: 0; flex-wrap: nowrap;
}
/* book's nav had a top margin + top accent rule — move them to the wrapper */
[data-template="book"] .em-catbar { margin-top: 22px; border-top: 2px solid var(--ck-rule); }
[data-template="book"] .em-catbar .ck-toc { margin-top: 0; border-top: 0; }

/* panel / luxe keep the inline ≡ button in their mobile chip strip (no wrapper) */
[data-template="panel"] .pn-cats-mob,
[data-template="luxe"]  .cats-mob { flex-wrap: nowrap; }

.em-catsheet { position: fixed; inset: 0; z-index: 130; display: none; }
.em-catsheet.show { display: block; }
.em-catsheet-scrim {
  position: absolute; inset: 0; background: rgba(8, 10, 14, 0.5);
  opacity: 0; transition: opacity 0.25s ease;
}
.em-catsheet.show .em-catsheet-scrim { opacity: 1; }
.em-catsheet-panel {
  position: absolute; inset-inline: 0; bottom: 0; margin-inline: auto;
  width: 100%; max-width: 560px; max-height: 82dvh;
  display: flex; flex-direction: column;
  background: #ffffff; color: #16181c;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(102%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0.2, 1);
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.em-catsheet.show .em-catsheet-panel { transform: none; }
html[data-lang="ar"] .em-catsheet-panel { font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif; }
.em-catsheet-grip {
  width: 42px; height: 4px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.16); margin: 10px auto 0; flex: none;
}
.em-catsheet-head { display: flex; align-items: center; gap: 14px; padding: 12px 20px 14px; flex: none; }
.em-catsheet-close {
  width: 40px; height: 40px; border-radius: 50%; flex: none; cursor: pointer;
  display: grid; place-items: center;
  background: transparent; border: 1px solid rgba(0, 0, 0, 0.14); color: inherit;
}
.em-catsheet-close svg { width: 16px; height: 16px; }
.em-catsheet-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.em-catsheet-list {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.em-catsheet-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; text-align: start; cursor: pointer; color: inherit;
  background: transparent; border: 0; border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.em-catsheet-row:first-child { border-top: 0; }
.em-catsheet-row .nm { font-size: 16px; font-weight: 600; line-height: 1.3; }
.em-catsheet-row .ct { flex: none; font-size: 15px; color: rgba(0, 0, 0, 0.42); font-variant-numeric: tabular-nums; }
.em-catsheet-row.on { box-shadow: inset 3px 0 0 currentColor; }
.em-catsheet-row.on .nm { font-weight: 800; }
@media (hover: hover) { .em-catsheet-row:hover { background: rgba(0, 0, 0, 0.04); } }

/* dark theme sheet */
html[data-theme="dark"] .em-catsheet-panel { background: #1c1d20; color: #f1f2f4; }
html[data-theme="dark"] .em-catsheet-grip { background: rgba(255, 255, 255, 0.22); }
html[data-theme="dark"] .em-catsheet-close { border-color: rgba(255, 255, 255, 0.18); }
html[data-theme="dark"] .em-catsheet-row { border-top-color: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .em-catsheet-row .ct { color: rgba(255, 255, 255, 0.5); }
html[data-theme="dark"] .em-catsheet-row:hover { background: rgba(255, 255, 255, 0.06); }

@media (prefers-reduced-motion: reduce) {
  .em-catsheet-panel, .em-catsheet-scrim { transition: none !important; }
}

/* ============================================================
   Menu password gate — neutral styling (renders before any
   template attributes are applied, like the status card).
   ============================================================ */
.em-gate-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: #f7f7f8;
  font-family: "Manrope", system-ui, sans-serif;
}
html[lang="ar"] .em-gate-wrap { font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif; }
.em-gate-card {
  width: min(400px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  background: #fff; border-radius: 20px; padding: 36px 28px; text-align: center;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.em-gate-logo {
 /* width: 72px; height: 72px;*/ margin: 0 auto 2px; /*border-radius: 50%;*/ overflow: hidden;
  display: grid; place-items: center;
  background: #111827; color: #fff; font-weight: 800; font-size: 26px;
}
.em-gate-logo img { width: 100%; height: 100%;}
.em-gate-name { margin: 0; font-size: 22px; font-weight: 800; color: #111827; }
.em-gate-hint { margin: 0; font-size: 13.5px; color: #6b7280; }
.em-gate-input {
  height: 48px; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 0 16px; font: inherit; font-size: 15px; text-align: center;
  color: #111827; outline: none; transition: border-color 0.15s ease;
}
.em-gate-input:focus { border-color: #111827; }
.em-gate-btn {
  height: 48px; border-radius: 999px; cursor: pointer;
  background: #111827; color: #fff; font-weight: 700; font-size: 14.5px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.em-gate-btn:hover { background: #000; }
.em-gate-btn:active { transform: scale(0.98); }
.em-gate-err { margin: 0; font-size: 13px; font-weight: 600; color: #e11d48; }
.em-gate-card.shake { animation: em-gate-shake 0.4s; }
@keyframes em-gate-shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* ============================================================
   Decimal quantity mode — the stepper's count becomes a manual
   input with a fraction quick-pick popover on focus. Inherits
   each template's .qty colours; only the mechanics live here.
   ============================================================ */
.qty .qwrap { position: relative; display: inline-flex; }
.qty input.qn {
  width: 50px; min-width: 0; padding: 0; border: 0; outline: 0;
  background: transparent; color: inherit; font: inherit;
  font-weight: 800; font-size: 13.5px; text-align: center;
}
.em-qty-pop {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 6px; border-radius: 12px;
  background: #1c1d20; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
/* First cart item: open downward */
.cart-item:first-child .em-qty-pop {
    top: calc(100% + 10px);
    bottom: auto;
    transform: translateX(-50%) translateY(-4px);
}
    .cart-item:first-child .em-qty-pop::after {
        top: -6px;
        bottom: auto;
        border-top: 0;
        border-bottom: 6px solid #1c1d20;
    }
.em-qty-pop::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #1c1d20;
}
.qty .qwrap:focus-within .em-qty-pop {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.em-qty-pop button {
  min-width: 38px; height: 34px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.09); color: #fff;
  font-weight: 700; font-size: 13.5px; font-family: "Manrope", system-ui, sans-serif;
}
.em-qty-pop button:hover { background: #fff; color: #111; }
@media (prefers-reduced-motion: reduce) {
  .em-qty-pop, .em-gate-card.shake { transition: none !important; animation: none !important; }
}

/* per-template trigger colours (match each template's nav surface) */
[data-template="street"] { --em-cats-bg: var(--st-bg);    --em-cats-fg: var(--st-ink);  --em-cats-bd: var(--st-line); }
[data-template="grill"]  { --em-cats-bg: var(--gr-strip); --em-cats-fg: #ffffff;        --em-cats-bd: rgba(255,255,255,0.18); }
[data-template="bistro"] { --em-cats-bg: var(--bs-paper); --em-cats-fg: var(--bs-acc);  --em-cats-bd: var(--bs-line); }
[data-template="sweet"]  { --em-cats-bg: var(--sw-card);  --em-cats-fg: var(--sw-acc);  --em-cats-bd: var(--sw-line); }
[data-template="royal"]  { --em-cats-bg: var(--ry-bg);    --em-cats-fg: var(--ry-gold); --em-cats-bd: var(--ry-line); }
[data-template="book"]   { --em-cats-bg: var(--ck-bg);    --em-cats-fg: var(--ck-ink);  --em-cats-bd: var(--ck-line); }
[data-template="panel"]  { --em-cats-bg: var(--surface);  --em-cats-fg: var(--ink);     --em-cats-bd: var(--line-2); }
[data-template="luxe"]   { --em-cats-bg: var(--bg-2);     --em-cats-fg: var(--gold);    --em-cats-bd: var(--line); }
