/* ============================================
   RESTAURANT QR MENU - DESIGN SYSTEM
   ============================================ */

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* Enable hardware acceleration for animations */
.product-card,
.modal,
.toast,
.btn {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Content visibility for off-screen performance */
.product-card {
  content-visibility: auto;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU acceleration for smooth scrolling */
.category-tabs,
.products-grid,
.waiter-tables-grid {
  will-change: scroll-position;
}

/* ============================================
   CSS VARIABLES & THEMING
   ============================================ */
:root {
  /* Calabria Brand Palette */
  --primary: #1f8b4c;
  --primary-hover: #16683a;
  --primary-light: rgba(31, 139, 76, 0.15);
  --primary-glow: rgba(31, 139, 76, 0.35);
  --primary-rgb: 31, 139, 76;

  --accent: #cc2f2f;
  --accent-hover: #a41f1f;
  --accent-light: rgba(204, 47, 47, 0.14);
  --accent-glow: rgba(204, 47, 47, 0.35);
  --accent-rgb: 204, 47, 47;
  --cream: #f6efe1;
  --cream-rgb: 246, 239, 225;
  --shadow-accent: 0 10px 28px rgba(204, 47, 47, 0.24);

  /* Status Colors - Vibrant & Distinct */
  --status-inactive: #cbb6b6;
  --status-active: #2d8d57;
  --status-ordering: #f59e0b;
  --status-pending: #f97316;
  --status-preparing: #b45309;
  --status-delivered: #10b981;
  --status-paid: #22c55e;
  --status-cleared: #9ca3af;
  --status-payment-requested: #f472b6;

  /* Semantic Colors - Rich & Vibrant */
  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.15);
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: rgba(245, 158, 11, 0.15);
  --error: #ef4444;
  --error-hover: #dc2626;
  --error-light: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-hover: #2563eb;
  --info-light: rgba(59, 130, 246, 0.15);

  /* Background Colors */
  --bg-primary: #08120d;
  --bg-secondary: rgba(9, 18, 13, 0.9);
  --bg-tertiary: rgba(15, 27, 18, 0.86);
  --bg-card: rgba(246, 239, 225, 0.05);
  --bg-glass: rgba(246, 239, 225, 0.07);
  --bg-hover: rgba(246, 239, 225, 0.09);

  /* Text Colors */
  --text-primary: #f6efe1;
  --text-secondary: #d4ccb9;
  --text-muted: #9f9a89;
  --text-inverse: #112018;

  /* Border & Dividers */
  --border-color: rgba(246, 239, 225, 0.12);
  --border-light: rgba(246, 239, 225, 0.08);
  --divider: rgba(246, 239, 225, 0.06);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(31, 139, 76, 0.12);
  --shadow-accent: 0 10px 32px rgba(31, 139, 76, 0.28);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-family: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-Index Layers */
  --z-below: -1;
  --z-base: 0;
  --z-above: 10;
  --z-sticky: 100;
  --z-fixed: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

html[data-theme="night"] {
  color-scheme: dark;
}

html[data-theme="day"] {
  color-scheme: light;
  --bg-primary: #f5efe1;
  --bg-secondary: rgba(255, 251, 245, 0.92);
  --bg-tertiary: rgba(255, 247, 238, 0.95);
  --bg-card: rgba(255, 255, 255, 0.66);
  --bg-glass: rgba(255, 255, 255, 0.58);
  --bg-hover: rgba(255, 255, 255, 0.84);
  --text-primary: #1c2a21;
  --text-secondary: #415848;
  --text-muted: #6b7569;
  --text-inverse: #fffdf8;
  --border-color: rgba(28, 42, 33, 0.12);
  --border-light: rgba(28, 42, 33, 0.07);
  --divider: rgba(28, 42, 33, 0.06);
  --shadow-sm: 0 2px 10px rgba(49, 40, 24, 0.08);
  --shadow-md: 0 8px 26px rgba(49, 40, 24, 0.12);
  --shadow-lg: 0 16px 40px rgba(49, 40, 24, 0.16);
  --shadow-xl: 0 22px 58px rgba(49, 40, 24, 0.18);
  --shadow-glow: 0 0 24px rgba(31, 139, 76, 0.12);
}

/* Custom Premium Modal Styles */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--space-md);
}

.custom-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  /* backdrop-filter: blur(8px); */
  /* Potentially heavy on mobile */
}

.custom-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.custom-modal-content {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.custom-modal-content p {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-medium);
}

.custom-modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
  cursor: pointer;
  border: none;
}

.modal-btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.modal-btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.modal-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.modal-btn.secondary:hover {
  background: var(--bg-glass);
  transform: translateY(-2px);
}

.modal-btn.danger {
  background: var(--error);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-btn.danger:hover {
  background: var(--error-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

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

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Disable text selection globally */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* iOS Safari - disable callout menu */
}

/* Re-enable text selection for editable elements */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

body {
  font-family: var(--font-family);
  /* font-size: larger; */
  line-height: normal;
  color: rgb(255 255 255);
  background: var(--bg-primary);
  min-height: 100vh;
  /* Removed overflow-x: hidden; to fix sticky nav */
  overflow-x: hidden;
  overscroll-behavior-y: none;
  /* Mobile swipe fix */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: var(--z-below);
}

a {
  color: inherit;
  text-decoration: none;
}

.relative {
  position: relative;
}

.pr-xl {
  padding-right: var(--space-xl) !important;
}

.search-clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--error);
  /* Red by default */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  z-index: 10;
}

.search-clear-btn:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(239, 68, 68, 0.15);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-md);
}

h6 {
  font-size: var(--font-size-sm);
}

p {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--text-primary);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-md);
}

.flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   INTERACTIVE DESIGN SYSTEM — PREMIUM EFFECTS
   ============================================ */

/* ── Glassmorphism Panels ────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.glass-subtle {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
}

/* ── Gradient Text ───────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Glow Box (hover-aware glow) ─────────── */
.glow-box {
  position: relative;
  transition: box-shadow 0.4s cubic-bezier(.03,.98,.52,.99);
}

.glow-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    300px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(56, 189, 248, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.glow-box:hover::before {
  opacity: 1;
}

.glow-box:hover {
  box-shadow:
    0 0 40px rgba(56, 189, 248, 0.15),
    0 0 80px rgba(99, 102, 241, 0.08);
}

/* ── Cursor Glow ─────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.18) 0%,
    rgba(99, 102, 241, 0.08) 35%,
    transparent 70%
  );
  filter: blur(2px);
  will-change: left, top;
  mix-blend-mode: screen;
}

/* ── Ambient Background Blobs ────────────── */
.ambient-blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(160px);
  opacity: 0.4;
  will-change: transform;
}

.ambient-blob.blob-cyan {
  width: 600px;
  height: 600px;
  background: rgba(56, 189, 248, 0.15);
  top: -200px;
  left: -200px;
  animation: blobFloat1 20s ease-in-out infinite alternate;
}

.ambient-blob.blob-purple {
  width: 500px;
  height: 500px;
  background: rgba(192, 132, 252, 0.12);
  bottom: -200px;
  right: -200px;
  animation: blobFloat2 25s ease-in-out infinite alternate;
}

.ambient-blob.blob-indigo {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.10);
  top: 40%;
  right: 10%;
  animation: blobFloat3 18s ease-in-out infinite alternate;
}

@keyframes blobFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.15); }
}

@keyframes blobFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, -80px) scale(1.2); }
}

@keyframes blobFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -40px) scale(1.1); }
}

/* ── Scroll Reveal Animations ────────────── */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(.03,.98,.52,.99),
              transform 0.7s cubic-bezier(.03,.98,.52,.99);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Premium Button Glow ─────────────────── */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(192, 132, 252, 0.4));
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
  opacity: 1;
}

/* ── Shimmer Border Effect ───────────────── */
.shimmer-border {
  position: relative;
  overflow: hidden;
}

.shimmer-border::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(56, 189, 248, 0.15) 60deg,
    transparent 120deg,
    rgba(192, 132, 252, 0.1) 180deg,
    transparent 240deg,
    rgba(99, 102, 241, 0.12) 300deg,
    transparent 360deg
  );
  animation: shimmerRotate 8s linear infinite;
  z-index: -1;
}

@keyframes shimmerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Card Hover Lift ─────────────────────── */
.hover-lift {
  transition: transform 0.35s cubic-bezier(.03,.98,.52,.99),
              box-shadow 0.35s cubic-bezier(.03,.98,.52,.99);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(56, 189, 248, 0.08);
}

/* ============================================
