/* ════════════════════════════════════════════════════════
   Bitikka Labs – Customer Menu Stylesheet v2.0
   Modern · Premium · RTL · Mobile-First
   ════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────── */
:root {
  /* Overridden dynamically per restaurant via JS */
  --primary:      #1a1a1a;
  --primary-dark: #0d0d0d;
  --accent:       #737373;

  /* Derived tints (fallback — JS overrides these too) */
  --primary-10:   rgba(26, 26, 26, 0.08);
  --primary-20:   rgba(26, 26, 26, 0.15);
  --accent-10:    rgba(115, 115, 115, 0.10);

  /* Neutral palette */
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --surface-2:    #eaeaea;
  --border:       #e5e5e5;
  --border-strong:#d4d4d4;
  --text:         #171717;
  --text-2:       #404040;
  --text-muted:   #737373;

  /* Fluid spacing (utopia-style) */
  --space-3xs: clamp(0.25rem, 0.23rem + 0.11vw, 0.31rem);
  --space-2xs: clamp(0.5rem,  0.46rem + 0.22vw, 0.63rem);
  --space-xs:  clamp(0.75rem, 0.69rem + 0.33vw, 0.94rem);
  --space-s:   clamp(1rem,    0.91rem + 0.43vw, 1.25rem);
  --space-m:   clamp(1.5rem,  1.37rem + 0.65vw, 1.88rem);
  --space-l:   clamp(2rem,    1.83rem + 0.87vw, 2.50rem);
  --space-xl:  clamp(3rem,    2.74rem + 1.30vw, 3.75rem);
  --space-2xl: clamp(4rem,    3.65rem + 1.74vw, 5.00rem);

  /* Fluid type */
  --text-xs:   clamp(0.69rem, 0.66rem + 0.15vw, 0.80rem);
  --text-sm:   clamp(0.80rem, 0.76rem + 0.20vw, 0.94rem);
  --text-base: clamp(0.90rem, 0.87rem + 0.17vw, 1.00rem);
  --text-md:   clamp(1.00rem, 0.93rem + 0.33vw, 1.20rem);
  --text-lg:   clamp(1.20rem, 1.07rem + 0.65vw, 1.60rem);
  --text-xl:   clamp(1.40rem, 1.20rem + 1.00vw, 2.00rem);
  --text-2xl:  clamp(1.80rem, 1.50rem + 1.50vw, 2.80rem);

  /* Safe area */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-right:  env(safe-area-inset-right,  0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left,   0px);

  /* Touch target */
  --touch-min: 44px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.08);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Breakpoints */
  --bp-xs: 320px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-left:  var(--safe-left);
  padding-right: var(--safe-right);
  -webkit-overflow-scrolling: touch;
}

img, video, svg, picture {
  max-width: 100%;
  height: auto;
  display: block;
}

p, h1, h2, h3, h4, h5, h6, li, span, div {
  overflow-wrap: break-word;
  word-break: break-word;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}

a { -webkit-tap-highlight-color: transparent; }

/* ════════════════════════════════════════════════════════
   OVERLAY SCREENS
   ════════════════════════════════════════════════════════ */
.overlay-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  color: #fff;
  text-align: center;
  padding: 24px;
  font-family: 'Cairo', sans-serif;
}

/* Loading */
#loading-screen {
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.pulse-loader {
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  position: relative;
  margin-bottom: 28px;
  animation: loader-pulse 1.6s ease-in-out infinite;
}

.pulse-loader::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.6);
  animation: loader-inner 1.6s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%       { transform: scale(1.1); opacity: 0.8; }
}

@keyframes loader-inner {
  0%, 100% { transform: scale(0.8); }
  50%       { transform: scale(1.0); }
}

.screen-title {
  font-family: 'Reem Kufi', 'Cairo', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin-bottom: 10px;
}

.screen-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  max-width: 300px;
  line-height: 1.6;
}

/* Error */
#error-screen {
  background: var(--surface);
  color: var(--text);
}
#error-screen .screen-title { color: #dc2626; font-size: var(--text-lg); }
#error-screen .screen-desc  { color: var(--text-2); }

.btn-retry {
  margin-top: 24px;
  padding: 12px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.btn-retry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-retry:active { transform: scale(0.96); }

/* Success */
#success-screen { background: var(--surface); visibility: hidden; opacity: 0; }
#success-screen.show { visibility: visible; opacity: 1; }

.success-checkmark {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #16a34a;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  box-shadow: 0 0 0 14px rgba(22,163,74,0.12), var(--shadow-lg);
  animation: pop-in 0.5s var(--ease-spring) forwards;
  transform: scale(0);
}
.success-checkmark svg {
  width: 44px; height: 44px;
  fill: none; stroke: #fff;
  stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw-check 0.5s 0.3s ease forwards;
}
@keyframes pop-in    { to { transform: scale(1); } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

#success-screen .screen-title { color: #16a34a; }
#success-screen .screen-desc  { color: var(--text-2); }

.btn-success-close {
  margin-top: 28px;
  padding: 13px 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s, transform 0.15s;
}
.btn-success-close:hover  { background: var(--primary-dark); }
.btn-success-close:active { transform: scale(0.96); }

/* ════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */
header {
  position: relative;
  z-index: 10;
  text-align: center;
  overflow: hidden;
  padding-top: max(0px, var(--safe-top));
  background: var(--primary);
  padding-left: 0px;
  padding-right: 0px;
}

/* Decorative top strip */
.symbols-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 2.5vw, 20px);
  padding: clamp(10px, 2vw, 16px) 0;
  overflow: hidden;
}

.sym {
  color: rgba(255,255,255,0.25);
  font-size: clamp(0.9rem, 3vw, 1.5rem);
  line-height: 1;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   MODERN PREMIUM HEADER (Global)
   ════════════════════════════════════════════════════════ */
.modern-header {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: max(20px, calc(20px + var(--safe-top))) 20px 20px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modern-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo-text {
  font-family: 'Reem Kufi', 'Cairo', sans-serif;
  font-size: clamp(2.4rem, 8.5vw, 4.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  line-height: 1.05;
  position: relative;
  display: block;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.logo-sub {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(0.8rem, 2.8vw, 1.1rem);
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.14em;
  margin-top: 6px;
  display: block;
  font-weight: 600;
}

/* Logo image support */
.logo-img {
  width: clamp(60px, 18vw, 90px);
  height: clamp(60px, 18vw, 90px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
  margin: 0 auto 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.header-border {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--primary-dark));
}

/* ════════════════════════════════════════════════════════
   STICKY CATEGORY NAV
   ════════════════════════════════════════════════════════ */
#category-nav-container {
  position: sticky;
  top: max(0px, var(--safe-top));
  z-index: 900;
  background: rgba(248,247,244,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.category-nav-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
}
.category-nav-scroll::-webkit-scrollbar { display: none; }

.cat-nav-btn {
  padding: 7px 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-size: var(--text-sm);
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  min-height: 38px;
}

.cat-nav-btn.active,
.cat-nav-btn:active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-20);
}

@media (hover: hover) and (pointer: fine) {
  .cat-nav-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-10);
  }
}

/* ════════════════════════════════════════════════════════
   MAIN CONTAINER
   ════════════════════════════════════════════════════════ */
main {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin-inline: auto;
  padding-block: var(--space-m) var(--space-2xl);
  padding-inline: clamp(12px, 3.5vw, 28px);
  padding-left:  max(12px, calc(clamp(12px, 3.5vw, 28px) + var(--safe-left)));
  padding-right: max(12px, calc(clamp(12px, 3.5vw, 28px) + var(--safe-right)));
  container-type: inline-size;
  container-name: main-layout;
}

/* ════════════════════════════════════════════════════════
   CATEGORY SECTION
   ════════════════════════════════════════════════════════ */
.category-section {
  margin-bottom: clamp(28px, 5.5vw, 52px);
}

/* Category header – modern pill/badge style */
.category-arch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(14px, 3vw, 22px) 20px;
  position: relative;
  margin-bottom: 16px;
}

.category-arch::before {
  content: '';
  position: absolute;
  right: 0; left: 0; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  transform: translateY(-50%);
}

.category-title {
  font-family: 'Reem Kufi', 'Cairo', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary-dark);
  position: relative;
  z-index: 1;
  background: var(--primary);
  color: #fff;
  padding: 8px 28px;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px var(--primary-20);
}

.category-body {
  container-type: inline-size;
  container-name: category-body;
}

/* ════════════════════════════════════════════════════════
   MENU GRID & ITEM CARDS — Premium Redesign
   ════════════════════════════════════════════════════════ */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2.5vw, 16px);
}

@container category-body (min-width: 360px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
}

@container category-body (min-width: 700px) {
  .menu-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Card entrance animation ──────────────────────────── */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Flash ripple on add-to-cart ──────────────────────── */
@keyframes cardFlash {
  0%   { box-shadow: var(--shadow-sm), 0 0 0 0 var(--primary-20); }
  40%  { box-shadow: var(--shadow-md), 0 0 0 10px transparent; }
  100% { box-shadow: var(--shadow-sm), 0 0 0 0 transparent; }
}

/* ── Item card ────────────────────────────────────────── */
.menu-item {
  background: var(--surface);
  border-radius: 20px;
  padding: clamp(14px, 3.5vw, 20px);
  border: 1.5px solid var(--border);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.05),
    0 4px 12px rgba(0,0,0,0.03),
    0 1px 8px var(--primary-10);
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
  position: relative;
  min-height: var(--touch-min);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  animation: cardFadeIn 0.45s var(--ease-out) both;
}

/* Stagger entrance — CSS-only via nth-child */
.menu-item:nth-child(1)  { animation-delay: 0.02s; }
.menu-item:nth-child(2)  { animation-delay: 0.06s; }
.menu-item:nth-child(3)  { animation-delay: 0.10s; }
.menu-item:nth-child(4)  { animation-delay: 0.14s; }
.menu-item:nth-child(5)  { animation-delay: 0.18s; }
.menu-item:nth-child(6)  { animation-delay: 0.22s; }
.menu-item:nth-child(n+7){ animation-delay: 0.25s; }

/* Accent side indicator — refined gradient stripe */
.menu-item::before {
  content: '';
  position: absolute;
  top: 12%; bottom: 12%;
  inset-inline-end: 0;
  width: 3.5px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: var(--r-full) 0 0 var(--r-full);
  opacity: 0.5;
  transition: opacity 0.3s var(--ease-out), width 0.3s var(--ease-out), top 0.3s, bottom 0.3s;
}

/* Hover — desktop only */
@media (hover: hover) and (pointer: fine) {
  .menu-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
      0 6px 20px rgba(0,0,0,0.08),
      0 2px 8px rgba(0,0,0,0.04),
      0 4px 16px var(--primary-10);
    border-color: var(--primary-20);
  }
  .menu-item:hover::before {
    opacity: 1;
    width: 4.5px;
    top: 6%;
    bottom: 6%;
  }
}

/* Tap feedback — mobile */
.menu-item:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

/* Flash state — triggered by JS on add-to-cart */
.menu-item.flash {
  animation: cardFlash 0.45s var(--ease-out);
}

/* ── In-cart state ────────────────────────────────────── */
.menu-item.in-cart {
  border-color: rgba(22, 163, 74, 0.35);
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 2px 12px rgba(22, 163, 74, 0.08);
}
.menu-item.in-cart::before {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  opacity: 1;
  width: 4px;
  top: 8%;
  bottom: 8%;
}

/* ── Item image (legacy class — kept for backward compat) ── */
.item-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  background: var(--surface-2);
}

/* ── Item header ──────────────────────────────────────── */
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

/* ── Item name ────────────────────────────────────────── */
.item-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text);
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* ── Price + Add row ──────────────────────────────────── */
.price-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Price badge — bolder, more prominent ─────────────── */
.item-price {
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-10), var(--primary-20));
  padding: 4px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
  border: 1px solid var(--primary-20);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ── Add (+) button — larger, with gradient & shadow ──── */
.add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition:
    background 0.2s var(--ease-out),
    transform 0.15s var(--ease-spring),
    box-shadow 0.2s var(--ease-out);
  flex-shrink: 0;
  padding: 0;
  position: relative;
  box-shadow:
    0 2px 8px var(--primary-20),
    0 1px 3px rgba(0,0,0,0.1);
}

/* Expanded invisible tap target */
.add-btn::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.add-btn:active {
  transform: scale(0.82);
  transition-duration: 0.06s;
}

/* Checkmark state after adding to cart */
.add-btn.added {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.3);
  transform: scale(1.08);
}

@media (hover: hover) and (pointer: fine) {
  .add-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow:
      0 4px 16px var(--primary-20),
      0 2px 6px rgba(0,0,0,0.12);
    transform: scale(1.08);
  }
}

/* ── Item description ─────────────────────────────────── */
.item-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Skeleton loading ─────────────────────────────────── */
.skeleton-pulse {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--border) 37%,
    var(--surface-2) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.skeleton-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.skeleton-line { height: 14px; }
.skeleton-line.title { height: 18px; width: 65%; }
.skeleton-line.price { height: 14px; width: 35%; }
.skeleton-line.desc  { height: 12px; width: 85%; }

/* ════════════════════════════════════════════════════════
   FLOATING ACTION BAR
   ════════════════════════════════════════════════════════ */
.floating-action {
  position: fixed;
  bottom: max(16px, calc(16px + var(--safe-bottom)));
  left: 50%;
  transform: translateX(-50%);
  width: min(94svw, 94%);
  max-width: 520px;
  z-index: 1000;
  transition: transform 0.45s var(--ease-out), opacity 0.4s ease, visibility 0.4s;
}

.floating-action.hidden-footer {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 90px) scale(0.85);
  pointer-events: none;
}

@media (min-width: 768px)  { .floating-action { width: min(60%, 60vw); } }
@media (min-width: 1024px) { .floating-action { width: min(40%, 40vw); } }

.floating-buttons {
  display: flex;
  gap: var(--space-2xs);
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 12px;
  border-radius: var(--r-full);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.5);
  width: max-content;
  margin: 0 auto;
}

.btn-cart {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--r-full);
  padding: clamp(10px, 2.5dvh, 14px) clamp(16px, 3.5vw, 22px);
  font-size: var(--text-sm);
  cursor: pointer;
  box-shadow: 0 6px 20px var(--primary-20);
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  min-height: var(--touch-min);
}

.btn-cart:active { transform: scale(0.95); }

@media (hover: hover) and (pointer: fine) {
  .btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--primary-20);
  }
}

.cart-badge {
  position: absolute;
  top: -7px;
  inset-inline-start: -7px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 0.72rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}

.btn-waiter {
  background: rgba(30,30,30,0.85);
  color: white;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  padding: clamp(10px, 2.5dvh, 14px) clamp(12px, 2.5vw, 18px);
  font-weight: 700;
  font-size: var(--text-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  min-height: var(--touch-min);
}

.btn-waiter.ringing { animation: ring 0.5s ease; }

@keyframes ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(6deg); }
}

.btn-order {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--r-full);
  padding: 10px 14px;
  font-weight: 700;
  font-size: clamp(0.8rem, 2.8vw, 0.96rem);
  box-shadow: 0 6px 18px rgba(18,140,126,0.3);
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: transform 0.15s;
}
.btn-order:active { transform: scale(0.95); }

/* ════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════ */
#add-toast {
  position: fixed;
  bottom: max(90px, calc(90px + var(--safe-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--text);
  color: #fff;
  padding: 11px 24px;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.25s, transform 0.25s var(--ease-spring);
}

#add-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.toast-icon {
  width: 22px; height: 22px;
  background: #16a34a;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   POPULAR DRAWER (FAB + Drawer)
   ════════════════════════════════════════════════════════ */
#popular-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  background: var(--surface);
  color: var(--accent);
  width: 42px;
  border-radius: 28px 0 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: -4px 2px 18px rgba(0,0,0,0.14);
  padding: 12px 6px;
  transition: width 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: 1px solid var(--border);
  border-right: none;
}
#popular-fab:hover { width: 48px; background: var(--primary-10); }
#popular-fab:active { opacity: 0.85; }
#popular-fab span:first-child { font-size: 1.3rem; line-height: 1; }

#popular-fab-label {
  font-size: 0.58rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  color: var(--text-muted);
}

#popular-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 950;
  backdrop-filter: blur(2px);
}
#popular-overlay.active { display: block; }

#popular-drawer {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(320px, 84vw);
  background: var(--surface);
  z-index: 960;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
  overflow-y: auto;
  direction: rtl;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border-radius: 0 0 0 var(--r-xl);
}
#popular-drawer.open { transform: translateX(0); }

.popular-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.popular-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: background 0.15s;
}
.popular-close-btn:hover { background: rgba(255,255,255,0.28); }

.popular-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: 40px 16px;
}

.mr-list { padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 10px; }

.mr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mr-item:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .mr-item:hover { box-shadow: var(--shadow-sm); border-color: var(--primary-20); }
}

.mr-medal { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.mr-info  { flex: 1; min-width: 0; }
.mr-name  { font-size: var(--text-sm); font-weight: 700; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-desc  { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mr-price { font-size: var(--text-sm); font-weight: 700; color: var(--primary); }
.mr-add {
  background: var(--primary);
  color: #fff; border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 1.1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.mr-add:active { transform: scale(0.85); }
.mr-add:hover  { background: var(--primary-dark); }

/* ════════════════════════════════════════════════════════
   ADMIN / LOGIN PANEL (inline within menu page)
   ════════════════════════════════════════════════════════ */
#login-panel {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 32px 24px;
  width: 90%;
  max-width: 370px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

#login-panel h3 { font-family: 'Reem Kufi', 'Cairo', sans-serif; color: var(--primary); margin-bottom: 16px; font-size: var(--text-lg); }
#admin-pass {
  width: 100%; padding: 12px;
  border: 2px solid var(--border-strong); border-radius: var(--r-md);
  font-size: var(--text-base); font-family: 'Cairo', sans-serif;
  text-align: center; margin-bottom: 14px; direction: ltr;
  outline: none; transition: border-color 0.2s;
}
#admin-pass:focus { border-color: var(--primary); }
.btn-login {
  width: 100%; padding: 13px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--r-md);
  font-family: 'Cairo', sans-serif; font-size: var(--text-base); font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.btn-login:hover { background: var(--primary-dark); }
#login-error { color: #dc2626; font-size: var(--text-xs); margin-top: 10px; display: none; }

#admin-panel {
  display: none; background: var(--surface); border-radius: var(--r-xl);
  padding: var(--space-m) var(--space-s);
  width: min(95%, 95svw); max-width: 640px;
  max-height: 90dvh; overflow-y: auto;
  font-family: 'Cairo', sans-serif; direction: rtl;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}

#admin-panel h2 {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 16px 20px; margin: -20px -20px 20px;
  border-radius: var(--r-md) var(--r-md) 0 0; font-size: var(--text-md);
}

/* Stats in admin */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
@media (min-width: 480px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--r-md); padding: 14px 10px; text-align: center;
}
.stat-num { font-size: 1.9rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.75); margin-top: 5px; }

/* Section titles */
.section-title {
  font-weight: 700; color: var(--primary);
  margin: 18px 0 10px;
  padding-inline-end: 12px;
  border-inline-end: 3px solid var(--accent);
  font-size: var(--text-sm);
}

/* Subscription alerts */
.sub-alert { border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; font-size: var(--text-xs); direction: rtl; }
.sub-ok      { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.sub-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.sub-expired { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.sub-orders  { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

.hours-bar { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-bottom: 12px; }

.btn-admin, .btn-close-admin {
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--r-md); padding: 10px 22px;
  font-size: var(--text-sm); font-weight: 700; cursor: pointer;
  transition: background 0.15s; width: 100%; font-family: 'Cairo', sans-serif;
}
.btn-admin:hover, .btn-close-admin:hover { background: var(--primary-dark); }

.dash-tab {
  background: transparent; border: 2px solid var(--primary);
  color: var(--primary); border-radius: var(--r-sm); padding: 7px 14px;
  cursor: pointer; font-size: var(--text-xs); font-weight: 700;
  transition: all 0.15s; font-family: 'Cairo', sans-serif;
}
.dash-tab.active, .dash-tab:hover { background: var(--primary); color: #fff; }

.orders-bar-bg   { background: var(--border); border-radius: 6px; height: 8px; overflow: hidden; }
.orders-bar-fill { height: 100%; border-radius: 6px; transition: width 0.4s; }

/* ════════════════════════════════════════════════════════
   POPULAR SECTION (Most requested badge style)
   ════════════════════════════════════════════════════════ */
.most-requested-wrap { position: relative; margin: 32px 12px 10px; }
.mr-badge {
  position: absolute; top: -18px; right: 20px; z-index: 10;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff; font-size: var(--text-xs);
  font-weight: 700; padding: 5px 16px; border-radius: var(--r-full);
  box-shadow: var(--shadow-md); pointer-events: none; white-space: nowrap;
}
.mr-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.mr-empty { text-align: center; color: var(--text-muted); font-size: var(--text-xs); padding: 28px 16px; }

/* ════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════ */
#site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: clamp(28px, 6vw, 56px) clamp(16px, 5vw, 48px) max(clamp(28px, 6vw, 56px), calc(28px + var(--safe-bottom)));
}

.footer-logo {
  font-family: 'Reem Kufi', 'Cairo', sans-serif;
  font-size: var(--text-xl);
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.footer-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-info a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.footer-info a:hover { color: var(--accent); }

.icon-svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

.footer-divider {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 18px 0;
}

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-full);
  text-decoration: none;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
}
.social-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.btn-maps      { background: linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335); }

.footer-dev {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════════
   FOOD COURT PORTAL STYLES (kept intact from script.js)
   ════════════════════════════════════════════════════════ */
/* These are injected dynamically via JS renderFoodCourtPortal() */

/* ════════════════════════════════════════════════════════
   STATUS PILL (Open / Closed) — Global
   ════════════════════════════════════════════════════════ */
.status-pill {
    position: absolute;
    top: max(12px, calc(12px + var(--safe-top)));
    inset-inline-end: 14px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: 'Cairo', sans-serif;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.status-pill:active {
    transform: scale(0.95);
}
.status-pill.status-open {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-pill.status-closed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ════════════════════════════════════════════════════════
   HOURS MODAL — Global
   ════════════════════════════════════════════════════════ */
.hours-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.hours-modal {
    background: var(--surface, #fff);
    color: var(--text, #1a1a1a);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}
.hours-modal h3 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    font-weight: 700;
}
.hours-details {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 18px;
}
.btn-hours-close {
    background: var(--primary, #333);
    color: var(--accent, #fff);
    border: none;
    padding: 10px 32px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-hours-close:active { opacity: 0.8; }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
