/* ==========================================================================
   Lavie Cafe — Premium Digital Menu Stylesheet
   تصميم وهوية كافيه لا في (تصميم عصري فخم مستوحى من القهوة المختصة)
   ========================================================================== */

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

:root {
  /* Color Palette - Dark Espresso Luxury (Default) */
  --bg-primary: #0F0A07;
  --bg-secondary: #17100B;
  --bg-card: #211710;
  --bg-card-hover: #2B1E16;
  --bg-surface: rgba(33, 23, 16, 0.75);
  --bg-glass: rgba(23, 16, 11, 0.85);

  --accent-gold: #D4A373;
  --accent-gold-hover: #E29547;
  --accent-gold-glow: rgba(212, 163, 115, 0.3);
  --accent-amber: #F59E0B;
  --accent-green: #10B981;
  --accent-green-hover: #059669;
  --accent-rose: #F43F5E;
  
  --text-primary: #FDFBF7;
  --text-secondary: #D1C7BD;
  --text-muted: #8F8174;
  --text-gold: #E5B282;

  --border-subtle: rgba(212, 163, 115, 0.15);
  --border-active: rgba(212, 163, 115, 0.45);
  --border-card: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 8px 25px rgba(212, 163, 115, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light / Warm Latte Theme */
[data-theme="light"] {
  --bg-primary: #F8F5F0;
  --bg-secondary: #EDE4D8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FCFAF7;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(248, 245, 240, 0.92);

  --accent-gold: #9C663A;
  --accent-gold-hover: #7F4F24;
  --accent-gold-glow: rgba(156, 102, 58, 0.2);
  --accent-amber: #D97706;
  
  --text-primary: #23160D;
  --text-secondary: #584333;
  --text-muted: #8A7565;
  --text-gold: #9C663A;

  --border-subtle: rgba(156, 102, 58, 0.15);
  --border-active: rgba(156, 102, 58, 0.4);
  --border-card: rgba(0, 0, 0, 0.06);

  --shadow-sm: 0 4px 12px rgba(110, 70, 40, 0.08);
  --shadow-md: 0 8px 24px rgba(110, 70, 40, 0.12);
  --shadow-lg: 0 16px 40px rgba(110, 70, 40, 0.18);
  --shadow-gold: 0 8px 25px rgba(156, 102, 58, 0.2);
}

/* Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 130px;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Ambient Background Grain & Glow */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 400px;
  background: radial-gradient(circle at 50% -20%, var(--accent-gold-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-arabic);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.num-font {
  font-family: var(--font-latin);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-badge {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-gold), #8A5A2F);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 span {
  color: var(--accent-gold);
  font-size: 0.9em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

/* Table Selection Badge in Header */
.table-badge-btn {
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.15), rgba(212, 163, 115, 0.05));
  border: 1px solid var(--accent-gold);
  color: var(--text-gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-badge-btn:hover {
  background: var(--accent-gold);
  color: #1A110B;
  box-shadow: var(--shadow-gold);
}

.table-badge-btn .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Search Bar in Header */
.search-container {
  padding-bottom: 10px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 42px 10px 14px;
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
  background: var(--bg-card-hover);
}

.search-clear-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: none;
}

.search-input:not(:placeholder-shown) + .search-clear-btn {
  display: block;
}

/* ==========================================================================
   Hero Banner & Cafe Info Card
   ========================================================================== */
.hero-banner {
  margin: 16px 0 20px;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.hero-greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-greeting {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hero-features-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-pill.highlight {
  background: rgba(212, 163, 115, 0.12);
  border-color: var(--accent-gold);
  color: var(--text-gold);
}

/* Call Waiter & Quick Action Buttons */
.quick-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.quick-btn.call-waiter-btn {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

.quick-btn.call-waiter-btn:hover {
  background: rgba(245, 158, 11, 0.15);
}

.quick-btn.wifi-btn {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.quick-btn.wifi-btn:hover {
  background: rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   Category Navigation Pills (Sticky Tabs)
   ========================================================================== */
.categories-nav-wrapper {
  position: sticky;
  top: 105px;
  z-index: 800;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
}

.categories-scroll::-webkit-scrollbar {
  display: none; /* Chrome & Safari */
}

.category-tab {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-secondary);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--accent-gold), #A77343);
  color: #1A110B;
  border-color: transparent;
  font-weight: 800;
  box-shadow: var(--shadow-gold);
  transform: scale(1.03);
}

.category-tab .tab-icon {
  font-size: 1.1rem;
}

.category-tab .tab-count {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.18);
  font-family: var(--font-latin);
}

/* ==========================================================================
   Menu Sections & Product Cards Grid
   ========================================================================== */
.menu-section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .section-icon {
  font-size: 1.4rem;
}

.section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.product-card.unavailable {
  opacity: 0.55;
  filter: grayscale(0.8);
}

.product-card.unavailable .btn-add-cart {
  pointer-events: none;
  background: var(--text-muted);
}

/* Card Image Area */
.card-image-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #1F150E;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-image {
  transform: scale(1.06);
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 10, 7, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card-badge.badge-red {
  color: #FFA5B4;
  border-color: #E11D48;
}

/* Card Content Area */
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-title-en {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-latin);
  margin-top: 2px;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer: Price & Add Button */
.card-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
}

.price-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-gold);
  font-family: var(--font-latin);
}

.price-currency {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-add-cart {
  background: linear-gradient(135deg, var(--accent-gold), #B37D4B);
  color: #150D08;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-add-cart:hover {
  background: var(--accent-gold-hover);
  transform: scale(1.04);
  box-shadow: var(--shadow-gold);
}

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

/* Empty State / Search Not Found */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  grid-column: 1 / -1;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.no-results-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.no-results-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   Floating Bottom Cart Bar (Mobile-Optimized)
   ========================================================================== */
.floating-cart-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 600px;
  margin: 0 auto;
  z-index: 850;
  background: linear-gradient(135deg, #271A11, #1A110B);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  cursor: pointer;
  transition: all var(--transition-bounce);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.floating-cart-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-bar-badge {
  background: var(--accent-gold);
  color: #17100B;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-latin);
  font-size: 0.9rem;
}

.cart-bar-details {
  display: flex;
  flex-direction: column;
}

.cart-bar-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-bar-total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-latin);
}

.cart-bar-btn {
  background: linear-gradient(135deg, var(--accent-gold), #C98845);
  color: #17100B;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-arabic);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Modals & Slide-Over Drawers (Mobile Bottom Sheet & Desktop Modal)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform var(--transition-bounce);
  overflow: hidden;
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

/* Bottom Sheet Drag Indicator */
.bottom-sheet-handle {
  display: none;
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 8px auto 2px;
}

/* Mobile Bottom Sheet Transform */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-container {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  }

  .modal-overlay.active .modal-container {
    transform: translateY(0);
  }

  .bottom-sheet-handle {
    display: block;
  }
}

/* ==========================================================================
   Mobile Bottom App Navigation Bar (Native App Style)
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 950;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}

.bottom-nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font-arabic);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  position: relative;
  transition: all var(--transition-fast);
  flex: 1;
  max-width: 75px;
}

.bottom-nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--transition-bounce);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--text-gold);
}

.bottom-nav-item:active .nav-icon {
  transform: scale(0.85);
}

.bottom-nav-item.active .nav-icon {
  transform: scale(1.15);
}

.bottom-nav-badge {
  position: absolute;
  top: 0;
  right: 14px;
  background: var(--accent-gold);
  color: #17100B;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-latin);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

/* Body and Container Bottom Padding for Mobile Nav */
body {
  padding-bottom: calc(75px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  .floating-cart-bar {
    bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--accent-rose);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Slide-Over Cart Drawer
   ========================================================================== */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  padding: 16px 20px;
}

.cart-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-item-modifiers {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.cart-item-price {
  font-weight: 800;
  color: var(--text-gold);
  font-family: var(--font-latin);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 6px;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  transition: background var(--transition-fast);
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold);
}

.qty-val {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

/* Cart Summary Area */
.cart-summary-box {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.summary-line.total {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
  margin-top: 4px;
}

.summary-line.total .total-amount {
  color: var(--text-gold);
  font-family: var(--font-latin);
}

/* Cart Checkout Actions */
.cart-actions-group {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-secondary);
}

.btn-whatsapp-order {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
  transition: all var(--transition-fast);
}

.btn-whatsapp-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
}

.btn-receipt-view {
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  color: var(--text-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-receipt-view:hover {
  background: rgba(212, 163, 115, 0.15);
}

/* ==========================================================================
   Customization Modal Options (Sizes, Sugar, Milk, Extras)
   ========================================================================== */
.custom-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.options-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.option-pill-label {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: all var(--transition-fast);
}

.option-pill-label:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.option-pill-label.selected {
  background: rgba(212, 163, 115, 0.18);
  border-color: var(--accent-gold);
  color: var(--text-primary);
  font-weight: 700;
}

.option-pill-label input {
  display: none;
}

.option-extra-price {
  font-family: var(--font-latin);
  font-weight: 700;
  color: var(--text-gold);
  font-size: 0.78rem;
}

/* ==========================================================================
   Table Selection Grid
   ========================================================================== */
.table-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .table-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.table-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  font-family: var(--font-latin);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-btn span {
  font-family: var(--font-arabic);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.table-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.table-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), #A97442);
  color: #17100B;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

.table-btn.active span {
  color: #2D1A0D;
  font-weight: 700;
}

/* ==========================================================================
   Digital Receipt & Print Styles
   ========================================================================== */
.receipt-paper {
  background: #FFFDF9;
  color: #1A110B;
  border-radius: var(--radius-md);
  padding: 24px 20px;
  font-family: var(--font-arabic);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid #EADBCE;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #CBB8A5;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.receipt-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #3E2413;
}

.receipt-meta {
  font-size: 0.8rem;
  color: #725D4E;
  margin-top: 4px;
}

.receipt-table-num {
  display: inline-block;
  background: #3E2413;
  color: #FAF6F0;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 8px;
  font-size: 0.9rem;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.receipt-items-table th {
  text-align: right;
  border-bottom: 1px solid #CBB8A5;
  padding: 6px 4px;
  color: #5A4435;
}

.receipt-items-table td {
  padding: 8px 4px;
  border-bottom: 1px solid #F0E6DA;
}

.receipt-footer-total {
  border-top: 2px dashed #CBB8A5;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: #3E2413;
}

/* ==========================================================================
   Admin & QR Code Stand Generator
   ========================================================================== */
.admin-badge {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.admin-badge:hover {
  opacity: 1;
}

.qr-card-preview {
  background: #FFFFFF;
  color: #17100B;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 2px solid #D4A373;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-code-img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  border: 1px solid #EADBCE;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideUpToast 0.3s forwards;
  pointer-events: auto;
}

@keyframes slideUpToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Live Order Tracker & Stepper (طلباتي وتتبع الطلبات)
   ========================================================================== */
.tracker-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tracker-card:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
}

.tracker-card.active-order {
  border-color: var(--accent-amber);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.tracker-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tracker-order-id {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-gold);
  font-family: var(--font-latin);
}

.tracker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(212, 163, 115, 0.15);
  color: var(--text-gold);
  border: 1px solid var(--accent-gold);
}

.tracker-badge.status-preparing {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  animation: pulseAmber 2s infinite;
}

.tracker-badge.status-delivered {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Stepper Timeline */
.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 10px 0 6px;
}

.order-stepper::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 1;
}

.stepper-progress-fill {
  position: absolute;
  top: 14px;
  right: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
  z-index: 2;
  transition: width 0.5s ease;
}

.step-node {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.step-node.completed .step-circle {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #17100B;
  font-weight: 800;
}

.step-node.active .step-circle {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #17100B;
  font-weight: 800;
  box-shadow: 0 0 12px var(--accent-gold);
  animation: pulse 1.5s infinite;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-node.active .step-label {
  color: var(--text-gold);
  font-weight: 800;
}

.step-node.completed .step-label {
  color: var(--text-primary);
}

/* Print Media Query */
@media print {
  body * {
    visibility: hidden;
  }
  .receipt-paper, .receipt-paper * {
    visibility: visible;
  }
  .receipt-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 320px;
    box-shadow: none;
    border: none;
  }
}
