* {
    font-family: 'Nunito', sans-serif;
}

.container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1300px;
    /* Ampliado para que sea más estirado */
    margin: 0 auto 20px;
    gap: 30px;
    /* Más espacio entre columnas */
    align-items: flex-start;
}

.resultados-busqueda {
    flex: 1;
    min-width: 0;
}

.formulario {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 450px !important;
}

.btnComprar {
    max-width: 500px;
    text-align: center;
    margin: auto;
}

.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.tab-buttons {
    display: flex;
    align-items: center;
}

.resultados-busqueda h2 {
    font-family: "Raleway", Sans-serif;
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #000000;
    text-align: center;
}

.encabezado {
    color: black;
    font-weight: 800;
    font-size: 11px;
    /* Reducido de 14px */
    text-transform: uppercase;
}

.tablink {
    background-color: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    text-align: left;
    color: #aaa;
    transition: color 0.3s;
}

.tablink.active {
    color: #002856;
    font-weight: bold;
}

.switch-group {
    display: flex;
    align-items: center;
}

.switch-group .label-icon {
    margin-right: 10px;
    color: #aaa;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #8fc33a;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.input-group {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    background-color: #fff;
}

.label-icon {
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 14px;
    margin-bottom: 5px;
}

.label-icon img {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

.input-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-container img {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

select,
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    color: #002856;
    outline: none;
    box-sizing: border-box;
}

.select2-dropdown,
.select2-container--default .select2-selection--single {
    border: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #e5e5e5 !important;
    border-radius: 5px;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('https://www.autobusesplazadearmas.es/wp-content/plugins/horarios_autobus/public/assets/icons/arrow-down.svg');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

input[type="date"] {
    background-color: transparent;
    border: none;
    box-sizing: border-box;
    outline: 0;
    padding: .75rem;
    position: relative;
    width: 100%;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input[type="submit"] {
    background-color: #8fc33a;
    border: none;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.resultados-busqueda {
    width: 1000px;
}

.resultado {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px 20px;
    /* Aumentado un poco el padding lateral */
    margin-bottom: 12px;
    /* Margen reducido */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resultado-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    /* Centrado vertical para alineación con el icono central */
}

.resultado-detalles {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 210px;
    /* Reducido para dar más espacio a los textos de derecha */
    flex-shrink: 0;
}

.icono-tipo {
    max-width: 200px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.icono-tipo img {
    width: 100%;
}

.logo-bus {
    max-height: 40px;
    /* Logo más pequeño */
}

.descripcion {
    display: flex;
    flex-direction: column;
}

.ciudad {
    font-size: 16px;
    /* Ciudad un poco más pequeña */
    color: #002856;
    font-weight: bold;
}

.tipo {
    font-size: 14px;
    color: #aaa;
}

.salida {
    background-color: #285fe71f;
    color: #8fc33a;
    font-size: 14px;
    display: flex;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 300;
    align-items: center;
}



.resultado-horario {
    display: flex;
    justify-content: space-evenly;
    flex: 1;
    text-align: center;
    align-items: center;
    margin-left: 15px;
    margin-right: 5px;
    /* Margen de seguridad a la derecha */
}

.resultado-origen,
.resultado-destino {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.resultado-origen .ciudad,
.resultado-destino .ciudad {
    font-weight: 300;
}

.resultado-hora {
    font-size: 20px;
    /* Hora más pequeña */
    color: #002856;
    font-weight: bold;
    margin: auto;
}

.resultado-icono {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    /* Reducido de 20px */
    flex-shrink: 0;
}

.resultado-icono img {
    width: 60px;
    /* Reducido de 125px - este era el mayor problema */
    height: auto;
}

.resultado-paradas {
    color: #8fc33a;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.resultado-paradas .arrow-down {
    border: solid #8fc33a;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    margin-left: 5px;
    transform: rotate(45deg);
}

.resultado-comprar {
    background-color: #8fc33a;
    border: none;
    color: white;
    padding: 12px;
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    font-size: 18px;
    text-decoration: none;
}

/* Nuevos estilos para Salidas y Llegadas */

#Llegadas,
#Salidas {
    height: 330px;
    overflow: overlay;
}

/* ==========================================================================
   DISEÑO PRÓXIMAS SALIDAS/LLEGADAS (ha-prefix)
   ========================================================================== */

.ha-proximos-wrapper {
    max-width: 900px !important;
    margin: 40px auto !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Tabs */
.ha-tabs-container {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
}

.ha-tablink {
    background-color: #f1f1f1 !important;
    border: none !important;
    padding: 18px 25px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #cc417a !important;
    /* Rosa/Granate para inactivos */
    border-radius: 8px 8px 0 0 !important;
    flex: 1 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    outline: none !important;
}

.ha-tablink.active {
    background-color: #8fc33a !important;
    color: white !important;
}

/* Triángulo debajo del tab activo */
.ha-tablink.active::after {
    content: "" !important;
    position: absolute !important;
    bottom: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-width: 8px !important;
    border-style: solid !important;
    border-color: #8fc33a transparent transparent transparent !important;
    z-index: 20 !important;
}

/* Contenido de Tabs */
.ha-tabcontent {
    display: none !important;
}

.ha-tabcontent.active {
    display: block !important;
}

/* Tarjeta (Card) */
.ha-info-card {
    background-color: #ffffff !important;
    border-radius: 0 10px 10px 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    border: 1px solid #eee !important;
    position: relative !important;
    z-index: 10 !important;
}

.ha-scroll-container {
    max-height: 480px !important;
    overflow-y: auto !important;
}

/* Tabla */
.ha-tabla-proximos {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    background-color: #ffffff !important;
}

.ha-tabla-proximos thead {
    border-bottom: 2px solid #f1f1f1 !important;
    background-color: #ffffff !important;
}

.ha-tabla-proximos th {
    padding: 15px 20px !important;
    text-align: left !important;
    color: #8fc33a !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    border: none !important;
    background-color: #ffffff !important;
}

.ha-tabla-proximos td {
    padding: 16px 20px !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    color: #004c97 !important;
    /* Azul para el destino */
    vertical-align: middle !important;
    border: none !important;
}

/* Fila Zebra sutil */
.ha-tabla-proximos tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

.ha-tabla-proximos tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}

/* El texto de la última celda (hora) puede ser diferente si se desea */
.ha-tabla-proximos td:last-child {
    font-weight: 600 !important;
}

/* Iconos */
.ha-bus-icon {
    width: 22px !important;
    height: 22px !important;
    margin-right: 12px !important;
    vertical-align: middle !important;
    display: inline-block !important;
    filter: brightness(0) saturate(100%) invert(72%) sepia(58%) rotate(38deg) brightness(96%) contrast(89%) !important;
}

/* Scrollbar */
.ha-scroll-container::-webkit-scrollbar {
    width: 6px !important;
}

.ha-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

.ha-scroll-container::-webkit-scrollbar-thumb {
    background: #8fc33a !important;
    border-radius: 10px !important;
}

.ha-no-results {
    padding: 30px !important;
    text-align: center !important;
    color: #666 !important;
}

/* Responsivo para Próximas */
@media only screen and (max-width: 768px) {
    .ha-tabs-container {
        flex-direction: column !important;
        gap: 5px !important;
    }

    .ha-tablink {
        border-radius: 8px !important;
        padding: 15px !important;
    }

    .ha-info-card {
        border-radius: 10px !important;
    }
}

@media only screen and (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .formulario,
    .info-tabla-card {
        width: 100%;
        margin-bottom: 40px;
    }
}


.resultado-detalles {
    align-items: center;
    margin-bottom: 20px;
}

.dias-container {
    display: flex;
    flex-wrap: nowrap;
    /* Forzar una sola fila */
    gap: 4px;
    /* Reducido para ganar espacio */
}

.dia {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    font-size: 11px;
    color: white;
}

.activo {
    background-color: #8fc33a;
}

.inactivo {
    background-color: #ddd;
    color: #555;
}

.btn-back {
    background-color: #8fc33a;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    /* Estilo redondeado 'píldora' */
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(143, 195, 58, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-back:hover {
    background-color: #7db032;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(143, 195, 58, 0.4);
}

.btn-back:active {
    transform: translateY(0);
}

.btn-back::before {
    content: '←';
    font-size: 20px;
    line-height: 1;
}