/* ============================================================================
   Vuelame — kiwi-tabla.css
   ============================================================================
   Copiado del shortcode WP (vuelos-kiwi.css) tal cual.
   Se usa en el partial template/partials/meses.php (tabs con tabla Kiwi).
   IMPORTANTE: el markup tiene que mantenerse IDÉNTICO al shortcode WP
   original — clases `kiwi-tabla`, `kiwi-precio-badge`, etc.
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────
   Filtro escalas — Pill group (segmented control) arriba de la tabla.
   3 botones: Todos / Directos / Con escala. Estilo claro y compacto.
   Se centra debajo del toggle de meses con width:fit-content + margin auto.
   ───────────────────────────────────────────────────────────── */
.kiwi-filtro-escalas {
  display: flex;
  gap: 4px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
  margin: 0 auto 14px;
}
.kiwi-filtro-btn {
  padding: 7px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.kiwi-filtro-btn:hover:not(.activo):not(:disabled) { background: rgba(255,94,58,0.08); color: #ff5e3a; }
.kiwi-filtro-btn.activo { background: #ff5e3a; color: #fff; }
.kiwi-filtro-btn:disabled,
.kiwi-filtro-btn.deshabilitado {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Dark mode filtro */
body.dark-mode .kiwi-filtro-escalas { background: #374151; }
body.dark-mode .kiwi-filtro-btn { color: #d1d5db; }
body.dark-mode .kiwi-filtro-btn:hover:not(.activo):not(:disabled) { background: rgba(255,94,58,0.18); }
body.dark-mode .kiwi-filtro-btn.activo { background: #ff5e3a; color: #fff; }

@media (max-width: 600px) {
  .kiwi-filtro-escalas { padding: 3px; gap: 3px; margin-bottom: 10px; }
  .kiwi-filtro-btn { padding: 6px 11px; font-size: 12px; }
}

.kiwi-tabla-vuelos { margin: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); background: white; width: 100%; }
.kiwi-tabla-container { overflow-x: auto; width: 100%; }
.kiwi-tabla { width: 100%; border-collapse: collapse; font-family: "Manrope", sans-serif; font-size: 15px; table-layout: fixed; }
.kiwi-tabla thead { background: #ff5e3a; }
.kiwi-tabla th { color: white; padding: 16px 5px; font-weight: 600; font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e04a2a; text-align: center; vertical-align: middle; height: 50px; line-height: 50px; }
.kiwi-tabla td { padding: 15px 5px; border-bottom: 1px solid #dee2e6; text-align: center; vertical-align: middle; font-size: 15px; height: 70px; }
/* Anchos: IDA y VUELTA achicadas para dar más espacio al precio (badge).
   Aerolínea pasa a ser un logo de 28px, así que tampoco precisa tanto. */
.kiwi-tabla th.col-ida, .kiwi-tabla td.col-ida { width: 18%; text-align: center; }
.kiwi-tabla th.col-vuelta, .kiwi-tabla td.col-vuelta { width: 18%; text-align: center; }
.kiwi-tabla th.col-dias, .kiwi-tabla td.col-dias { width: 12%; text-align: center; }
.kiwi-tabla th.col-aerolinea, .kiwi-tabla td.col-aerolinea { width: 18%; text-align: center; }
.kiwi-tabla th.col-precio, .kiwi-tabla td.col-precio { width: 34%; text-align: center; }
.kiwi-tabla tbody tr:nth-child(even) { background-color: #f8f9fa; }
.kiwi-tabla tbody tr:hover { background-color: #e3f2fd; cursor: pointer; }
.kiwi-fecha-ida, .kiwi-fecha-vuelta { font-weight: 600; color: #2c3e50; font-size: 15px; line-height: 1.2; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; width: 100%; }
.kiwi-dias-viaje { display: flex; align-items: center; justify-content: center; height: 100%; }
.kiwi-dias-viaje .dias-numero { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 15px; background: #3498db; color: white; font-weight: 600; font-size: 14px; min-width: 40px; height: 30px; }
.kiwi-aerolinea-info { font-weight: 600; color: #2c3e50; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 5px; display: flex; align-items: center; justify-content: center; height: 100%; }

/* Logo de aerolínea (img servida por Kiwi) — desktop 32px, mobile 26px.
   El border-radius es estético; el contain evita que algunos logos cuadrados
   se vean estirados. */
.kiwi-aerolinea-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  background: #fff;        /* algunos logos blancos sobre transparente */
}
/* Fallback texto cuando el logo no carga (lo inyecta el onerror del img) */
.kiwi-aerolinea-codigo {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  color: #2c3e50;
  letter-spacing: 0.5px;
}
body.dark-mode .kiwi-aerolinea-codigo { color: #d1d5db; }

/* Ícono SVG del header (reemplaza el texto "Aerolínea"). */
.kiwi-tabla th .kiwi-th-icon {
  width: 20px; height: 20px;
  vertical-align: middle;
  fill: #ffffff;
}
.kiwi-precio-badge { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 20px; font-size: 1em; font-weight: 700; min-width: 95px; height: 40px; background: #2ecc71; color: white; box-shadow: 0 2px 4px rgba(46,204,113,0.3); transition: all 0.2s ease; gap: 4px; }
.kiwi-simbolo-moneda, .kiwi-precio-numero { font-weight: 700; white-space: nowrap; }
.kiwi-precio-badge:hover { background: #27ae60; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(46,204,113,0.4); }
.kiwi-footer { background: #f8f9fa; padding: 10px 20px; border-top: 1px solid #dee2e6; text-align: center; }
.kiwi-info-adicional { font-size: 0.85em; color: #6c757d; line-height: 1.4; }
.kiwi-error, .kiwi-info { background: #e8f4fd; border: 1px solid #b6d7f9; border-radius: 8px; padding: 20px; text-align: center; color: #2c5282; margin: 20px 0; }
.kiwi-error { background: #fee; border-color: #fcc; color: #c33; }
.kiwi-error p, .kiwi-info p { margin: 0; line-height: 1.6; }

/* Dark mode kiwi-tabla */
body.dark-mode .kiwi-tabla-vuelos { background: #1f2937; }
body.dark-mode .kiwi-tabla td { border-bottom-color: #374151; color: #e5e7eb; }
body.dark-mode .kiwi-tabla tbody tr:nth-child(even) { background-color: #374151; }
body.dark-mode .kiwi-tabla tbody tr:hover { background-color: #4b5563; }
body.dark-mode .kiwi-fecha-ida, body.dark-mode .kiwi-fecha-vuelta { color: #d1d5db; }
body.dark-mode .kiwi-aerolinea-info { color: #d1d5db; }
body.dark-mode .kiwi-footer { background: #374151; border-top-color: #4b5563; }
body.dark-mode .kiwi-info-adicional { color: #9ca3af; }

@media (max-width: 767px) {
  .kiwi-tabla { font-size: 14px; }
  .kiwi-tabla th, .kiwi-tabla td { padding: 12px 3px; font-size: 14px; height: 60px; }

  /* Badge de precio: 1px menos de fuente para que al cambiar a monedas
     con números largos (ARS, COP) no se corte. */
  .kiwi-precio-badge { min-width: 78px; padding: 6px 8px; height: 34px; font-size: 0.92em; gap: 2px; }
  .kiwi-simbolo-moneda, .kiwi-precio-numero { font-size: 13px; }

  .kiwi-dias-viaje .dias-numero { font-size: 12px; padding: 4px 4px; min-width: 15px; height: 26px; }
  .kiwi-aerolinea-info { font-size: 13px; }
  .kiwi-fecha-ida, .kiwi-fecha-vuelta { font-size: 13px; }

  /* Logo aerolínea más chico en móvil */
  .kiwi-aerolinea-logo { width: 26px; height: 26px; border-radius: 5px; }
  .kiwi-tabla th .kiwi-th-icon { width: 18px; height: 18px; }
}
