/* 
 * Estilos para shortcode de vuelos Aviasales
 * Versión 1.5.0 - NUEVO DISEÑO
 */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

/* ============================================================================
   RESET COMPLETO
   ============================================================================ */

.aviasales-tabla-vuelos,
.aviasales-tabla-vuelos * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
}

.aviasales-tabla-vuelos {
    margin: 25px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: white;
    width: 100%;
}

/* ============================================================================
   TABLA PRINCIPAL
   ============================================================================ */

.aviasales-tabla-container {
    overflow-x: auto;
    width: 100%;
}

.aviasales-tabla {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    table-layout: fixed;
}

/* CABECERA NARANJA */
.aviasales-tabla thead {
    background: #ff5e3a !important;
}

.aviasales-tabla th {
    color: white !important;
    padding: 16px 5px !important;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e04a2a;
    font-family: 'Onest', sans-serif !important;
    text-align: center !important;
    vertical-align: middle !important;
    height: 60px;
    background: #ff5e3a !important;
}

/* CUERPO */
.aviasales-tabla td {
    padding: 15px 5px !important;
    border-bottom: 1px solid #dee2e6;
    text-align: center !important;
    vertical-align: middle !important;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    height: 70px;
}

/* Distribución de columnas */
.aviasales-tabla th.col-fechas,
.aviasales-tabla td.col-fechas {
    width: 25%;
}

.aviasales-tabla th.col-duracion,
.aviasales-tabla td.col-duracion {
    width: 15%;
}

.aviasales-tabla th.col-aerolinea,
.aviasales-tabla td.col-aerolinea {
    width: 20%;
}

.aviasales-tabla th.col-escalas,
.aviasales-tabla td.col-escalas {
    width: 20%;
}

.aviasales-tabla th.col-precio,
.aviasales-tabla td.col-precio {
    width: 20%;
}

/* Filas alternas */
.aviasales-tabla tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.aviasales-tabla tbody tr:hover {
    background-color: #e3f2fd;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* ============================================================================
   ESTILOS DE COLUMNAS - NUEVO DISEÑO
   ============================================================================ */

/* FECHAS - UNA SOLA LÍNEA */
.aviasales-fechas {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.fechas-linea {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 5px;
    line-height: 1.2;
}

.fecha-salida,
.fecha-regreso {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.fecha-flecha {
    color: #6c757d;
    margin: 0 3px;
    font-size: 0.9em;
}

.dias-viaje {
    color: #6c757d;
    font-size: 0.85em;
    margin-left: 5px;
}

/* DURACIÓN */
.aviasales-duracion {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

/* AEROLÍNEA */
.aviasales-aerolinea {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
}

/* ESCALAS - TEXTO SIMPLE (NO BADGE) */
.aviasales-escalas-texto {
    font-weight: 500;
    color: #2c3e50;
    font-size: 15px;
}

/* PRECIO - CON ESTILO DE BADGE VERDE */
.aviasales-precio-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 700;
    min-width: 100px;
    height: 40px;
    background: #2ecc71;
    color: white;
    font-family: 'Onest', sans-serif;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
    transition: all 0.2s ease;
}

.aviasales-precio-badge:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.4);
}

/* ============================================================================
   RESPONSIVE MÓVIL - OCULTAR ESCALAS, MOSTRAR DURACIÓN
   ============================================================================ */

/* ESCRITORIO (más de 768px) */
@media (min-width: 768px) {
    .aviasales-tabla {
        min-width: 700px;
    }
    
    .aviasales-tabla th,
    .aviasales-tabla td {
        font-size: 16px;
        padding: 16px 8px !important;
    }
    
    .fecha-salida,
    .fecha-regreso {
        font-size: 16px;
    }
    
    .aviasales-precio-badge {
        font-size: 1.1em;
        min-width: 110px;
        height: 42px;
    }
}

/* MÓVIL (menos de 768px) - OCULTAR ESCALAS, MOSTRAR DURACIÓN */
@media (max-width: 767px) {
    .aviasales-tabla {
        font-size: 14px !important;
        min-width: 100%;
    }
    
    .aviasales-tabla th,
    .aviasales-tabla td {
        padding: 12px 4px !important;
        font-size: 14px !important;
        height: 60px;
    }
    
    /* OCULTAR ESCALAS EN MÓVIL, MOSTRAR DURACIÓN */
    .aviasales-tabla th.col-escalas,
    .aviasales-tabla td.col-escalas,
    .aviasales-tabla th.col-aerolinea,
    .aviasales-tabla td.col-aerolinea {
        display: none !important;
    }
    
    /* REDISTRIBUIR ANCHOS EN MÓVIL */
    .aviasales-tabla th.col-fechas,
    .aviasales-tabla td.col-fechas {
        width: 40%;
    }
    
    .aviasales-tabla th.col-duracion,
    .aviasales-tabla td.col-duracion {
        width: 30%;
    }
    
    .aviasales-tabla th.col-precio,
    .aviasales-tabla td.col-precio {
        width: 30%;
    }
    
    /* FECHAS EN UNA LÍNEA - COMPRIMIDO */
    .fechas-linea {
        flex-wrap: nowrap;
        gap: 3px;
        font-size: 13px;
    }
    
    .fecha-salida,
    .fecha-regreso {
        font-size: 13px !important;
    }
    
    .fecha-flecha {
        margin: 0 2px;
        font-size: 0.8em;
    }
    
    .dias-viaje {
        font-size: 0.75em;
        margin-left: 3px;
    }
    
    /* PRECIO MÓVIL */
    .aviasales-precio-badge {
        min-width: 85px;
        padding: 6px 12px;
        font-size: 0.95em;
        height: 36px;
    }
}

/* MÓVILES MUY PEQUEÑOS (menos de 480px) */
@media (max-width: 479px) {
    .aviasales-tabla th,
    .aviasales-tabla td {
        padding: 10px 3px !important;
        font-size: 13px !important;
        height: 55px;
    }
    
    .fechas-linea {
        font-size: 12px;
    }
    
    .fecha-salida,
    .fecha-regreso {
        font-size: 12px !important;
    }
    
    .aviasales-precio-badge {
        min-width: 75px;
        padding: 5px 10px;
        font-size: 0.9em;
        height: 34px;
    }
}

/* ============================================================================
   CONVERSIÓN DE MONEDA
   ============================================================================ */

/* Selector de moneda en el sitio (si existe) */
.currency-selector {
    margin-bottom: 15px;
}

/* Estilo para precio convertido */
.aviasales-precio-convertido {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 3px;
}

/* ============================================================================
   FILTROS ACTIVOS
   ============================================================================ */

.aviasales-filtros-activos {
    background: rgba(255, 94, 58, 0.1);
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 94, 58, 0.2);
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aviasales-filtro-badge {
    background: #ff5e3a;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Onest', sans-serif;
}

/* ============================================================================
   PIE DE TABLA
   ============================================================================ */

.aviasales-footer {
    background: #f8f9fa;
    padding: 10px 20px;
    border-top: 1px solid #dee2e6;
    font-family: 'Manrope', sans-serif;
    text-align: center;
}

.aviasales-info-adicional {
    text-align: center;
    font-size: 0.85em;
    color: #6c757d;
    line-height: 1.4;
}

/* ============================================================================
   EFECTOS HOVER
   ============================================================================ */

.aviasales-tabla tbody tr.hover-activo {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* ============================================================================
   !IMPORTANT PARA FORZAR ESTILOS
   ============================================================================ */

.aviasales-tabla thead,
.aviasales-tabla thead tr,
.aviasales-tabla thead th {
    background-color: #ff5e3a !important;
    background: #ff5e3a !important;
}

.aviasales-tabla th,
.aviasales-tabla td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* ============================================================================
   CONVERSIÓN DE MONEDA
   ============================================================================ */

/* Indicador de carga durante conversión */
.conversion-loading {
    display: inline-block;
    animation: conversionPulse 1.5s infinite;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes conversionPulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

/* Asegurar que los badges mantengan su estilo durante conversión */
.aviasales-precio-badge {
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
}

.aviasales-precio-badge.converting {
    background: #f39c12 !important; /* Color naranja durante conversión */
}

/* Para mostrar precio original en tooltip opcional */
.aviasales-precio-original {
    font-size: 0.75em;
    opacity: 0.7;
    display: block;
    margin-top: 2px;
}