/* ==========================================================
   AGENCIA DE TURISMO EL SOLARIO - GOOGLE FLOW DESIGN SYSTEM
   Inspirado en https://flow.google.com/
   Limpio, Lentes frosted, Bento cards, Aura Glow Mesh, RTL
   Variables de Color Dinámicas (Configurables desde Admin)
   ========================================================== */

/* Fonts loaded via <link> in HTML for faster parallel mobile render */

:root {
  --flow-bg: #fafafa;
  --flow-surface: #ffffff;
  --flow-border: rgba(226, 232, 240, 0.8);
  --flow-primary: #f59e0b; /* Configurable desde Admin */
  --flow-primary-dark: #d97706; /* Configurable desde Admin */
  --flow-accent: #1a73e8; /* Configurable desde Admin */
  --flow-indigo: #4f46e5;
  --flow-text: #0f172a;
  --flow-muted: #64748b;
  --flow-pill-bg: rgba(255, 255, 255, 0.85);
  --radius-bento: 1.75rem;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base Body & Flow Typography (Mobile Scrolling Unlocked) */
html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  overflow-x: clip; /* Recorta desborde horizontal sin bloquear scroll vertical */
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  color: var(--flow-text);
  background-color: var(--flow-bg);
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y; /* Permite desplazamiento vertical nativo con inercia total */
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  letter-spacing: -0.02em;
}

/* RTL Support for Hebrew */
html[dir="rtl"] body {
  font-family: 'Noto Sans Hebrew', 'Plus Jakarta Sans', sans-serif;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

html[lang="ja"] body {
  font-family: 'Noto Sans JP', 'Plus Jakarta Sans', sans-serif;
}

/* Google Flow Ambient Aura Glow Mesh */
.flow-mesh {
  position: relative;
  background-color: var(--flow-bg);
  overflow: hidden;
}

.flow-mesh::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.04) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.flow-mesh::after {
  content: '';
  position: absolute;
  top: 100px;
  right: 10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.03) 60%, transparent 70%);
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* Hero Flow Mesh with Dynamic Video & Images */
.flow-hero-mesh {
  position: relative;
  overflow: hidden; /* Evita desborde horizontal de las imágenes escaladas */
  touch-action: pan-y; /* Permite desplazamiento vertical nativo y libre */
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.28), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(245, 158, 11, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 20% 40%, rgba(59, 130, 246, 0.18), transparent),
    #080c14;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  filter: brightness(1.08) contrast(1.04) saturate(1.12);
  transition: opacity 0.8s ease;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(1.12) contrast(1.04) saturate(1.14);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 6s ease-out;
  transform: scale(1.04);
}

.hero-slide.active {
  opacity: 0.85;
  transform: scale(1);
}

/* Category Dropdown Floating Glass Menu (Google Flow Minimalist) */
.cat-dropdown-panel {
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(226, 232, 240, 0.8);
  animation: catDropdownFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes catDropdownFade {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.cat-menu-item {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-menu-item:hover {
  background: rgba(241, 245, 249, 0.9);
  transform: translateX(3px);
}

.cat-menu-item.active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  border-left: 3px solid #f59e0b;
}

/* Floating Frosted Pill Navbar */
.flow-pill-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.flow-pill-nav:hover {
  box-shadow: 0 14px 35px -8px rgba(0, 0, 0, 0.09);
}

/* Google Flow Bento Cards */
.flow-card {
  background: #ffffff;
  border-radius: var(--radius-bento);
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.flow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
  border-color: rgba(203, 213, 225, 0.9);
}

/* Flow Buttons using dynamic primary colors */
.flow-btn-primary {
  background: linear-gradient(135deg, var(--flow-primary, #f59e0b) 0%, var(--flow-primary-dark, #d97706) 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font-weight: 700;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 18px -4px rgba(245, 158, 11, 0.4);
}

.flow-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(245, 158, 11, 0.5);
  filter: brightness(1.05);
}

.flow-btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.flow-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Flow Badges */
.flow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.flow-badge-amber {
  background: rgba(254, 243, 199, 0.85);
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.flow-badge-blue {
  background: rgba(239, 246, 255, 0.85);
  color: #1d4ed8;
  border: 1px solid rgba(191, 219, 254, 0.6);
}

.flow-badge-emerald {
  background: rgba(236, 253, 245, 0.85);
  color: #047857;
  border: 1px solid rgba(167, 243, 208, 0.6);
}

/* Micro-preview Chips for Hero (Legacy fallback) */
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-chip:hover, .hero-chip.active {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Google Flow Category Lines in Hero (En vez de botones) */
.hero-lines-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto 1.5rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

.hero-line-item {
  flex: 1 1 0%;
  min-width: 0 !important; /* CRÍTICO: Permite que los 7 indicadores se contraigan al ancho exacto del móvil */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.4rem 0.1rem;
  transition: all 0.25s ease;
  user-select: none;
  box-sizing: border-box;
}

.hero-line-track {
  width: 100%;
  height: 3px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.hero-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #fde68a);
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.hero-line-item.active .hero-line-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.hero-line-item.active .hero-line-fill {
  width: 100%;
}

.hero-line-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.hero-line-item:hover .hero-line-label {
  color: rgba(255, 255, 255, 0.95);
}

.hero-line-item.active .hero-line-label {
  color: #fbbf24;
  font-weight: 800;
  transform: translateY(-1px);
}

/* En pantallas móviles (< 640px): barras de progreso adaptables sin desborde */
@media (max-width: 640px) {
  .hero-lines-container {
    gap: 0.25rem;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
    max-width: 100% !important;
  }
  .hero-line-item {
    padding: 0.3rem 0;
  }
  /* En móvil, ocultar etiquetas de texto para que las 7 líneas sean elegantes barras fluidas (como Stories) */
  .hero-line-label {
    display: none !important;
  }
  .hero-line-track {
    height: 3px;
  }
  .hero-line-item.active .hero-line-track {
    height: 5px;
  }
}

/* Tour Modal Automatic Carousel */
.modal-carousel-container {
  position: relative;
  width: 100%;
  height: 22rem;
  overflow: hidden;
  background: #0f172a;
}

.modal-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s ease;
  transform: scale(1.02);
}

.modal-slide.active {
  opacity: 1;
  transform: scale(1);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot.active {
  width: 24px;
  background: #ffffff;
}

/* Tour Map Styling */
#tour-map {
  z-index: 10;
  min-height: 260px;
}
.leaflet-popup-content-wrapper {
  border-radius: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Gallery Hover Card Effects */
.gallery-card {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.85) 85%, #0f172a 100%);
  transition: opacity 0.3s ease;
}

/* Lightbox Modal */
#lightbox-modal {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Review Helpful Vote Button */
.helpful-btn {
  transition: all 0.2s ease;
}
.helpful-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.helpful-btn.voted {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

/* Difficulty Badges */
.badge-facil {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-moderado {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-aventura {
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.badge-extremo {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.badge-altura {
  background-color: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.badge-naturaleza {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Pulse Animation for WhatsApp Floating Button */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
}

.pulse-whatsapp {
  animation: pulseGlow 2.5s infinite;
}

/* Category Tab Pill Active */
.category-tab {
  transition: all 0.2s ease-in-out;
}
.category-tab.active {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

/* Timeline Program */
.timeline-item::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 11px;
  bottom: -20px;
  width: 2px;
  background: #e2e8f0;
}
html[dir="rtl"] .timeline-item::before {
  left: auto;
  right: 11px;
}
.timeline-item:last-child::before {
  display: none;
}


/* ==========================================================
   GOOGLE FLOW DARK MODE THEME & PALETTE
   Sleek Obsidian, Slate Glass, Aura Glows, Glowing Accents
   ========================================================== */
html.dark,
body.dark-mode {
  --flow-bg: #0b0f19;
  --flow-surface: #111827;
  --flow-border: rgba(51, 65, 85, 0.7);
  --flow-text: #f8fafc;
  --flow-muted: #94a3b8;
  --flow-pill-bg: rgba(17, 24, 39, 0.88);
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

/* Glass Pill Navbar in Dark Mode */
body.dark-mode .flow-pill-nav {
  background: rgba(15, 23, 42, 0.88) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .flow-pill-nav nav a {
  color: #cbd5e1 !important;
}

body.dark-mode .flow-pill-nav nav a:hover {
  color: var(--flow-primary, #f59e0b) !important;
}

/* Background mesh in Dark Mode */
body.dark-mode .flow-mesh {
  background-color: #0b0f19 !important;
}

/* Bento Cards in Dark Mode */
body.dark-mode .flow-card {
  background-color: #111827 !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .flow-card:hover {
  border-color: rgba(100, 116, 139, 0.9) !important;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7) !important;
}

/* Category Floating Dropdown Menu in Dark Mode */
body.dark-mode .cat-dropdown-panel {
  background-color: #111827 !important;
  border-color: #334155 !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode .cat-menu-item {
  color: #e2e8f0 !important;
}

body.dark-mode .cat-menu-item:hover {
  background: rgba(30, 41, 59, 0.85) !important;
  color: #ffffff !important;
}

body.dark-mode .cat-menu-item.active {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-left-color: #f59e0b !important;
}

/* Modal and Drawers in Dark Mode */
body.dark-mode .flow-modal-content {
  background-color: #111827 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Inputs & Selects in Dark Mode */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Surfaces and Tailwind background utility overrides in Dark Mode */
body.dark-mode .bg-white {
  background-color: #111827 !important;
}

body.dark-mode .bg-slate-50 {
  background-color: #0f172a !important;
}

body.dark-mode .bg-slate-100 {
  background-color: #1e293b !important;
}

body.dark-mode .bg-slate-200 {
  background-color: #334155 !important;
}

body.dark-mode .text-slate-950,
body.dark-mode .text-slate-900,
body.dark-mode .text-slate-800 {
  color: #f8fafc !important;
}

body.dark-mode .text-slate-700,
body.dark-mode .text-slate-600 {
  color: #cbd5e1 !important;
}

body.dark-mode .text-slate-500,
body.dark-mode .text-slate-400 {
  color: #94a3b8 !important;
}

body.dark-mode .border-slate-200,
body.dark-mode .border-slate-200\/90,
body.dark-mode .border-slate-200\/80,
body.dark-mode .border-slate-200\/70,
body.dark-mode .border-slate-100 {
  border-color: #334155 !important;
}

body.dark-mode .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155 !important;
}

/* Transport Ticket Cards & Office Map Styles */
.transport-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.transport-card:hover {
  transform: translateY(-4px);
}

.office-map-container {
  min-height: 380px;
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Custom Pulsing Office Marker */
.custom-office-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f59e0b;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: officePinPulse 2s infinite;
}

@keyframes officePinPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Theme switch transitions */
body, .flow-pill-nav, .flow-card, .cat-dropdown-panel {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}


/* Transport Destination Expand/Collapse Animations */
.transport-extra-drawer {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.transport-extra-drawer.unfolded {
  display: block !important;
  animation: transportDrawerDown 0.35s ease forwards;
}

@keyframes transportDrawerDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================
   DESTINATION GROUPS & MULTI-PHOTO GALLERY ENHANCEMENTS
   ========================================================== */
.dest-filter-pill {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dest-filter-pill:hover {
  transform: translateY(-1px);
}

.dest-filter-pill.active {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

body.dark-mode .dest-filter-pill.active {
  background-color: var(--flow-primary, #f59e0b) !important;
  color: #0f172a !important;
  border-color: var(--flow-primary, #f59e0b) !important;
}

body.dark-mode .dest-filter-pill {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

/* Multi-photo thumbnail hover effect in Admin */
.gallery-thumbnail-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumbnail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}


/* ==========================================================
   GOOGLE FLOW ULTRA-COMPLETE DARK MODE OVERHAUL
   Elimina cualquier residuo blanco en modo nocturno
   ========================================================== */
html.dark,
body.dark-mode {
  --flow-bg: #090d16;
  --flow-surface: #0f172a;
  --flow-surface-elevated: #162036;
  --flow-border: rgba(51, 65, 85, 0.7);
  --flow-text: #f8fafc;
  --flow-muted: #94a3b8;
  --flow-pill-bg: rgba(15, 23, 42, 0.92);
  background-color: #090d16 !important;
  color: #f8fafc !important;
}

/* Force dark on all white and light surfaces */
body.dark-mode .bg-white,
html.dark .bg-white,
body.dark-mode section.bg-white,
body.dark-mode div.bg-white {
  background-color: #0f172a !important;
}

body.dark-mode .bg-slate-50,
html.dark .bg-slate-50 {
  background-color: #162036 !important;
}

body.dark-mode .bg-slate-100,
html.dark .bg-slate-100 {
  background-color: #1e293b !important;
}

body.dark-mode .bg-slate-200,
html.dark .bg-slate-200 {
  background-color: #334155 !important;
}

body.dark-mode .bg-slate-900\/90,
body.dark-mode .bg-slate-900 {
  background-color: #0f172a !important;
}

body.dark-mode .bg-white\/95,
body.dark-mode .bg-white\/90,
body.dark-mode .bg-white\/80 {
  background-color: rgba(15, 23, 42, 0.96) !important;
}

/* Colored soft backgrounds in Dark Mode */
body.dark-mode .bg-amber-50,
body.dark-mode .bg-amber-50\/60,
body.dark-mode .bg-amber-50\/50,
body.dark-mode .bg-amber-50\/40 {
  background-color: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}

body.dark-mode .bg-amber-100 {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

body.dark-mode .bg-emerald-50,
body.dark-mode .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
}

body.dark-mode .bg-blue-50,
body.dark-mode .bg-blue-100 {
  background-color: rgba(37, 99, 235, 0.15) !important;
  color: #60a5fa !important;
}

body.dark-mode .bg-purple-50,
body.dark-mode .bg-purple-100 {
  background-color: rgba(147, 51, 234, 0.15) !important;
  color: #c084fc !important;
}

/* Text color overrides */
body.dark-mode .text-slate-950,
body.dark-mode .text-slate-900,
body.dark-mode .text-slate-800,
html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: #f8fafc !important;
}

body.dark-mode .text-slate-700,
body.dark-mode .text-slate-600,
html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

body.dark-mode .text-slate-500,
body.dark-mode .text-slate-400,
html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94a3b8 !important;
}

/* Borders */
body.dark-mode .border-slate-100,
body.dark-mode .border-slate-200,
body.dark-mode .border-slate-200\/90,
body.dark-mode .border-slate-200\/80,
body.dark-mode .border-slate-200\/70,
html.dark .border-slate-200 {
  border-color: rgba(51, 65, 85, 0.6) !important;
}

body.dark-mode .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(51, 65, 85, 0.6) !important;
}

/* Inputs, Selects, and Textareas */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode select,
body.dark-mode textarea {
  background-color: #162036 !important;
  color: #f8fafc !important;
  border-color: rgba(71, 85, 105, 0.7) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748b !important;
}

body.dark-mode select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

/* Specific Section Fixes */
body.dark-mode #porque-solario,
body.dark-mode #oficina,
body.dark-mode #faq,
body.dark-mode #transporte,
body.dark-mode #catalogo,
body.dark-mode #destacados,
body.dark-mode #galeria,
body.dark-mode #opiniones {
  background-color: #090d16 !important;
}

/* Category Dropdown */
body.dark-mode #category-dropdown-trigger {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode #category-dropdown-panel {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border-color: #334155 !important;
}

body.dark-mode .cat-menu-item {
  color: #e2e8f0 !important;
}

body.dark-mode .cat-menu-item:hover {
  background: rgba(30, 41, 59, 0.9) !important;
}

/* Bento Cards in Dark Mode */
body.dark-mode .flow-card {
  background-color: #0f172a !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .flow-card:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8) !important;
}

/* Modals */
body.dark-mode #tour-modal .bg-white,
body.dark-mode #lightbox-modal .bg-white,
body.dark-mode #db-modal .bg-white,
body.dark-mode #payment-modal .bg-white {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* FAQ Accordion */
body.dark-mode #faq-accordion > div {
  background-color: #0f172a !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
}

body.dark-mode .faq-toggle {
  color: #f8fafc !important;
}

body.dark-mode .faq-answer {
  background-color: #121b2d !important;
  border-color: rgba(51, 65, 85, 0.5) !important;
  color: #cbd5e1 !important;
}

/* Custom Scrollbars in Dark Mode */
body.dark-mode ::-webkit-scrollbar-track {
  background: #090d16 !important;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #334155 !important;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #475569 !important;
}

/* Print Styles for Quotations and Receipts */
@media print {
  body * {
    visibility: hidden;
  }
  #quotation-print-sheet,
  #quotation-print-sheet * {
    visibility: visible;
  }
  #quotation-print-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: white !important;
    color: black !important;
  }
  .no-print {
    display: none !important;
  }
}


/* ==========================================================
   MOBILE RESPONSIVENESS & TOUCH GESTURE ENHANCEMENTS
   ========================================================== */
#tour-modal {
  touch-action: pan-y;
  overscroll-behavior: contain !important;
}

#tour-modal .modal-content {
  max-width: 100% !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
}

#tour-map {
  touch-action: pan-y !important;
  max-width: 100% !important;
}

.leaflet-container {
  max-width: 100% !important;
}

@media (max-width: 640px) {
  .modal-carousel-container {
    height: 15rem !important;
  }
  #tour-modal .modal-content {
    max-height: 96dvh !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
  }
  /* Ajuste de márgenes y paddings en móvil para evitar desborde */
  .timeline-item p {
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

/* ==========================================================
   MOBILE RESPONSIVENESS & ANTI-OVERFLOW DEFENSE (DESPLAZAMIENTO FLUIDO)
   ========================================================== */
@media (max-width: 768px) {
  html {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  body {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    position: static !important;
  }

  /* El Hero permite scroll vertical nativo y nunca desborda la pantalla */
  .flow-hero-mesh {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    touch-action: pan-y !important;
    box-sizing: border-box !important;
  }

  /* Todas las secciones permiten desplazamiento táctil vertical fluido */
  section, main, header, footer {
    touch-action: pan-y !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .flow-hero-mesh h1 {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    word-break: break-word;
    max-width: 100% !important;
  }

  #hero-active-photo-badge {
    max-width: calc(100vw - 2rem) !important;
    box-sizing: border-box !important;
  }

  #hero-active-photo-title {
    max-width: 130px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
}
