/* ══════════════════════════════════════════════════════════════════ */
/* HarpyOrder — Design Tokens, Theme Variables & Shared Foundations  */
/* ══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   HarpyOrder — Minimalist Editorial Dining Menu
   Modern Typography & Clean Visual System
   ═══════════════════════════════════════════════════════════ */

:root,
:root[data-theme="dark"] {
  /* Warm Charcoal Obsidian Default Palette (Night Mode) */
  --bg: #120e0c;
  --bg-subtle: #1a1411;
  --surface: #1e1814;
  --surface-raised: #28201a;
  --surface-hover: #332922;
  --header-bg: #120e0c;

  --border: rgba(245, 238, 227, 0.09);
  --border-strong: rgba(245, 238, 227, 0.18);
  --border-focus: #ea580c;

  /* Primary Accent */
  --primary: #ea580c;
  --primary-hover: #f97316;
  --primary-subtle: rgba(234, 88, 12, 0.15);
  --primary-glow: rgba(234, 88, 12, 0.30);

  /* Functional Accents */
  --accent-wa: #16a34a;
  --accent-wa-subtle: rgba(22, 163, 74, 0.14);
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.12);
  --amber: #d97706;
  --amber-subtle: rgba(217, 119, 6, 0.14);
  --favorite: #e11d48;

  /* Typography */
  --text-main: #faf6f0;
  --text-body: #d4c9ba;
  --text-muted: #968a7a;
  --text-faint: #675c4e;

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions & Shadows */
  --tr-fast: all 0.18s ease;
  --tr-smooth: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

body, .food-item-card, .cat-pill, .discovery-chip, .search-input, .cart-drawer, .modal-box, .dynamic-island-cart {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Light Theme Mode (Day Mode - Luxury Warm Cream) */
:root[data-theme="light"] {
  --bg: #f8f6f0;
  --bg-subtle: #efeae1;
  --surface: #ffffff;
  --surface-raised: #f3ede2;
  --surface-hover: #eae2d3;
  --header-bg: #f8f6f0;

  --border: rgba(45, 35, 25, 0.10);
  --border-strong: rgba(45, 35, 25, 0.20);
  --border-focus: #c2410c;

  --text-main: #18130f;
  --text-body: #3d332a;
  --text-muted: #786c5e;
  --text-faint: #a69a8b;

  --primary: #c2410c;
  --primary-hover: #ea580c;
  --primary-subtle: rgba(194, 65, 12, 0.12);
  --primary-glow: rgba(194, 65, 12, 0.22);

  --shadow-sm: 0 4px 14px rgba(45, 30, 15, 0.06);
  --shadow-md: 0 10px 28px rgba(45, 30, 15, 0.09);
  --shadow-lg: 0 20px 45px rgba(45, 30, 15, 0.14);
}

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

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

html {
  scroll-behavior: smooth;
  font-size: 15.5px;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16.5px;
  }
}
@media (min-width: 1200px) {
  html {
    font-size: 17.5px;
  }
}
@media (min-width: 1600px) {
  html {
    font-size: 18.5px;
  }
}

body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(115px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-num {
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
  letter-spacing: -0.01em;
}

/* ── Scrollbars ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-raised);
  border-radius: var(--radius-full);
}

/* ── Balanced Responsive App Container ──────────────────── */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}
@media (min-width: 480px) {
  .container {
    padding: 0 14px;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 760px;
    padding: 0 20px;
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: 960px;
    padding: 0 20px;
  }
}
@media (min-width: 1400px) {
  .container {
    max-width: 1040px;
    padding: 0 24px;
  }
}

/* ── SVG Icons ───────────────────────────────────────────── */
.icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 1.4em; height: 1.4em; }
.icon-sm { width: 0.95em; height: 0.95em; }


/* ── Common UI Components (Splash, Toast, Theme Toggle) ── */
/* ── Ultra-Fast Native Splash Shimmer Shield ─────────────── */
.app-splash-shield {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg, #120e0c);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.22s ease-out, visibility 0.22s ease-out;
  pointer-events: auto;
}
[data-theme="light"] .app-splash-shield {
  background: #f8f6f0;
}
.app-splash-shield.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-shimmer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.splash-logo-pulse {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #ea580c), #c2410c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow, rgba(234, 88, 12, 0.35));
}
.splash-wave-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--primary, #ea580c);
  opacity: 0.6;
  animation: splashWave 1.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}
@keyframes splashWave {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}
.splash-harpy-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
}
.splash-loading-bar {
  width: 90px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
[data-theme="light"] .splash-loading-bar {
  background: rgba(0, 0, 0, 0.08);
}
.splash-loading-progress {
  width: 100%;
  height: 100%;
  background: var(--primary, #ea580c);
  border-radius: 99px;
  animation: splashProgress 0.8s ease-in-out infinite alternate;
}
@keyframes splashProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Modern Toast Notification Pill ─────────────────────── */
.admin-toast-pill {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(18, 14, 12, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 20px;
  max-width: 92vw;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.admin-toast-pill.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.admin-toast-pill .toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-toast-pill.toast-success .toast-icon {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}
.admin-toast-pill.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.admin-toast-pill .toast-icon svg {
  width: 14px;
  height: 14px;
}
.admin-toast-pill .toast-text {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  white-space: normal;
  text-align: right;
  line-height: 1.4;
}

/* ── Modern Theme Toggle & Logout Buttons ────────────────── */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn-theme-toggle:hover {
  background: var(--surface-hover, rgba(255,255,255,0.08));
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}
.btn-theme-toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

/* In Dark mode: show sun icon in gold, hide moon icon */
[data-theme="dark"] #theme-icon-dark,
[data-theme="dark"] .btn-theme-toggle .icon-moon {
  display: none !important;
}
[data-theme="dark"] #theme-icon-light,
[data-theme="dark"] .btn-theme-toggle .icon-sun {
  display: inline-block !important;
  color: #f59e0b;
}

/* In Light mode: show moon icon in indigo, hide sun icon */
[data-theme="light"] #theme-icon-light,
[data-theme="light"] .btn-theme-toggle .icon-sun {
  display: none !important;
}
[data-theme="light"] #theme-icon-dark,
[data-theme="light"] .btn-theme-toggle .icon-moon {
  display: inline-block !important;
  color: #6366f1;
}


/* ── Common Generic Buttons, Toasts & Empty States ── */
/* ── Generic Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  min-height: 36px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--tr-fast);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.96);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-body);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: var(--surface-raised);
}
.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 5px 10px;
  min-height: 32px;
  font-size: 11.5px;
}

/* ── Toast Notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 28px);
  max-width: 360px;
}
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}
.toast.success { border-right: 3px solid var(--accent-wa); }
.toast.error { border-right: 3px solid var(--danger); }
.toast.info { border-right: 3px solid var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 50px 16px;
  color: var(--text-faint);
}
.empty-icon {
  width: 44px;
  height: 44px;
  stroke: var(--text-faint);
  opacity: 0.4;
  margin-bottom: 10px;
}
.empty-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}


/* ── Common Modal Backdrop & Box Structure ── */
/* Modal Box */
.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  width: calc(100% - 28px);
  max-width: 500px;
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  -webkit-overflow-scrolling: touch;
}
.modal-box.open,
.modal-box.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
