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

:root {
  --brand-primary: #F5B301;
  --brand-primary-hover: #E09E00;
  --brand-primary-light: #FEF8E6;
  --brand-primary-glow: rgba(245, 179, 1, 0.25);
  --brand-dark: #121214;
  --brand-charcoal: #27272A;
  --brand-muted: #71717A;
  --brand-light-gray: #F4F4F5;
  --brand-border: #E4E4E7;
  --brand-bg: #F8F9FA;
  --brand-surface: #FFFFFF;
  --brand-red: #EF4444;
  --brand-green: #10B981;

  --font-heading: 'Oswald', sans-serif;
  --font-script: 'Caveat', cursive;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--brand-bg);
  color: var(--brand-dark);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
}

/* Utility Font Classes */
.font-heading { font-family: var(--font-heading); }
.font-script { font-family: var(--font-script); }
.font-sans { font-family: var(--font-sans); }

/* Hide scrollbar */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   RESPONSIVE DEVICE GATE:
   Desktop viewport (> 768px): Show QR screen only (NO mobile simulator)
   Mobile viewport (<= 768px): Show full mobile webapp
   ============================================================ */
#desktop-gate {
  display: none;
}

#mobile-app {
  display: block;
  min-height: 100vh;
  padding-bottom: calc(90px + var(--safe-bottom));
}

@media (min-width: 769px) {
  #desktop-gate {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, #FFFDF5 0%, #F5F5F7 100%);
    padding: 32px 20px;
  }
  #mobile-app {
    display: none !important;
  }
}

/* ============================================================
   DESKTOP QR GATE STYLES
   ============================================================ */
.desktop-card {
  max-width: 520px;
  width: 100%;
  background: #FFFFFF;
  border-radius: 32px;
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.desktop-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #F5B301, #FFD255, #F5B301);
}

.qr-box {
  width: 240px;
  height: 240px;
  margin: 24px auto;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(245, 179, 1, 0.15), 0 0 0 2px rgba(245, 179, 1, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.qr-box:hover {
  transform: scale(1.02);
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: calc(10px + var(--safe-top)) 16px 10px 16px;
}

/* ============================================================
   HERO / PROMO BANNER CAROUSEL
   ============================================================ */
.hero-slider-container {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(245, 179, 1, 0.14);
}

.hero-slide {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFF2C6 100%);
  border: 1px solid rgba(245, 179, 1, 0.3);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 140px;
}

/* ============================================================
   CATEGORY NAV PILLS
   ============================================================ */
.cat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #FFFFFF;
  border: 1px solid var(--brand-border);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-dark);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.cat-pill.active {
  background: var(--brand-dark);
  color: #FFFFFF;
  border-color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(18, 18, 20, 0.2);
}

.cat-pill.active .cat-icon-wrap {
  background: var(--brand-primary);
  color: #121214;
}

.cat-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

/* ============================================================
   INTER-CATEGORY BANNERS
   ============================================================ */
.category-divider-banner {
  background: linear-gradient(120deg, #FFFFFF 0%, #FFFDF5 100%);
  border: 1px solid rgba(245, 179, 1, 0.25);
  border-radius: 20px;
  padding: 16px 18px;
  margin: 28px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(245, 179, 1, 0.08);
  position: relative;
  overflow: hidden;
}

.category-divider-banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--brand-primary);
}

/* ============================================================
   DISH CARDS (Clean White Background, Premium App Style)
   ============================================================ */
.dish-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
}

.dish-card:active {
  transform: scale(0.985);
}

/* Pure Clean White Image Container */
.dish-img-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  min-width: 104px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #F0F0F2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dish-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dish-card:hover .dish-img-wrap img {
  transform: scale(1.05);
}

/* Favorite Heart Button */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: #A1A1AA;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

.fav-btn.is-favorite {
  color: var(--brand-red);
  background: #FEF2F2;
  transform: scale(1.08);
}

/* Add Button (+) */
.add-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #121214;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 3px 8px var(--brand-primary-glow);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.add-btn:active {
  transform: scale(0.85);
  background: var(--brand-primary-hover);
}

/* ============================================================
   BOTTOM NAVIGATION BAR (App Style, Rounded, Brand Circle Active)
   ============================================================ */
.bottom-app-bar {
  position: fixed;
  bottom: calc(14px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  margin: 0 auto;
  max-width: 440px;
  height: 68px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 36px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 50;
  transition: all 0.3s ease;
}

/* Bottom Nav Item */
.bottom-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  color: #71717A;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active Indicator: "debe encerrarse en un circulo del color de la marca" */
.bottom-nav-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.bottom-nav-item.active .bottom-nav-icon-circle {
  background: var(--brand-primary);
  color: #121214;
  box-shadow: 0 6px 16px var(--brand-primary-glow), 0 0 0 4px rgba(245, 179, 1, 0.2);
  transform: translateY(-6px) scale(1.08);
}

.bottom-nav-item.active .nav-label {
  color: #121214;
  font-weight: 700;
  transform: translateY(-2px);
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 500;
  margin-top: 2px;
  transition: all 0.2s ease;
}

/* Badge for Cart & Favorites */
.nav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--brand-dark);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid #FFFFFF;
}

.bottom-nav-item.active .nav-badge {
  background: #121214;
  color: var(--brand-primary);
}

/* ============================================================
   MODALS & BOTTOM SHEETS
   ============================================================ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.sheet-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-radius: 32px 32px 0 0;
  z-index: 61;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding: 24px 20px calc(24px + var(--safe-bottom)) 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.sheet-overlay.active .sheet-content {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: #E4E4E7;
  border-radius: 3px;
  margin: 0 auto 18px auto;
}

/* Modality Toggle (En Mesa vs A Domicilio) */
.modality-toggle {
  display: flex;
  background: #F4F4F5;
  border-radius: 18px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.modality-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: #71717A;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modality-btn.active {
  background: #FFFFFF;
  color: #121214;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.modality-btn.active .modal-icon {
  color: var(--brand-primary);
}

/* Form Inputs */
.app-input {
  width: 100%;
  background: #F8F9FA;
  border: 1px solid #E4E4E7;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #121214;
  outline: none;
  transition: all 0.2s ease;
}

.app-input:focus {
  background: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

/* WhatsApp Confirmation Button */
.btn-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
}

.btn-whatsapp:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

/* Quantity Stepper */
.qty-stepper {
  display: flex;
  align-items: center;
  background: #F4F4F5;
  border-radius: 12px;
  padding: 2px;
  gap: 6px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #121214;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.qty-btn:active {
  background: var(--brand-primary);
  transform: scale(0.9);
}

/* Toast Notifications */
.toast-msg {
  position: fixed;
  top: calc(20px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #18181B;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Animations */
@keyframes pulseSubtle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.pulse-badge {
  animation: pulseSubtle 2.5s infinite ease-in-out;
}
