/* Responsive del plugin Horarios Autobus */

/* Base layout */
.horarios-autobus.container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}

.horarios-autobus.container .resultados-busqueda {
    flex: 1 1 420px;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.ha-shortcode-scope.formulario {
    width: min(100%, 450px) !important;
    max-width: 100% !important;
    margin-inline: auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

.ha-shortcode-scope.formulario form,
.ha-shortcode-scope .resultado,
.ha-shortcode-scope .resultado-info,
.ha-shortcode-scope .resultado-horario {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ha-shortcode-scope .resultado-detalles {
    margin-bottom: 0;
}

.ha-shortcode-scope .resultado-horario {
    gap: 10px;
}

/* Proximas salidas/llegadas */
.ha-proximos-wrapper {
    width: 100%;
    max-width: 100% !important;
    padding: 0 12px !important;
    box-sizing: border-box;
}

.ha-scroll-container {
    overflow-x: auto !important;
}

.ha-tabla-proximos {
    min-width: 640px;
}

@media only screen and (min-width: 769px) {
    .ha-shortcode-scope.formulario {
        width: min(100%, 560px) !important;
        max-width: 560px !important;
    }

    .ha-shortcode-scope.horarios-autobus.container {
        flex-wrap: nowrap;
        gap: 20px;
    }

    .ha-shortcode-scope.horarios-autobus.container .resultados-busqueda {
        flex: 1 1 0;
        width: auto !important;
        min-width: 0;
    }

    .ha-shortcode-scope .resultados-busqueda h2 {
        margin-bottom: 10px;
    }

    .ha-shortcode-scope .resultado {
        padding: 8px 14px;
        margin-bottom: 8px;
    }

    .ha-shortcode-scope .resultado-detalles {
        width: 130px;
    }

    .ha-shortcode-scope .logo-bus {
        max-height: 26px;
    }

    .ha-shortcode-scope .resultado-detalles .encabezado,
    .ha-shortcode-scope .tipo-circulacion,
    .ha-shortcode-scope .resultado-origen .encabezado,
    .ha-shortcode-scope .resultado-destino .encabezado {
        display: none !important;
    }

    .ha-shortcode-scope .dias-container {
        gap: 2px;
    }

    .ha-shortcode-scope .dia {
        width: 14px;
        height: 14px;
        line-height: 14px;
        font-size: 7px;
    }

    .ha-shortcode-scope .resultado-horario {
        margin-left: 8px;
        margin-right: 0;
        gap: 6px;
    }

    .ha-shortcode-scope .resultado-hora {
        font-size: 18px;
    }

    .ha-shortcode-scope .ciudad {
        font-size: 14px;
    }
}

@media only screen and (min-width: 1200px) {
    .ha-shortcode-scope.horarios-autobus.container {
        max-width: 1640px;
    }

    .ha-shortcode-scope.horarios-autobus.container .resultados-busqueda {
        flex: 1 1 560px;
    }

    .ha-shortcode-scope .resultado {
        padding: 10px 18px;
        margin-bottom: 10px;
    }

    .ha-shortcode-scope .resultado-info {
        align-items: center;
    }

    .ha-shortcode-scope .resultado-detalles {
        width: 180px;
    }

    .ha-shortcode-scope .logo-bus {
        max-height: 34px;
    }
}

@media only screen and (max-width: 1024px) {
    .ha-shortcode-scope.container {
        gap: 18px;
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }

    .ha-shortcode-scope .resultados-busqueda h2 {
        font-size: 1.6rem;
    }
}

@media only screen and (max-width: 768px) {
    .elementor-widget-container > .ha-shortcode-scope.formulario {
        margin-top: 20px !important;
    }

    .ha-shortcode-scope.container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .ha-shortcode-scope .resultados-busqueda {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }

    .ha-shortcode-scope .results-list {
        margin: 0 !important;
        padding: 0 !important;
    }

    .ha-shortcode-scope.formulario {
        width: 100% !important;
        padding: 16px;
        margin: 16px auto 0 !important;
    }

    .ha-shortcode-scope .input-group {
        padding: 12px;
    }

    .ha-shortcode-scope .resultados-busqueda h2 {
        font-size: 1.35rem;
        margin: 0 0 12px;
    }

    .ha-shortcode-scope .resultado {
        padding: 14px;
    }

    .ha-shortcode-scope .resultado-info {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: stretch;
    }

    .ha-shortcode-scope .resultado-detalles {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 6px;
        border-bottom: 1px solid #edf1f5;
        gap: 8px;
    }

    .ha-shortcode-scope .resultado-detalles .encabezado {
        display: none;
    }

    .ha-shortcode-scope .icono-tipo {
        max-width: 96px;
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .ha-shortcode-scope .tipo-circulacion {
        display: none !important;
    }

    .ha-shortcode-scope .dias-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 2px;
        margin-left: auto;
        overflow: hidden;
    }

    .ha-shortcode-scope .resultado-horario {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        margin: 0;
        justify-content: space-between;
        gap: 8px;
        align-items: center;
    }

    .ha-shortcode-scope .resultado-icono {
        display: none;
    }

    .ha-shortcode-scope .resultado-origen,
    .ha-shortcode-scope .resultado-destino {
        display: flex !important;
        flex-direction: column !important;
        width: 48%;
        align-items: flex-start;
        text-align: left;
    }

    .ha-shortcode-scope .resultado-origen .encabezado,
    .ha-shortcode-scope .resultado-destino .encabezado {
        display: none;
    }

    .ha-shortcode-scope .resultado-destino {
        align-items: flex-end;
        text-align: right;
    }

    .ha-shortcode-scope .resultado-hora {
        font-size: 18px;
        line-height: 1;
    }

    .ha-shortcode-scope .ciudad {
        font-size: 13px;
        text-align: inherit;
    }

    .ha-tabs-container {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .ha-tablink {
        border-radius: 8px !important;
        padding: 13px !important;
        font-size: 14px !important;
    }

    .ha-tablink.active::after {
        display: none !important;
    }

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

    .ha-tabla-proximos th,
    .ha-tabla-proximos td {
        padding: 12px 14px !important;
    }
}

@media only screen and (max-width: 480px) {
    .ha-shortcode-scope.container {
        padding-left: 8px;
        padding-right: 8px;
        gap: 12px;
    }

    .ha-shortcode-scope.formulario {
        padding: 12px;
        margin: 14px auto 0 !important;
    }

    .ha-shortcode-scope .input-group {
        padding: 10px;
        margin-bottom: 10px;
    }

    .ha-shortcode-scope select,
    .ha-shortcode-scope input[type="date"],
    .ha-shortcode-scope input[type="submit"] {
        font-size: 15px;
    }

    .ha-shortcode-scope .resultado {
        padding: 12px;
        margin-bottom: 8px;
    }

    .ha-shortcode-scope .resultado-detalles {
        gap: 8px;
        padding-bottom: 5px;
    }

    .ha-shortcode-scope .icono-tipo {
        max-width: 86px;
    }

    .ha-shortcode-scope .resultado-horario {
        gap: 4px;
    }

    .ha-shortcode-scope .resultado-hora {
        font-size: 16px;
    }

    .ha-shortcode-scope .ciudad {
        font-size: 12px;
    }

    .ha-shortcode-scope .dias-container {
        gap: 2px;
    }

    .ha-shortcode-scope .dia {
        width: 16px;
        height: 16px;
        line-height: 16px;
        font-size: 8px;
    }

    .ha-proximos-wrapper {
        padding: 0 8px !important;
    }

    .ha-tabla-proximos {
        min-width: 560px;
    }
}

@media only screen and (max-width: 640px) {
    .ha-scroll-container {
        max-height: none !important;
        overflow-x: hidden !important;
    }

    .ha-tabla-proximos {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 10px !important;
        background: transparent !important;
    }

    .ha-tabla-proximos thead {
        display: none !important;
    }

    .ha-tabla-proximos tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e8edf3 !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
    }

    .ha-tabla-proximos tbody td {
        display: grid !important;
        grid-template-columns: 84px 1fr !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 5px 0 !important;
        border: none !important;
        font-size: 13px !important;
    }

    .ha-tabla-proximos tbody td::before {
        content: attr(data-label);
        font-size: 10px !important;
        letter-spacing: 0.2px;
        text-transform: uppercase;
        color: #8fc33a !important;
        font-weight: 700 !important;
    }

    .ha-tabla-proximos .ha-bus-icon {
        display: none !important;
    }

    .ha-tabla-proximos .ha-linea-text {
        display: inline-block;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .ha-tabla-proximos .ha-time-cell {
        font-weight: 700 !important;
        color: #002856 !important;
    }
}

@media only screen and (max-width: 380px) {
    .ha-tabla-proximos {
        border-spacing: 0 8px !important;
    }

    .ha-tabla-proximos tbody tr {
        padding: 7px 8px !important;
        border-radius: 8px !important;
    }

    .ha-tabla-proximos tbody td {
        grid-template-columns: 76px 1fr !important;
        gap: 6px !important;
        padding: 4px 0 !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    .ha-tabla-proximos tbody td::before {
        font-size: 9px !important;
    }

}
