/* ==========================================================================
   TRANSVIA - SISTEMA DE DISEÑO & IDENTIDAD VISUAL
   Dirección de Arte: Calidez, Alta Confianza, Exclusividad Familiar y Mobile-First
   ========================================================================== */

/* 1. VARIABLES GLOBALES DE MARCA Y TOKENS DE DISEÑO */
:root {
  /* Rojo Marca (Acción, señalética escolar y energía cálida) */
  --color-red-primary: #D9232D;
  --color-red-dark: #B3161F;
  --color-red-deep: #8E0E15;
  --color-red-light: #FFF1F1;
  --color-red-glow: rgba(217, 35, 45, 0.22);

  /* Azul Petróleo / Marino (Tono del logotipo "Transvia", seriedad y templanza) */
  --color-navy: #1B3E4B;
  --color-navy-dark: #122B34;
  --color-navy-light: #F0F6F8;
  --color-navy-muted: #335968;

  /* Amarillo Jirafa (Acentos selectos, insignias de confianza, iconos, nunca fondo masivo) */
  --color-yellow: #F5A623;
  --color-yellow-dark: #D4890C;
  --color-yellow-light: #FFF8E7;
  --color-yellow-border: #FCE1A8;

  /* Fondos Alternos y Superficies */
  --color-white: #FFFFFF;
  --color-cream: #FAF7F2;          /* Fondo alterno cálido institucional */
  --color-cream-soft: #F5EFEB;     /* Contraste suave para tarjetas */
  --color-surface-card: #FFFFFF;

  /* Escala de Texto (Gris carbón para alta legibilidad, sin negro puro #000) */
  --color-text-main: #1C242E;       /* Titulares y lectura principal (Contraste AA+ > 12:1) */
  --color-text-body: #374151;       /* Texto de párrafo continuo (4.5+:1 garantizado) */
  --color-text-muted: #5B6776;      /* Metadatos y etiquetas secundarias */
  --color-text-light: #7E8B9B;      /* Textos deshabilitados o sutiles */

  /* Bordes y Sombras */
  --color-border-subtle: #E9ECEF;
  --color-border-medium: #DCE2E6;
  --shadow-sm: 0 2px 8px rgba(27, 62, 75, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(27, 62, 75, 0.08);
  --shadow-lg: 0 16px 36px -6px rgba(27, 62, 75, 0.12);
  --shadow-red: 0 10px 25px -4px rgba(217, 35, 45, 0.32);
  --shadow-float: 0 20px 40px -10px rgba(18, 43, 52, 0.16);

  /* Tipografías */
  --font-heading: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Espaciado Móvil & Ergonomía */
  --touch-target-min: 48px;
  --mobile-safe-bottom: 76px;
}

/* 2. BASE Y REGLAS DE ACCESIBILIDAD */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-body);
  background-color: var(--color-white);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  padding-bottom: 0;
}

/* Espacio inferior de seguridad en móvil para evitar que la barra fija tape el contenido */
@media (max-width: 1023px) {
  body {
    padding-bottom: var(--mobile-safe-bottom);
  }
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  color: var(--color-text-main);
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* Foco visible y accesible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-yellow);
  outline-offset: 2px;
}

/* 3. ELEMENTOS GRÁFICOS DE IDENTIDAD (RUTA, CARRETERA Y MANCHAS SUTILES) */

/* Textura de cuadrícula técnica y sutil de movilidad (en lugar de patrones genéricos) */
.bg-hero-grid {
  background-image: 
    linear-gradient(to right, rgba(27, 62, 75, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 62, 75, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Soporte seguro para line-clamp sin depender de plugins */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Línea de ruta escolar punteada que conecta etapas */
.route-connector {
  position: relative;
}
.route-connector::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 48px;
  bottom: 0;
  width: 2px;
  background-image: repeating-linear-gradient(to bottom, var(--color-red-primary) 0, var(--color-red-primary) 6px, transparent 6px, transparent 12px);
  z-index: 1;
}
@media (min-width: 1024px) {
  .route-connector-horizontal::before {
    content: '';
    position: absolute;
    top: 36px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-image: repeating-linear-gradient(to right, var(--color-red-primary) 0, var(--color-red-primary) 8px, transparent 8px, transparent 16px);
    z-index: 1;
  }
}

/* Separadores orgánicos suaves ("camino escolar") */
.wave-divider-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}
.wave-divider-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}

/* 4. BOTONES Y COMPONENTES TOUCH-FRIENDLY (>= 48px) */
.btn-primary {
  min-height: var(--touch-target-min);
  padding: 12px 24px;
  background-color: var(--color-red-primary);
  color: var(--color-white);
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-red);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.4, 1), background-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.btn-primary:hover {
  background-color: var(--color-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(217, 35, 45, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  min-height: var(--touch-target-min);
  padding: 12px 24px;
  background-color: var(--color-white);
  color: var(--color-navy);
  border: 1.5px solid var(--color-border-medium);
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-secondary:hover {
  background-color: var(--color-cream);
  border-color: var(--color-navy);
  color: var(--color-navy-dark);
}

.btn-whatsapp {
  min-height: var(--touch-target-min);
  padding: 12px 22px;
  background-color: #25D366;
  color: #FFFFFF;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px -3px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-whatsapp:hover {
  background-color: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(37, 211, 102, 0.45);
}

/* 5. BARRA FIJA INFERIOR PARA MÓVILES */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border-subtle);
  padding: 10px 16px;
  z-index: 45;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* 6. BOTÓN FLOTANTE WHATSAPP (Móvil y Escritorio) */
.floating-whatsapp-btn {
  position: fixed;
  right: 18px;
  bottom: 86px; /* Despegado sobre la barra móvil */
  z-index: 44;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
@media (min-width: 1024px) {
  .floating-whatsapp-btn {
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
  }
}
.floating-whatsapp-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.55);
}

/* Pulso sutil para WhatsApp */
.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  animation: pulseRipple 2.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: -1;
}
@keyframes pulseRipple {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* 7. NÚMEROS HEROICOS DE IMPACTO */
.stat-number {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1;
  color: var(--color-navy);
}
.stat-highlight {
  color: var(--color-red-primary);
}

/* 8. EFECTOS Y CONTENEDORES DE FLOTILLA / TARJETAS ASIMÉTRICAS */
.fleet-card {
  background: var(--color-white);
  border-radius: 28px;
  border: 1px solid var(--color-border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.fleet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Insignias de confianza y exclusividad */
.badge-exclusive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--color-yellow-light);
  border: 1px solid var(--color-yellow-border);
  color: var(--color-yellow-dark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.badge-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--color-red-light);
  border: 1px solid rgba(217, 35, 45, 0.18);
  color: var(--color-red-primary);
  font-weight: 700;
  font-size: 12px;
}

.badge-navy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--color-navy-light);
  border: 1px solid rgba(27, 62, 75, 0.15);
  color: var(--color-navy);
  font-weight: 700;
  font-size: 12px;
}

/* 9. ESTILOS DE LEAFLET MAP */
.leaflet-popup-content-wrapper {
  border-radius: 20px !important;
  box-shadow: 0 16px 32px -6px rgba(27, 62, 75, 0.16) !important;
  padding: 4px !important;
  border: 1px solid var(--color-border-medium);
}
.leaflet-popup-content {
  margin: 14px 16px !important;
}
.leaflet-popup-tip {
  background: #FFFFFF !important;
}

/* Marcador Leaflet con pin rojo institucional */
.transvia-pin {
  width: 38px;
  height: 38px;
  background: var(--color-red-primary);
  color: #FFFFFF;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(217, 35, 45, 0.4);
  border: 2px solid #FFFFFF;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.transvia-pin > svg {
  transform: rotate(45deg);
}
.transvia-pin:hover {
  transform: rotate(-45deg) scale(1.15);
  background: var(--color-navy);
}

/* 10. ESTILOS DE PREGUNTAS FRECUENTES (FAQ ACCORDION) */
.faq-details {
  border: 1px solid var(--color-border-subtle);
  border-radius: 20px;
  background-color: var(--color-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
}
.faq-details:hover {
  border-color: var(--color-border-medium);
  box-shadow: var(--shadow-sm);
}
.faq-details[open] {
  border-color: rgba(27, 62, 75, 0.2);
  box-shadow: var(--shadow-sm);
}
.faq-summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.faq-summary::-webkit-details-marker {
  display: none;
}
.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-cream);
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.faq-details[open] .faq-icon {
  transform: rotate(180deg);
  background-color: var(--color-red-light);
  color: var(--color-red-primary);
}
.faq-content {
  padding: 0 22px 20px 22px;
  color: var(--color-text-body);
  font-size: 14px;
  line-height: 1.65;
}

/* 11. RESPETO A PREFERS-REDUCED-MOTION */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse-ring {
    display: none !important;
  }
}

