/* ==============================================================================
 * Clean Modern Restaurant UI System
 * Extracted from Reference Project: D:\سطح المكتب\New folder (4)\new
 * ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@500;700;900&display=swap');

:root {
  --color-primary: #FF3B3B;
  --color-primary-rgb: 255, 59, 59;
  --color-primary-hover: #E02A2A;
  --color-primary-light: #FDA4AF;

  --color-secondary: #181B24;
  --color-secondary-rgb: 24, 27, 36;
  --color-secondary-light: #222631;

  --color-accent: #F59E0B;
  --color-accent-rgb: 245, 158, 11;
  --color-accent-hover: #D97706;

  --bg-main: #FAF4EE;
  --text-main: #181B24;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

html, body {
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  max-width: 100%;
  width: 100%;
  min-height: 100%;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  font-size: clamp(14px, 0.875rem + 0.2vw, 16px);
}

/* Accessible Keyboard Focus Ring & Reduced-Motion Support */
:focus-visible {
  outline: 2px solid var(--theme-primary, var(--color-primary, #E11D48));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Strict Typography Containment for Arabic RTL */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.35;
  letter-spacing: normal;
  overflow-wrap: break-word;
}

p, span, div, a {
  overflow-wrap: break-word;
}

/* Global Safe Area & Touch Helpers */
.safe-bottom-pad {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  .safe-bottom-pad {
    padding-bottom: 2rem;
  }
}

/* ==========================================================================
   Admin Tables: Strict Non-Breaking Cells & Responsive Scrolling Protection
   ========================================================================== */
.table-responsive,
.table-responsive-wrapper,
.table-responsive-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.875rem;
  position: relative;
  box-sizing: border-box;
}

/* Ensure tables fit comfortably without unnecessary horizontal scroll while preserving safe cell widths */
table.table-admin,
table.admin-table,
.table-responsive > table,
.table-responsive-wrapper > table,
.table-responsive-container > table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

/* Override word-breaking inside table cells - never split words or numbers */
table, table th, table td,
table span, table div, table a, table p,
.table-responsive-wrapper *,
.table-responsive-container * {
  word-break: normal !important;
  overflow-wrap: normal !important;
}

table.table-admin th,
table.table-admin td,
table.admin-table th,
table.admin-table td,
.table-responsive-wrapper th,
.table-responsive-wrapper td,
.table-responsive-container th,
.table-responsive-container td {
  padding: 10px 12px !important;
  font-size: 0.8125rem !important;
  vertical-align: middle !important;
}

/* Strict non-wrapping for codes, PINs, phones, dates, prices, and badges */
.cell-nowrap,
.cell-code,
.cell-phone,
.cell-pin,
.cell-price,
.cell-date,
.cell-badge,
table.table-admin .font-mono,
table.admin-table .font-mono,
.table-responsive-wrapper .font-mono,
.table-responsive-container .font-mono,
td .font-mono,
th .font-mono {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

/* PIN code display: tabular numbers, monospaced, zero wrapping */
.cell-pin,
td .cell-pin {
  display: inline-block;
  white-space: nowrap !important;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  font-family: monospace, 'Courier New', Courier;
}

/* Phone numbers formatting: always LTR with clean non-breaking display */
.cell-phone,
td .cell-phone {
  white-space: nowrap !important;
  direction: ltr !important;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  unicode-bidi: embed;
}

/* Status badges and pills: never break across lines */
table.table-admin span[class*="rounded-full"],
table.table-admin span[class*="rounded-xl"],
table.table-admin span[class*="rounded-lg"],
table.table-admin span[class*="rounded-md"],
table.admin-table span[class*="rounded-full"],
table.admin-table span[class*="rounded-xl"],
table.admin-table span[class*="rounded-lg"],
table.admin-table span[class*="rounded-md"],
.table-responsive-wrapper span[class*="rounded-full"],
.table-responsive-wrapper span[class*="rounded-xl"],
.table-responsive-wrapper span[class*="rounded-lg"],
.table-responsive-wrapper span[class*="rounded-md"],
.table-responsive-container span[class*="rounded-full"],
.table-responsive-container span[class*="rounded-xl"],
.table-responsive-container span[class*="rounded-lg"],
.table-responsive-container span[class*="rounded-md"],
.cell-badge {
  white-space: nowrap !important;
  word-break: keep-all !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  max-width: max-content;
}

/* Action button groups: strictly single horizontal row, never wrap or stack vertically */
.action-buttons-group,
td .action-buttons-group,
table.table-admin td > .flex-wrap,
table.admin-table td > .flex-wrap,
.table-responsive-wrapper td > .flex-wrap,
.table-responsive-container td > .flex-wrap {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  white-space: nowrap !important;
  vertical-align: middle;
}

.action-buttons-group > button,
.action-buttons-group > a,
.action-buttons-group > form,
.action-buttons-group > form > button {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   Storefront Floating Action Buttons & iOS Safe Area Responsive Architecture
   (Voice Order "اطلب بصوتك", Spin Wheel "دوّر واكسب", Sticky Cart Bar, PWA Bottom Nav)
   ========================================================================== */

/* PWA Bottom Navigation Bar Safe Area Containment */
#mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Base Responsive Positioning for Floating Spin to Win Widget (Pinned to Right) */
#floating-spin-btn {
  position: fixed !important;
  z-index: 45 !important;
  right: 14px !important;
  left: auto !important;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  transition: bottom 0.25s ease, transform 0.2s ease, opacity 0.25s ease, box-shadow 0.2s ease !important;
}

/* Base Responsive Positioning for Floating Voice Order Button (Pinned to Opposite Left) */
#floating-voice-wrapper {
  position: fixed !important;
  z-index: 45 !important;
  left: 14px !important;
  right: auto !important;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  display: inline-flex !important;
  align-items: center !important;
  border-radius: 9999px !important;
  padding: 3px 5px !important;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.28), 0 4px 10px -2px rgba(0, 0, 0, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background-color: var(--theme-primary, #E11D48) !important;
  color: var(--theme-primary-text, #ffffff) !important;
  transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease, opacity 0.25s ease, box-shadow 0.2s ease !important;
}

#floating-voice-btn {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: inherit !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

/* Floating Action Buttons Dismissed State */
html.hide-spin-btn #floating-spin-btn,
body.hide-spin-btn #floating-spin-btn,
#floating-spin-btn.is-dismissed {
  display: none !important;
}

html.hide-voice-btn #floating-voice-wrapper,
body.hide-voice-btn #floating-voice-wrapper,
#floating-voice-wrapper.is-dismissed {
  display: none !important;
}

/* Floating Action Buttons Circular Close Badges */
.floating-btn-close-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: auto !important;
  flex-shrink: 0 !important;
}

/* Sticky Bottom Cart Bar Safe Area Elevation */
@media (max-width: 768px) {
  #sticky-cart-bar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Dynamic Bottom Elevation when Cart is Active (+64px additional elevation) */
body.has-floating-cart #floating-spin-btn,
body.has-active-cart #floating-spin-btn {
  bottom: calc(138px + env(safe-area-inset-bottom, 0px)) !important;
}

body.has-floating-cart #floating-voice-wrapper,
body.has-active-cart #floating-voice-wrapper {
  bottom: calc(138px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Dynamic Bottom Elevation when Dine-In Table Bar is Active (Prevent button overlap) */
@media (max-width: 768px) {
  body.has-table-bar #floating-spin-btn,
  body.has-table-bar #floating-voice-wrapper {
    bottom: calc(185px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (min-width: 769px) {
  body.has-table-bar #floating-spin-btn,
  body.has-table-bar #floating-voice-wrapper {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Smart Visibility & Z-Index Hierarchy during Geolocation Prompt */
body.has-geo-prompt #floating-voice-wrapper,
body.has-geo-prompt #floating-spin-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateY(20px) scale(0.85) !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease !important;
}

@media (max-width: 768px) {
  body.has-geo-prompt #floating-voice-wrapper,
  body.has-geo-prompt #floating-spin-btn {
    bottom: calc(185px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Desktop Viewports (>= 769px): No bottom navigation bar */
@media (min-width: 769px) {
  #floating-spin-btn {
    right: 24px !important;
    left: auto !important;
    bottom: 24px !important;
  }
  #floating-voice-wrapper {
    left: 24px !important;
    right: auto !important;
    bottom: 24px !important;
  }
  body.has-floating-cart #floating-spin-btn,
  body.has-active-cart #floating-spin-btn {
    bottom: 88px !important;
  }
  body.has-floating-cart #floating-voice-wrapper,
  body.has-active-cart #floating-voice-wrapper {
    bottom: 88px !important;
  }
}

/* Compact Aesthetic Adaptation for Small Mobile Viewports (<= 480px, iPhone SE, 12/13/14/15/16 Pro) */
@media (max-width: 480px) {
  #floating-spin-btn {
    padding: 7px 11px !important;
    gap: 5px !important;
    font-size: 11px !important;
    max-height: 44px !important;
    border-radius: 9999px !important;
  }
  #floating-spin-btn span.animate-spin {
    font-size: 16px !important;
  }

  #floating-voice-wrapper {
    padding: 2px 4px !important;
  }
  #floating-voice-btn {
    padding: 3px 6px !important;
    gap: 5px !important;
    font-size: 11px !important;
    max-height: 38px !important;
  }
  #floating-voice-btn .voice-btn-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }
  #floating-voice-btn .voice-btn-badge {
    display: none !important;
  }
}

/* ==========================================================================
   Cart Drawer & Checkout Vertical Compact Upsell ("✨ أكمل وجبتك اللذيذة مع")
   ========================================================================== */
#cross-sell-items,
#checkout-upsell-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: visible !important;
}

.upsell-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 10px !important;
  transition: all 0.15s ease-in-out !important;
}

.upsell-row:hover {
  border-color: rgba(225, 29, 72, 0.35) !important;
  background-color: #fff1f2 !important;
}

/* Touch Friendly Button Sizing */
button, a.btn, input[type="button"], input[type="submit"] {
  touch-action: manipulation;
}

/* Custom Clean Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Marquee Promo Bar */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: inline-flex;
  animation: marquee 25s linear infinite;
}

[dir="rtl"] .animate-marquee {
  animation-direction: reverse;
}

/* Shimmer Loading Effect */
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-shimmer {
  position: relative;
  overflow: hidden;
}
.skeleton-shimmer::after {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.4) 60%, rgba(255,255,255,0));
  animation: shimmer 1.5s infinite;
  content: '';
}

/* ==========================================================================
   Storefront Hero Slider - High-Contrast White Typography & RTL Gradient Overrides
   ========================================================================== */
#store-hero-slider,
#heroCarousel {
  position: relative;
  overflow: hidden !important;
}

#heroSlidesWrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  border-radius: inherit;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.hero-slide:not(.is-active) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

.hero-slide.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 10 !important;
}

/* Force Razor-Sharp White Typography */
#store-hero-slider .hero-slide h1,
#store-hero-slider .hero-slide h2,
#store-hero-slider .hero-slide-title,
.hero-slide h1,
.hero-slide h2,
.hero-slide-title {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65) !important;
  letter-spacing: -0.01em;
}

#store-hero-slider .hero-slide p,
#store-hero-slider .hero-slide-subtitle,
.hero-slide p,
.hero-slide-subtitle {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6) !important;
  line-height: 1.6;
}

#store-hero-slider .hero-slide-badge {
  color: #FFFFFF !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(10, 14, 23, 0.88) 0%, rgba(10, 14, 23, 0.62) 55%, rgba(10, 14, 23, 0.25) 100%) !important;
  pointer-events: none;
}

@media (max-width: 639px) {
  .hero-slide-overlay {
    background: linear-gradient(to top, rgba(10, 14, 23, 0.95) 0%, rgba(10, 14, 23, 0.75) 55%, rgba(10, 14, 23, 0.35) 100%),
                linear-gradient(270deg, rgba(10, 14, 23, 0.88) 0%, rgba(10, 14, 23, 0.62) 55%, rgba(10, 14, 23, 0.25) 100%) !important;
  }
}

.hero-slide-img {
  filter: brightness(0.92) contrast(1.05) !important;
}

/* Admin Search Target Focus & Pulse Effect */
.search-target-highlight {
  animation: searchTargetPulse 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  scroll-margin-top: 120px;
}

@keyframes searchTargetPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.75);
    outline: 3px solid #E11D48;
    outline-offset: 3px;
    border-radius: 1rem;
  }
  30% {
    box-shadow: 0 0 0 10px rgba(225, 29, 72, 0.35);
    outline: 3px solid #E11D48;
    outline-offset: 3px;
    border-radius: 1rem;
  }
  70% {
    box-shadow: 0 0 0 16px rgba(225, 29, 72, 0);
    outline: 2px solid #E11D48;
    outline-offset: 3px;
    border-radius: 1rem;
  }
  100% {
    box-shadow: none;
    outline: none;
    outline-offset: 0;
  }
}

/* Brand Identity Stack & Branch Selector */
.brand-wrapper {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.brand-name-link {
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.25;
  color: #0F172A;
  text-decoration: none;
  transition: color 0.2s ease;
}

.brand-name-link:hover {
  color: var(--color-primary, #E11D48);
}

.brand-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.branch-selector-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 6px;
  background-color: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.85);
  color: #334155;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
}

.branch-selector-pill:hover {
  background-color: #E2E8F0;
  border-color: #CBD5E1;
}

.branch-selector-pill select {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1E293B;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  line-height: 1.2;
}

[dir="rtl"] .branch-selector-pill select {
  padding-left: 14px;
  padding-right: 0;
}

[dir="ltr"] .branch-selector-pill select {
  padding-right: 14px;
  padding-left: 0;
}

.branch-selector-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 8px;
  color: #64748B;
  user-select: none;
}

[dir="rtl"] .branch-selector-arrow {
  left: 6px;
}

[dir="ltr"] .branch-selector-arrow {
  right: 6px;
}

/* Sticky Category & Quick Filter Navigation Bar (Grid Architecture) */
.sticky-category-nav {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-height, 56px) !important;
  z-index: 40;
  background-color: var(--theme-header-bg, rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--theme-card-border, #e2e8f0);
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.05);
  transition: top 0.2s ease, box-shadow 0.2s ease;
  height: auto;
}

@media (max-width: 767px) {
  .sticky-category-nav {
    top: var(--header-height, 56px) !important;
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 768px) {
  .sticky-category-nav {
    top: var(--header-height, 64px) !important;
    max-height: none;
    overflow: visible;
  }
}

/* Category Horizontal Scrollable Navigation (Sleek Single-Row Across All Viewports) */
.category-pills-container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 4px 6px 4px;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  box-sizing: border-box;
  overscroll-behavior-x: contain;
}

.category-pills-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Category Horizontal Pill Button */
.menu-filter-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  width: auto !important;
  min-height: 38px;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.45rem 1.1rem;
  border-radius: var(--theme-btn-radius, 9999px);
  background-color: var(--theme-category-pill-bg, #f1f5f9);
  color: var(--theme-category-pill-text, #334155);
  border: 1px solid var(--theme-card-border, rgba(226, 232, 240, 0.8));
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-sizing: border-box;
  text-decoration: none;
  white-space: nowrap !important;
}

.menu-filter-pill span {
  display: inline-block;
  width: auto;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap !important;
  text-align: center;
}

/* Admin Menu Status Filter Pills (Compact Horizontal Row Override) */
#menuStatusFilterPills .admin-filter-pill,
#menuStatusFilterPills .menu-filter-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: auto !important;
  min-height: unset !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
}

#menuStatusFilterPills .admin-filter-pill span,
#menuStatusFilterPills .menu-filter-pill span {
  display: inline !important;
  width: auto !important;
  white-space: nowrap !important;
  text-align: inherit !important;
}

.menu-filter-pill:hover {
  background-color: var(--theme-category-pill-hover-bg, #e2e8f0);
  color: var(--theme-text-main, #0f172a);
  border-color: var(--theme-card-border, #cbd5e1);
  transform: translateY(-1px);
}

.menu-filter-pill.active {
  background-color: var(--theme-primary, #E11D48) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  border-color: transparent !important;
  transform: scale(1.02);
}

/* Scroll Offset Anchor Spacing */
.scroll-mt-36,
.category-block,
#section-trending,
#section-spotlight,
#menu {
  scroll-margin-top: calc(56px + 52px + 14px);
}

@media (min-width: 640px) {
  .scroll-mt-36,
  .category-block,
  #section-trending,
  #section-spotlight,
  #menu {
    scroll-margin-top: calc(64px + 52px + 14px);
  }
}

.store-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
}

.store-brand-logo img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* Footer Column Headings High-Contrast Legibility */
.footer-column-heading,
footer h4.footer-column-heading,
[data-store-theme] footer h4.footer-column-heading {
  color: #FFFFFF !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}

/* ==========================================================================
   Conditional Progressive-Disclosure Settings Cards & Grid Architecture
   ========================================================================== */
.settings-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start !important; /* Critical: collapsed cards don't stretch */
}

@media (min-width: 768px) {
  .settings-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .settings-cards-grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1.5rem;
  align-self: start;
}

.feature-card.is-inactive {
  opacity: 0.88;
  background-color: rgba(248, 250, 252, 0.7);
  border-color: #e2e8f0;
}

.feature-card.is-inactive.dark-theme-card {
  opacity: 0.82;
  background-color: rgba(15, 23, 42, 0.85);
  border-color: #334155;
}

.feature-card.is-active {
  opacity: 1;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.feature-card.is-active:not(.dark-theme-card) {
  border-color: rgba(244, 63, 94, 0.35); /* Subtle rose highlight */
}

.feature-card.is-active.dark-theme-card {
  border-color: rgba(245, 158, 11, 0.45); /* Subtle amber highlight */
}

.feature-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.feature-card-body {
  transition: all 0.25s ease;
}

.feature-card-body.collapsed {
  display: none !important;
}

.feature-card-body.expanded {
  display: block !important;
}

/* 2-Column Inner Form Controls Grid */
.feature-inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .feature-inputs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature-inputs-grid .col-span-full {
  grid-column: 1 / -1;
}

/* Modern Pill Toggle Switch */
.modern-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.modern-toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.modern-toggle-track {
  width: 2.75rem;
  height: 1.5rem;
  background-color: #cbd5e1;
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.dark-theme-card .modern-toggle-track {
  background-color: #475569;
}

.modern-toggle-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RTL translation: when checked, slide left (or in RTL, translate -1.25rem) */
html[dir="rtl"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb,
body[dir="rtl"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb,
[dir="rtl"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb {
  transform: translateX(-1.25rem);
}

html[dir="ltr"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb,
body[dir="ltr"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb,
[dir="ltr"] .modern-toggle-switch input:checked + .modern-toggle-track .modern-toggle-thumb {
  transform: translateX(1.25rem);
}

.modern-toggle-switch input:checked + .modern-toggle-track {
  background-color: #e11d48; /* Primary rose */
}

.dark-theme-card .modern-toggle-switch input:checked + .modern-toggle-track {
  background-color: #10b981; /* Emerald/amber for dark cards */
}

/* ==============================================================================
 * Blind Cash Reconciliation & Z-Report Accessible UI/UX Styles
 * ============================================================================== */
.blind-cash-banner,
.alert-blind-reconciliation {
  background-color: #FEF3C7 !important;
  border: 1px solid #F59E0B !important;
  color: #5C2D0C !important;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15) !important;
}

.blind-cash-banner strong,
.blind-cash-banner .alert-heading,
.alert-blind-reconciliation strong,
.alert-blind-reconciliation .alert-heading {
  color: #92400E !important;
  font-weight: 800 !important;
}

.blind-cash-banner p,
.blind-cash-banner .alert-body,
.alert-blind-reconciliation p,
.alert-blind-reconciliation .alert-body {
  color: #5C2D0C !important;
  line-height: 1.6 !important;
}

/* Z-Report Card Layout & Unclipped Container */
.z-report-scroll-wrapper {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 50px !important;
}

.z-report-card {
  box-sizing: border-box;
  padding-bottom: 40px !important;
  overflow: visible !important;
}

.z-report-key-value-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  width: 100%;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.z-report-key-value-row:last-child {
  border-bottom: none;
}

.z-report-key-value-row span:last-child {
  white-space: nowrap !important;
  text-align: left;
}

.z-report-badge-bracket {
  white-space: nowrap !important;
  display: inline-block !important;
  direction: rtl !important;
  unicode-bidi: embed !important;
}

/* ==========================================================================
   Tablet & Medium Desktop Breakpoint (<= 1180px) Header Architecture
   ========================================================================== */
@media (max-width: 1180px) {
  .desktop-nav {
    display: none !important;
  }
  .mobile-nav-toggle {
    display: inline-flex !important;
  }
  .desktop-wa-btn {
    display: none !important;
  }
}

@media (min-width: 1180.02px) {
  .desktop-nav {
    display: flex !important;
  }
  .mobile-nav-toggle {
    display: none !important;
  }
  .desktop-wa-btn {
    display: inline-flex !important;
  }
  .mobile-tablet-backdrop,
  .mobile-tablet-drawer {
    display: none !important;
  }
}

/* Operational Status Pill & Branch Selector Alignment */
.brand-meta-row {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.brand-status-badge,
.branch-selector-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

/* Header Action Shield: Never Clip Left Edge */
.store-cart-btn {
  flex-shrink: 0 !important;
  margin-left: 0 !important;
}

/* ==========================================================================
   Storefront Mobile Viewport Zero-Overflow & Container Containment (360px - 768px)
   ========================================================================== */
.top-ticker-wrapper,
.top-ticker,
.store-header,
.storefront-header,
.header-main-row,
.header-mobile-meta-row,
#store-hero-slider,
#heroCarousel,
#menu,
.menu-grid,
.menu-search-box,
#sticky-cart-bar {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Top Announcement Ticker Mobile Containment */
.top-ticker-wrapper {
  width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  .top-ticker-content {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .top-ticker-badge {
    flex-shrink: 0 !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  .top-ticker-link {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}

/* 2-Row Mobile Header Architecture (<= 768px) */
@media (max-width: 768px) {
  .header-main-row {
    height: 56px !important;
  }
  .header-brand-side {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .brand-name-link {
    max-width: 100% !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .header-mobile-meta-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 6px 12px !important;
    background: rgba(248, 250, 252, 0.95) !important;
    border-top: 1px solid #F1F5F9 !important;
  }
  .branch-selector-pill-mobile {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  }
  .branch-selector-pill-mobile select {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
  }
  .mobile-live-status-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  }
}

/* Responsive Hero Slider & Search Input Mobile Overrides (<= 640px) */
@media (max-width: 640px) {
  #store-hero-slider {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 10px !important;
    padding-bottom: 8px !important;
  }

  #heroCarousel {
    min-height: 275px !important;
    height: 275px !important;
    border-radius: 18px !important;
  }

  .hero-slide-content {
    padding-top: 1rem !important;
    padding-bottom: 2.5rem !important;
    padding-inline-start: 1rem !important;
    padding-inline-end: 2.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.35rem !important;
  }

  .hero-slide-title {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.15rem !important;
  }

  .hero-slide-subtitle {
    font-size: 11px !important;
    line-height: 1.35 !important;
    -webkit-line-clamp: 2 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .hero-slide-price {
    padding-top: 0 !important;
    gap: 6px !important;
  }

  .hero-slide-price span {
    font-size: 1rem !important;
  }

  /* Shoppable CTA Button inside Hero on Mobile */
  .hero-slide-content button,
  .hero-slide-content a[class*="inline-flex"] {
    padding: 0.45rem 0.85rem !important;
    font-size: 11px !important;
    border-radius: 12px !important;
  }

  /* Navigation Arrows on Mobile */
  #heroPrevBtn,
  #heroNextBtn {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
    z-index: 25 !important;
  }
  #heroPrevBtn {
    right: 6px !important;
  }
  #heroNextBtn {
    left: 6px !important;
  }

  /* Pagination Dots on Mobile: Sit safely below CTA button without overlap */
  #heroDotsWrapper {
    bottom: 6px !important;
    z-index: 20 !important;
  }
  #heroDotsWrapper button,
  #heroDotsWrapper .hero-dot {
    width: 6px !important;
    height: 6px !important;
  }
}

/* Search Bar Mobile Precision & Vertical Centering */
#menu-search-input {
  height: 46px !important;
  min-height: 46px !important;
  line-height: 46px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

[dir="rtl"] #menu-search-input {
  padding-right: 2.75rem !important;
  padding-left: 2.5rem !important;
}

[dir="ltr"] #menu-search-input {
  padding-left: 2.75rem !important;
  padding-right: 2.5rem !important;
}

#menu-search-input::placeholder {
  line-height: normal !important;
  opacity: 0.65;
}

@media (max-width: 640px) {
  .menu-search-box {
    padding: 12px !important;
    border-radius: 18px !important;
  }
}

/* ==========================================================================
   Auto-Geo Nearest Branch Banner Positioning & High-Contrast Typography
   ========================================================================== */
#first-visit-geo-prompt {
  position: fixed !important;
  z-index: 1000 !important;
  background-color: #0F172A !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.5), 0 10px 15px -5px rgba(0, 0, 0, 0.3) !important;
  transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
  box-sizing: border-box !important;
}

/* Tablet and Desktop Viewports (> 768px) */
@media (min-width: 768.02px) {
  #first-visit-geo-prompt {
    right: 16px !important;
    left: auto !important;
    width: 420px !important;
    max-width: calc(100vw - 32px) !important;
    bottom: 20px !important;
  }
  body.has-active-cart #first-visit-geo-prompt,
  #first-visit-geo-prompt.has-active-cart {
    bottom: 92px !important;
  }
}

/* Mobile Viewports (<= 768px) */
@media (max-width: 768px) {
  #first-visit-geo-prompt {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    bottom: 68px !important;
    border-radius: 16px !important;
  }
  body.has-active-cart #first-visit-geo-prompt,
  #first-visit-geo-prompt.has-active-cart {
    bottom: 130px !important;
  }
}

#first-visit-geo-prompt h4,
#first-visit-geo-prompt .geo-prompt-title,
#first-visit-geo-prompt h4 span {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

#first-visit-geo-prompt p,
#first-visit-geo-prompt .geo-prompt-desc {
  color: #E2E8F0 !important;
  font-weight: 500 !important;
}

#first-visit-geo-prompt #geo-prompt-detect-btn,
#first-visit-geo-prompt button {
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  touch-action: manipulation !important;
  position: relative !important;
  z-index: 1001 !important;
}

/* ==========================================================================
   Tablet Hero Slider Precision & Boundary Shield (768px - 1024px)
   ========================================================================== */
#store-hero-slider {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#heroCarousel {
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .hero-slide-content {
    padding-inline-start: 4.25rem !important;
    padding-inline-end: 3.25rem !important;
    max-width: calc(100% - 1rem) !important;
    box-sizing: border-box !important;
  }
  .hero-slide-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }
  .hero-slide-subtitle {
    font-size: 0.85rem !important;
    max-width: 90% !important;
  }
}

/* ==========================================================================
   Wajba Go POS - Fixed Vertical Category Sidebar & Header Layout
   ========================================================================== */
.pos-category-sidebar {
  width: 185px;
  min-width: 175px;
  max-width: 195px;
  height: 100%;
  flex-shrink: 0;
  background-color: #ffffff;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.pos-category-list {
  flex: 1 1 0%;
  overflow-y: auto;
  overflow-x: hidden;
}

.pos-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.15s ease-in-out;
  text-align: right;
  touch-action: manipulation;
  user-select: none;
}

.pos-cat-btn.active {
  background-color: #E11D48 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.pos-cat-btn.active .pos-cat-count {
  background-color: rgba(0, 0, 0, 0.22) !important;
  color: #ffffff !important;
}

@media (max-width: 992px) {
  .pos-category-sidebar {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
  }
  .pos-category-sidebar .pos-cat-btn {
    padding: 0.5rem 0.4rem !important;
    min-height: 44px !important;
  }
  .pos-category-sidebar .pos-cat-btn span.truncate {
    font-size: 11px !important;
  }
  .pos-category-sidebar .pos-cat-count {
    display: none !important;
  }
}

@media (max-width: 640px) {
  #pos-col-menu {
    flex-direction: column !important;
  }
  .pos-category-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 130px !important;
    border-left: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .pos-category-sidebar .pos-category-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    padding: 0.4rem !important;
    overflow-y: auto !important;
  }
  .pos-category-sidebar .pos-cat-btn {
    width: auto !important;
    flex: 1 1 calc(50% - 0.35rem) !important;
    min-height: 38px !important;
    padding: 0.35rem 0.5rem !important;
  }
  .pos-category-sidebar .pos-cat-count {
    display: inline-block !important;
  }
}

.pos-header-btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   Global Mobile Input Auto-Zoom Elimination (iOS Safari & Android Browsers)
   Enforces 16px font-size on all form elements below 1024px to prevent WebKit/Blink auto-zoom
   ========================================================================== */
@media screen and (max-width: 1024px) {
  input,
  select,
  textarea,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  .form-control,
  .form-input,
  .form-select,
  .swal2-input,
  .swal2-select,
  .swal2-textarea {
    font-size: 16px !important;
    max-height: none;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    touch-action: manipulation !important;
  }
}

/* Voice Order Audio Frequency Waves (Task 15) */
@keyframes voiceWavePulse {
  0%, 100% {
    height: 6px;
    opacity: 0.6;
  }
  50% {
    height: 28px;
    opacity: 1;
  }
}

.voice-wave-bar {
  animation: voiceWavePulse 0.9s ease-in-out infinite;
}

.voice-wave-bar:nth-child(1) { animation-delay: 0.1s; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.25s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.4s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.35s; }

/* ==========================================================================
   Fluid Multi-Breakpoint Calibration Engine (7 Viewports: 360px - 1920px)
   ========================================================================== */

/* 1. Fluid Typography Engine (KaTeX / Headings / KPI Numbers / Modals) */
.fluid-stat-number {
  font-size: clamp(1.25rem, 1rem + 1vw, 2rem) !important;
  line-height: 1.2 !important;
}

.fluid-stat-title {
  font-size: clamp(0.72rem, 0.68rem + 0.25vw, 0.875rem) !important;
  line-height: 1.3 !important;
}

.fluid-heading-1 {
  font-size: clamp(1.35rem, 1.1rem + 1.25vw, 2.25rem) !important;
  line-height: 1.25 !important;
}

.fluid-heading-2 {
  font-size: clamp(1.15rem, 1rem + 0.75vw, 1.75rem) !important;
  line-height: 1.3 !important;
}

.fluid-card-title {
  font-size: clamp(0.85rem, 0.8rem + 0.35vw, 1.125rem) !important;
}

/* 2. Admin KPI Auto-Fit Responsive Grid */
.admin-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
  gap: 1rem !important;
}

/* 3. Dynamic Viewports (100dvh) & Safe Area Insets (iOS Safari & Chrome Android) */
#cart-drawer {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain !important;
}

#cart-drawer-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

#cart-drawer-footer {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  z-index: 20 !important;
  padding-bottom: max(1rem, calc(0.75rem + env(safe-area-inset-bottom, 12px))) !important;
  background-color: #f8fafc !important;
  box-shadow: 0 -4px 14px 0 rgba(0, 0, 0, 0.06) !important;
}

/* Single Compact Upsell Row inside Cart Drawer (Max Height 65px) */
#cross-sell-container {
  max-height: 65px !important;
  box-sizing: border-box !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
  overflow: hidden !important;
}

.single-compact-upsell-wrapper {
  display: block !important;
  width: 100% !important;
}

.upsell-single-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  padding: 0.25rem 0.65rem !important;
  min-height: 32px !important;
  max-height: 36px !important;
  box-sizing: border-box !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(244, 63, 94, 0.25) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
}

.upsell-single-row:hover {
  border-color: #f43f5e !important;
  background-color: #fff1f2 !important;
}

#cart-drawer > div:last-child {
  padding-bottom: max(1rem, calc(0.75rem + env(safe-area-inset-bottom, 0px))) !important;
}

#mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: calc(3.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* ==============================================================================
   GLOBAL MODAL SCROLL & MOBILE VIEWPORT RESILIENCE (Touch / Scroll / Sticky)
   ============================================================================== */
.modal,
.modal-overlay,
.modal-backdrop,
[id$="Modal"],
[id$="-modal"],
[id*="modal-"],
[class*="modal-overlay"] {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  align-items: flex-start !important;
  padding: 12px !important;
  box-sizing: border-box !important;
}

@media (min-width: 640px) {
  .modal,
  .modal-overlay,
  .modal-backdrop,
  [id$="Modal"],
  [id$="-modal"],
  [id*="modal-"] {
    align-items: center !important;
    padding: 16px !important;
  }
}

.modal-content,
.modal-dialog,
.modal-box,
.modal-card,
.modal-container-card,
[id$="Modal"] > div,
[id$="-modal"] > div,
[id*="modal-"] > div {
  max-height: 90vh !important;
  max-height: 88dvh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

/* Sticky Modal Footer Actions Bar */
.modal-footer,
.modal-actions,
.modal-sticky-footer,
[id$="Modal"] form > div:last-child,
[id$="-modal"] form > div:last-child {
  position: -webkit-sticky !important;
  position: sticky !important;
  bottom: -1px !important;
  background: inherit !important;
  background-color: #ffffff !important;
  z-index: 20 !important;
  padding-top: 12px !important;
  padding-bottom: 4px !important;
}

/* Dark Mode / Slate Modal Footers */
.dark .modal-footer,
.dark .modal-actions,
.dark .modal-sticky-footer,
.dark [id$="Modal"] form > div:last-child,
.bg-slate-900 .modal-footer,
.bg-slate-900 .modal-sticky-footer,
.bg-slate-900 [id$="Modal"] form > div:last-child,
.bg-slate-950 .modal-footer,
.bg-slate-950 .modal-sticky-footer,
.bg-slate-950 [id$="Modal"] form > div:last-child {
  background-color: #0F172A !important;
}

/* 4. Table Responsive Horizontal Guard */
.admin-main-wrapper table:not(.no-auto-responsive) {
  min-width: 600px;
}

.admin-main-wrapper div:has(> table) {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* 5. Touch Target Ergonomics for Mobile/Touch Devices (min-height 42px) */
@media (pointer: coarse), (max-width: 1024px) {
  button:not(.btn-compact):not(.swal2-close):not(.floating-btn-close-icon):not([class*="close-btn"]):not(.text-xs):not(.text-\[10px\]):not(.text-\[9px\]):not(.w-6):not(.w-7):not(.w-8):not(.h-6):not(.h-7):not(.h-8),
  .station-btn,
  .menu-filter-pill,
  .mode-btn,
  a.btn,
  .btn-primary,
  a[role="button"] {
    min-height: 42px !important;
  }
}

/* 6. Universal Admin KPI Cards Auto-Fit Grid */
.admin-kpi-grid,
.kpi-grid,
[class*="kpi-grid"],
.grid-kpi {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
  gap: clamp(0.75rem, 1vw + 0.5rem, 1.25rem) !important;
}

/* 7. Universal Responsive Table Scroller Protection */
.table-responsive,
.table-responsive-wrapper,
.table-responsive-container,
.admin-table-container,
.admin-main-wrapper div:has(> table) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
}

/* 8. Fluid Typography & Spacing Helpers (200% Zoom Resilient) */
.text-fluid-xs { font-size: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem) !important; }
.text-fluid-sm { font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.925rem) !important; }
.text-fluid-base { font-size: clamp(0.925rem, 0.875rem + 0.25vw, 1.05rem) !important; }
.text-fluid-lg { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem) !important; }
.text-fluid-xl { font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.65rem) !important; }
.text-fluid-2xl { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem) !important; }

/* 9. Logical Properties & Orientation Preserving Helpers */
[dir="rtl"] .ltr-only,
[dir="rtl"] .numeric-value,
[dir="rtl"] .phone-display,
[dir="rtl"] .code-badge {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
}

/* 10. Form Control Touch Targets on Mobile/Tablet */
@media (max-width: 1024px) {
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  select,
  textarea,
  .form-input,
  .form-select {
    min-height: 44px;
    font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
  }
}

/* 11. Impeccable Hardening: Field Errors & Mobile Form Robustness */
.field-err {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  display: none;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px #dc2626 !important;
}

.wrap-break {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* 12. Impeccable Optimize, Adapt & Typeset Systems */
/* 12.1 Typography: Balanced Headings & Pretty Body Flow */
h1, h2, h3, h4, .text-balance {
  text-wrap: balance;
}

p, .text-pretty {
  text-wrap: pretty;
}

/* 12.2 Tabular Numerals for Cart, Checkout, Prices and Totals */
.tnum,
.font-mono,
.numeric-value,
.phone-display {
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

/* 12.3 High-Performance Rendering (CSS Containment & Off-screen Deferral) */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 280px;
}

/* 12.4 Safe Area Inset Support for Modern Mobile Viewports */
.safe-area-bottom {
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
}

.safe-area-bottom-bar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 12.5 P5 QA Polish: Tabular Numerics & Precision Hairline Borders */
.tabular-nums,
.font-mono,
.pos-price,
.cart-subtotal,
.cart-total-value,
#cartGrandTotal,
#displayGrandTotal,
.kds-timer,
.receipt-number,
.price-tag,
td.num-cell,
th.num-cell {
  font-variant-numeric: tabular-nums !important;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
}

.hairline-border {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}
.dark .hairline-border {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 12.6 Admin Shell Warm 60/30/10 Ivory & Vanilla Surface Polish (Light Mode Only) */
html:not(.dark) body.admin-shell {
  background-color: #F0E6DC !important;
}
html:not(.dark) body.admin-shell main .bg-white {
  background-color: #FFFDF9 !important;
}
html:not(.dark) body.admin-shell main thead,
html:not(.dark) body.admin-shell main thead tr,
html:not(.dark) body.admin-shell main .bg-slate-50 {
  background-color: #EFE6DC !important;
}
html:not(.dark) body.admin-shell main tbody tr:nth-child(even) {
  background-color: rgba(244, 236, 228, 0.55);
}
html:not(.dark) body.admin-shell main .border-slate-200,
html:not(.dark) body.admin-shell main .border-slate-100 {
  border-color: #E4D8CC !important;
}

/* 12.7 Arabic Typography Readability Floor (Prevent Micro-Text < 12px) */
.text-\[9px\],
.text-\[10px\] {
  font-size: 0.75rem !important; /* 12px */
  line-height: 1.45 !important;
}

.text-\[11px\] {
  font-size: 0.8125rem !important; /* 13px */
  line-height: 1.5 !important;
}

body.admin-shell .text-xs,
table .text-xs {
  font-size: 0.84375rem !important; /* 13.5px */
  line-height: 1.55 !important;
}

body.admin-shell table td,
body.admin-shell table th {
  font-size: 0.84375rem;
}

body.admin-shell input,
body.admin-shell select,
body.admin-shell textarea {
  font-size: 0.875rem !important; /* 14px */
}











