/*
  Cuisine type: Traditional Costa Rican / chicharrón specialty
  Palette: Bold Neon - Deep charcoal + fire red + warm gold
  Primary: #E63946 (signature brand red)
  Accent: #FFD166 (chicharrón gold)
  Fonts: Archivo Black (heading) + Caveat (handwritten accent) + Inter (body)
  Mood: vibrant, fun, memorable, typical costarricense
*/

:root {
  --color-primary: #E63946;
  --color-primary-dark: #B22234;
  --color-primary-light: #FF6B76;
  --color-accent: #FFD166;
  --color-accent-deep: #E6A828;
  --color-bg: #0F0F0F;
  --color-bg-alt: #1A1A1A;
  --color-bg-card: #1F1F1F;
  --color-bg-cream: #FFF8F0;
  --color-bg-cream-alt: #FBEFE0;
  --color-text: #FAFAF8;
  --color-text-dark: #0A0A0A;
  --color-text-muted: #A8A8A8;
  --color-text-muted-dark: #6B6B6B;
  --color-border: #2A2A2A;
  --color-border-light: #E8DCC8;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
}

/* Handwritten accent */
.font-script {
  font-family: 'Caveat', cursive;
  font-weight: 700;
}

/* Noise texture overlay */
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Grain texture for sections */
.grain-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Neon glow text - only on dark backgrounds */
.neon-red {
  color: #fff;
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--color-primary),
    0 0 24px var(--color-primary),
    0 0 40px var(--color-primary);
}

.neon-gold {
  color: #fff;
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--color-accent),
    0 0 24px var(--color-accent);
}

/* Hero background image cover */
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Hero text shadows - photo background requires */
.hero-text-shadow {
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 8px 32px rgba(0,0,0,0.4);
}

.hero-gradient-drop {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

/* Fade-in animation for scroll reveal */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.55s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.65s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.75s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Dish card hover - scale inner image only */
.dish-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.35s ease;
}

.dish-card .dish-img-wrap {
  overflow: hidden;
}

.dish-card .dish-img {
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.25, 1);
}

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

.dish-card:hover {
  box-shadow: 0 20px 60px rgba(230, 57, 70, 0.22), 0 2px 10px rgba(0,0,0,0.35);
}

/* CTA Button - bold neon style */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--color-primary);
  color: white;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  border: 2px solid var(--color-primary);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 0 rgba(230, 57, 70, 0);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.45), 0 0 40px rgba(230, 57, 70, 0.25);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  color: white;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-ghost:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Section heading style */
.section-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.section-eyebrow {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-primary);
  display: inline-block;
  transform: rotate(-2deg);
  font-weight: 700;
}

/* Heart shape */
.heart-icon {
  display: inline-block;
  color: var(--color-primary);
  animation: heartbeat 1.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(0.95); }
  45% { transform: scale(1.1); }
}

/* Floating decorative */
.float-slow {
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* Neon border card */
.neon-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  position: relative;
}

.neon-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--color-primary), transparent 40%, transparent 60%, var(--color-accent));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
  z-index: -1;
  pointer-events: none;
}

.neon-card:hover::before {
  opacity: 0.6;
}

/* Badge */
.badge-popular {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-primary);
  color: white;
  font-family: 'Archivo Black', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
}

.badge-chef {
  background: var(--color-accent);
  color: var(--color-text-dark);
  box-shadow: 0 4px 12px rgba(255, 209, 102, 0.35);
}

.badge-new {
  background: #fff;
  color: var(--color-text-dark);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

/* Mesa badge */
.mesa-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  color: var(--color-accent);
  font-family: 'Archivo Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Stat counter */
.stat-value {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  color: var(--color-accent);
}

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

/* Scroll snap for cat-nav on mobile */
@media (max-width: 640px) {
  .cat-nav-inner {
    scroll-snap-type: x proximity;
  }
  .cat-nav-inner > * {
    scroll-snap-align: start;
  }
}

/* Category navigation pills */
.cat-pill {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cat-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

/* Qty control */
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--color-primary);
  padding: 4px;
  border-radius: 999px;
}

.qty-ctrl button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 20px;
  font-weight: 700;
  border: 0;
}

.qty-ctrl button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.qty-ctrl .qty {
  min-width: 32px;
  text-align: center;
  color: white;
  font-family: 'Archivo Black', sans-serif;
  font-size: 16px;
}

/* Light section - for sobre nosotros, reseñas */
.section-light {
  background: var(--color-bg-cream);
  color: var(--color-text-dark);
  position: relative;
}

.section-light .muted {
  color: #5A5148;
}

/* Dot grid background decoration */
.dot-grid {
  background-image: radial-gradient(circle, rgba(230, 57, 70, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Print styles for order.html */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
}

/* Floating cart button */
.floating-cart {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  background: var(--color-primary);
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5), 0 0 0 rgba(230, 57, 70, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s;
  animation: cartPulse 2.4s infinite;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

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

.floating-cart:hover {
  transform: translateY(-3px);
  background: var(--color-primary-dark);
}

@keyframes cartPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5), 0 0 0 0 rgba(230, 57, 70, 0.4); }
  50% { box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5), 0 0 0 16px rgba(230, 57, 70, 0); }
}

/* Sticky mobile whatsapp CTA */
.sticky-cta {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  z-index: 40;
  display: none;
}

@media (max-width: 768px) {
  .sticky-cta {
    display: flex;
  }
}

/* GLightbox fixes - full screen without cropping */
.glightbox-clean .gslide-media {
  max-width: 92vw !important;
  max-height: 92vh !important;
}

.glightbox-clean .gslide-image img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  width: auto;
  height: auto;
}

/* Hero scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -8px); }
}

/* Neon light bar - decorative element */
.neon-bar {
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-primary) 20%,
    var(--color-accent) 50%,
    var(--color-primary) 80%,
    transparent 100%);
  height: 2px;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.6), 0 0 24px rgba(255, 209, 102, 0.3);
}

/* Review star */
.star-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  color: var(--color-accent);
  fill: var(--color-accent);
}

/* Menu Hero bg (menu.html) */
.menu-hero {
  background: linear-gradient(135deg, #0F0F0F 0%, #1A0606 60%, #2A0A0A 100%);
  position: relative;
  overflow: hidden;
}

.menu-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

/* Accent blob */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

/* QR code card */
.qr-wrap {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: inline-block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-body {
  background: var(--color-bg-card);
  padding: 32px;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--color-border);
  transform: scale(0.9);
  transition: transform 0.25s;
}

.modal-backdrop.open .modal-body {
  transform: scale(1);
}

/* Receipt (order.html) */
.receipt {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  color: #111;
  padding: 40px 28px;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.15);
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.receipt-line + .receipt-line {
  border-top: 1px dashed #E0D9CC;
}

/* Empty cart illustration */
.empty-illustration {
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  opacity: 0.35;
}

/* Hide scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* Prevent long buttons line-break weird */
.btn-primary, .btn-ghost {
  white-space: nowrap;
}

/* Gallery mask */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.4), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item img {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: all 0.25s;
  z-index: 2;
  width: 48px;
  height: 48px;
  background: rgba(230, 57, 70, 0.9);
  color: white;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .zoom-icon {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Mobile menu drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer nav a {
  padding: 20px 0;
  font-family: 'Archivo Black', sans-serif;
  font-size: 2rem;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--color-border);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  transition: all 0.35s ease;
  padding: 16px 0;
}

.site-header.scrolled {
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

/* Star rating SVG */
.star-fill {
  display: inline-block;
  vertical-align: middle;
}

/* "Volume" of hero - prevent gap under */
body {
  margin: 0;
}

/* Ensure image fallback looks ok */
img[alt]:not([src]),
img[alt][src=""] {
  background: var(--color-bg-cream-alt);
}

/* iOS safe areas for fixed CTA */
@supports (padding: env(safe-area-inset-bottom)) {
  .floating-cart {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .sticky-cta {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Disable hover scale on non-pointer devices (touch) to avoid stuck state */
@media (hover: none) {
  .dish-card:hover .dish-img {
    transform: none;
  }
}
