/* ============================================================================
   Vuelame — home.css
   ============================================================================
   Estilos EXCLUSIVOS de la home (/):
     - Hero (texto animado + globo 3D)
     - Offers section + carrusel
     - Monitor intro (banda cyan)
     - Flight monitor grid (continentes + filas de vuelo)
     - Responsive de home
   No se carga en /vuelos-X-Y/.
   ========================================================================== */

/* ================================================================
   HERO
================================================================ */
.hero {
  padding: 50px 0 50px;
  background: #ff731e;
  background: var(--color-hero, #ff731e);
}
/* En dark mode el naranja se mantiene igual (decisión de marca) */
body.dark-mode .hero { background: #ff731e; }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-text {}

.hero-h1 {
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
body.dark-mode .hero-h1 { color: #423430; }

.fancy-wrap {
  font-family: var(--font-title);
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  line-height: 1.05;
  letter-spacing: -0.02em;
  min-height: 1.2em;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
}

#fancyText {
  display: inline-block;
  opacity: 1;
  transition: opacity 0.35s ease;
}
#fancyText.fade { opacity: 0; }

body.dark-mode #fancyText { color: #423430; }

.hero-desc {
  color: rgba(255,255,255,0.82);
  font-size: 16px;
  max-width: 420px;
  margin-bottom: 30px;
  line-height: 1.65;
  font-weight: 600;
}

body.dark-mode .hero-desc { color: #423430; }

/* Subscribe form — sobre fondo naranja */
.subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
}
.subscribe-form input[type="email"] {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--border-radius);
  border: none;
  background: rgba(255,255,255,0.95);
  color: #24262B;
  font-family: var(--font-text);
  font-size: 16px;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s;
}
.subscribe-form input[type="email"]::placeholder { color: #999; }
.subscribe-form input[type="email"]:focus { box-shadow: 0 2px 12px rgba(0,0,0,0.22); }
.subscribe-form button {
  padding: 13px 22px;
  background: #24262B;
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.subscribe-form button:hover { background: #32353C; }

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-image img { max-width: 100%; }

/* ================================================================
   OFFERS SECTION
================================================================ */
.offers-section {
  padding: 44px 0 56px;
  background: var(--bg);
}

.offers-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 24px;
}

/* Carousel */
.carousel-wrapper {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 15px;
  transition: transform 0.42s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* Cards estáticas: cada card es un <a> y toda la tarjeta es clickeable.
   Sin shadow, sin hover-lift, sin zoom, sin overlay oscuro. */
.offer-card {
  flex: 0 0 calc(25% - 12px);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.offer-card:hover { opacity: 1; }   /* el <a> global pone opacity:0.8, lo anulamos */

.offer-img-holder {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  display: block;
}
.offer-img-holder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offer-body {
  padding: 13px 16px 15px;
}
.offer-subtitle {
  font-size: 12.5px;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 4px;
  font-family: var(--font-text);
}
.offer-precio {
  /* el JS sustituye este texto según la moneda elegida */
  font-weight: 700;
  font-size: 14.5px;
  font-family: var(--font-text);
  /* Símbolo + cifra NUNCA se separan: si no entra, baja "Desde" arriba y el
     bloque "U$S 590" / "$1.234" queda entero abajo. Consistente en toda moneda. */
  white-space: nowrap;
}
.offer-body h3,
.offer-body h4,
.offer-body h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

/* ─── 1D — Card "hero vertical" del slider ─────────────────────────────
   Foto del origen arriba, foto del destino abajo, círculo central con el
   ícono de ida/vuelta (mismo concepto que el hero de la página de ruta),
   y franja inferior con precio + badge. Mantiene la clase .offer-card para
   que el carrusel siga midiendo el ancho igual. */
.offer-hero { background: var(--bg-card); }

/* Split vertical: las dos fotos lado a lado (origen | destino), igual que el
   hero de la ruta. El círculo va en la unión central. */
.offer-hero-split {
  position: relative;
  display: flex;
}

.offer-hero-img {
  flex: 1;
  height: 220px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: var(--border);   /* fallback si la foto no carga */
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
/* Overlay negro semitransparente para legibilidad, igual que el hero de la ruta. */
.offer-hero-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.offer-hero-img .offer-hero-city { position: relative; z-index: 2; }
/* La etiqueta del destino (columna derecha) va abajo a la derecha, lejos del círculo. */
.offer-hero-bot { justify-content: flex-end; }

/* Subtítulo explicativo bajo "Ofertas que vuelan" */
.offers-sub {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: -4px 0 16px;
  max-width: 720px;
}
.offers-sub strong { color: var(--color-primary); font-weight: 700; }

.offer-hero-city {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.offer-hero-circle {
  position: absolute;
  top: 50%;                          /* centro de la card (unión de las 2 fotos) */
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);       /* el SVG inline usa currentColor */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}
.offer-hero-circle svg,
.offer-hero-circle img { width: 24px; height: 24px; }

.offer-hero-foot {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.offer-hero-foot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.offer-hero-foot-top .offer-subtitle { margin: 0; }

/* Nombre de la ruta debajo del precio (como estaba antes) */
.offer-hero-ruta {
  font-family: 'Onest', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

/* Badge "Índice de Oportunidad" (franja inferior).
   El color lo define el modificador --verde / --ambar / --rojo, congruente
   con el chart de precios históricos de la página de ruta. */
.offer-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-text);
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  background: var(--color-primary);   /* fallback si falta el modificador */
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
  white-space: nowrap;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}
.offer-badge-ico { width: 13px; height: 13px; flex: 0 0 auto; }

/* Gradiente de color — mismos tonos que las barras del chart histórico. */
.offer-badge--verde { background: #16a34a; }   /* buen momento  (>=70) */
.offer-badge--ambar { background: #f59e0b; }   /* precio normal (40-69) */
.offer-badge--rojo  { background: #ef4444; }   /* caro          (<40)  */

.offer-badge--soft {
  color: var(--color-primary);
  background: rgba(255,94,58,0.12);
}

/* ─── Bloque explicativo bajo el título "Ofertas que vuelan" ───────────
   Reemplaza al viejo .offers-sub (texto plano). Card suave con un chip de
   ejemplo a la izquierda para que se entienda el badge de un vistazo. */
.offers-explain {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 760px;
  margin: -4px 0 22px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.offers-explain-chip {
  /* reusa el look del badge, agrandado, como muestra */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(22,163,74,0.28);
}
.offers-explain-chip .offer-badge-ico { width: 16px; height: 16px; }
.offers-explain-text {
  font-family: var(--font-text);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.offers-explain-text strong { color: var(--text); font-weight: 700; }
.offers-explain-text em { font-style: normal; font-weight: 700; }
.oe-verde { color: #16a34a; }
.oe-ambar { color: #d97706; }
.oe-rojo  { color: #ef4444; }

@media (max-width: 600px) {
  .offers-explain { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Carousel nav: flechas + dots + contador */
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}
.carousel-arrows {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.carousel-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  padding: 0;
}
.carousel-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.carousel-arrow:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255,115,30,0.32), 0 2px 6px rgba(0,0,0,0.08);
}
.carousel-arrow:active { transform: translateY(0); }
body.dark-mode .carousel-arrow {
  background: var(--bg-card);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.carousel-counter {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex: 1;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot:hover { transform: scale(1.3); }
.carousel-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

/* ================================================================
   MONITOR INTRO
================================================================ */
.monitor-intro {
  padding: 40px 0;
  background: #35c6c9;
}
/* En dark mode el cyan también se mantiene igual */
body.dark-mode .monitor-intro { background: #35c6c9; }

.monitor-intro-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.mi-eyebrow {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

body.dark-mode .mi-eyebrow {color: #2f4a82;}

.mi-title {
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
body.dark-mode .mi-title {color: #2f4a82;}
.mi-desc {
  color: rgba(255,255,255,0.92);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}
body.dark-mode .mi-desc {color: #2f4a82;}
.monitor-img img { border-radius: var(--border-radius); }

/* ================================================================
   FLIGHT MONITOR GRID
================================================================ */
.flight-monitor { padding: 60px 0; background: var(--bg); }

.continents-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.continents-row:last-child { margin-bottom: 0; }

.continent-block {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 0 18px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.22s;
  overflow: hidden;
}
.continent-block:hover { box-shadow: var(--shadow-hover); }

/* Header banner — imagen del continente cubriendo todo el encabezado.
   Desktop: aspect-ratio 3:1. Mobile: 5:2 (un poco más alto). */
.continent-img {
  margin: 0 -18px 18px;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  background: #c9efef;
}
.continent-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Tipografía del card (igual al WP original: Onest 16/600) */
.continent-title {
  font-family: 'Onest', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 14px;
  margin-top: 4px;
  line-height: 1.3;
}

.origin-group { margin-bottom: 14px; }
.origin-group:last-of-type { margin-bottom: 10px; }

.origin-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.fila-vuelo {
  cursor: pointer;
  border-radius: 6px;
  margin: 0 -6px;
  padding: 7px 6px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.fila-vuelo:hover { background: rgba(255,115,30,0.06); }
.fila-vuelo:last-of-type { border-bottom: none; }

/* Textos y precios sin bold (preferencia de marca) */
.columna-texto {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  white-space: normal;
  flex: 1;
  min-width: 0;
}
.columna-precio {
  flex-shrink: 0;
  text-align: right;
}

/* Badge tipo pill — mismo patrón que .otras-precio-link en la página de ruta.
   El border + padding + radius arman el "chip" naranja semitransparente
   alrededor del precio. Sin hover propio: el hover-tint lo maneja .fila-vuelo
   (la fila completa es clickeable y abre el tooltip con info de la oferta). */
.precio-vuelo {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 60px;
  text-align: center;
  font-family: var(--font-text);
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 94, 58, 0.35);
}

/* Loader punteado mientras esperamos respuesta de la API — sigue visible
   dentro del pill, así la caja no se "desinfla" entre estados. */
.precio-vuelo:empty::after,
.precio-vuelo.loading::after {
  content: '···';
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 2px;
  animation: blink 1.2s step-start infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.ver-mas {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}
.ver-mas:hover { text-decoration: underline; opacity: 1; }

/* ================================================================
   RESPONSIVE — home
================================================================ */
@media (max-width: 1024px) {
  .continents-row { grid-template-columns: repeat(2, 1fr); }
  /* 3 cards visibles en tablet */
  .offer-card    { flex: 0 0 calc(33.333% - 10px); }
}

@media (max-width: 768px) {
  /* Carrusel 600-768px (phablets/tablets chicas): 2 cards. Abajo de 600px,
     el bloque @media 600 lo pisa y muestra 1 sola card full-width. */
  .offer-card { flex: 0 0 calc(50% - 8px); }

  /* Hero móvil — texto arriba centrado, globo abajo más grande */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-h1   {
    text-align: center;
    font-size: 36px;
    letter-spacing: -0.03em;
    line-height: 1.05;
  }
  .fancy-wrap {
    justify-content: center;
    text-align: center;
    font-size: 34px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 18px;
  }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .subscribe-form { width: 100%; max-width: 420px; margin: 0 auto; }
  .hero-image { order: 2; }
  .hero-image img {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    height: auto;
  }

  .monitor-intro-inner { grid-template-columns: 1fr; gap: 28px; }
  .monitor-img { order: 1; }

  .continents-row  { grid-template-columns: 1fr; }

  .origin-label    { font-size: 12px; letter-spacing: 0.06em; }
  .hero            { padding: 44px 0 40px; }

  /* Continent header en mobile: la card es full-width, así que mantenemos
     el mismo aspect 3:1 (como desktop) pero forzamos a que la imagen se vea
     COMPLETA con contain — antes recortaba los lados. El fondo cyan claro
     cubre el espacio sobrante. */
  .continent-img {
    aspect-ratio: 3 / 1;
    background: linear-gradient(135deg, #c9efef 0%, #b3e5e5 100%);
  }
  .continent-img img {
    object-fit: contain;            /* imagen completa, sin recortar */
    object-position: center;
  }

  .fila-vuelo { padding: 9px 6px; }
  .fila-vuelo:active { background: rgba(255,115,30,0.1); }
}

@media (max-width: 600px) {
  /* Carrusel en teléfonos: 1 sola card a todo el ancho (la rotación sigue 1 a 1).
     Va después del bloque 768px, así gana en pantallas chicas. */
  .offer-card { flex: 0 0 100%; }

  /* Con la card full-width sobra espacio: fotos más altas y tipografías más
     grandes para que se destaquen precio, ruta y badge. */
  .offer-hero-img  { height: 220px; }
  .offer-hero-ruta { font-size: 16px; }
  .offer-precio    { font-size: 14.5px; }
  .offer-badge     { font-size: 14.5px; }
}

@media(max-width:420px){

  .hero { padding: 40px 0 40px; }

  .continent-img {
    aspect-ratio: 3 / 1;
    background: linear-gradient(to right, #00e3b8 0%, #00acf8 100%);
  }

  /* Textos y precios sin bold (preferencia de marca) */
  .columna-texto {
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    line-height: 1.4;
    white-space: normal;
    flex: 1;
    min-width: 0;
  }
  .columna-precio {
    flex-shrink: 0;
    text-align: right;
  }

  .precio-vuelo {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 56px;
    text-align: center;
    font-family: var(--font-text);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 94, 58, 0.35);
  }
  .hero-h1 {
    font-size: 38px;
  }
  .fancy-wrap {
    font-size: 38px;
  }
}
