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

.container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 2200px !important;
    margin: 0 auto 20px;
    gap: 30px;
    align-items: flex-start;
}

#ha-resultados-wrapper {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    width: 100%;
    max-width: 2200px;
    margin: 0 auto 20px;
    gap: 30px;
    align-items: flex-start;
    padding: 0 15px;
}

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

.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;
}

.ha-results-buy-wrap {
    margin-bottom: 25px;
}

.ha-results-buy-wrap .resultado-comprar {
    display: block;
    width: 100%;
}

.ha-results-actions {
    width: 100%;
    margin: 0 0 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
}

.ha-results-actions--bottom {
    margin: 20px 0 10px;
}

.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;
    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;
    justify-content: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #002856 0%, #003d73 100%);
    border-radius: 10px;
    gap: 15px;
}

.switch-group .label-icon {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.3s, color 0.3s;
}

.switch-group .label-icon.active {
    color: #8fc33a;
}

.switch-group .label-icon:first-child {
    margin-right: 5px;
}

.switch-group .label-icon:last-child {
    margin-left: 5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    margin: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a5a8a;
    transition: .4s;
    border-radius: 30px;
    border: 2px solid #fff;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

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

input:focus+.slider {
    box-shadow: 0 0 1px #8fc33a;
}

.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;
}

.resultado {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resultado-info {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 25px;
    width: 100%;
    align-items: flex-start;
}

.resultado-detalles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.resultado-detalles .encabezado {
    margin: 0;
    order: -1;
}

.dias-container {
    order: 1;
}

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

.icono-tipo img {
    width: 100%;
    max-width: 150px;
    height: auto;
}

.logo-bus {
    max-height: 24px !important;
}

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

.ciudad {
    font-size: 16px;
    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;
}

.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;
    color: #002856;
    font-weight: bold;
    margin: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.resultado-hora-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, #98d13b 0%, #75b51f 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(117, 181, 31, 0.28);
}

.resultado-icono {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    margin: 0 10px;
    flex-shrink: 0;
}

.resultado-icono img {
    width: 60px;
    height: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.resultado-duracion {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.resultado-duracion {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 800;
    color: #1f3a18;
    letter-spacing: 0.4px;
    text-align: center;
}

.resultado-dia-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #299105;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.resultado-dia-plus-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #299105;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.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 {
    animation: parpadeo 5s ease infinite;
    -webkit-animation: parpadeo 5s ease infinite;
    background: #299105;
    color: #fff;
    border: 3px solid transparent;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: bold;
    font-size: clamp(14px, 4vw, 18px);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.15s ease;
}

.resultado-comprar:hover {
    transform: translateY(-1px) scale(1.01);
}

.ha-compra-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.ha-compra-modal[aria-hidden="false"] {
    display: block;
}

.ha-compra-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ha-compra-modal-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 10px;
    padding: 25px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.ha-compra-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

@keyframes parpadeo {
    0%, 100% {
        background: #299105;
        color: #fff;
        border: 3px solid transparent;
    }
    50% {
        background: #fff;
        color: #299105;
        border: 3px solid #299105;
    }
}

@-webkit-keyframes parpadeo {
    0%, 100% {
        background: #299105;
        color: #fff;
        border: 3px solid transparent;
    }
    50% {
        background: #fff;
        color: #299105;
        border: 3px solid #299105;
    }
}

.ha-compra-modal-content h3 {
    margin: 0 0 8px;
    color: #002856;
}

.ha-compra-modal-content p {
    margin: 0 0 15px;
    color: #555;
}

.ha-compra-date-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ha-compra-date-row input[type="date"] {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 10px;
}

.ha-compra-confirm {
    border: none;
    border-radius: 6px;
    background: #002856;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
}

.ha-compra-final-link {
    margin-top: 5px;
}

.ha-compra-final-link.is-disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

body.ha-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .ha-compra-modal-content {
        margin: 8vh 12px 0;
        padding: 20px 14px;
    }

    .ha-compra-date-row {
        flex-direction: column;
    }
}

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

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

.ha-tabs-container {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
    padding-top: 15px !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;
    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;
}

.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;
}

.ha-tabcontent {
    display: none !important;
}

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

.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;
    padding: 10px !important;
    margin-top: 5px !important;
}

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

.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;
    vertical-align: middle !important;
    border: none !important;
}

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

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

.ha-bus-icon {
    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;
}

.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;
}

@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 (min-width: 769px) {
    .ha-tabs-container {
        flex-direction: row !important;
    }
}

@media only screen and (max-width: 768px) {
.container,
#ha-resultados-wrapper {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 2200px !important;
    margin: 0 auto 20px !important;
    gap: 30px !important;
    align-items: flex-start !important;
    padding: 0 20px !important;
}

/* REGLA ULTRA ESPECÍFICA PARA FORZAR EL ANCHO */
html body .wp-site .wp-site-blocks .container,
html body .wp-site .wp-site-blocks #ha-resultados-wrapper,
html body .container,
html body #ha-resultados-wrapper,
.horarios-autobus.container,
.ha-shortcode-scope .container,
.ha-shortcode-scope #ha-resultados-wrapper,
.ha-shortcode-scope.horarios-autobus.container {
    max-width: 2200px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 30px !important;
    align-items: flex-start !important;
    padding: 0 20px !important;
    margin: 0 auto 20px !important;
}

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

.dias-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.dia {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 800;
    font-size: 13px;
    color: white;
    font-family: 'Nunito', sans-serif;
}

.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;
    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;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #002856;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 40, 86, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-pdf:hover {
    background-color: #003d7a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 40, 86, 0.4);
}

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

.ha-tipo-viaje-container {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 5px;
}

.ha-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.ha-radio-label input[type="radio"] {
    display: none;
}

.ha-radio-label:hover {
    border-color: #8fc33a;
    color: #8fc33a;
    background-color: #f0f8e8;
}

.ha-radio-label.ha-radio-active {
    border-color: #8fc33a;
    background-color: #8fc33a;
    color: #fff;
}

@media (max-width: 480px) {
    .ha-tipo-viaje-container {
        flex-direction: column;
    }
    .ha-results-actions {
        gap: 12px;
    }
    .ha-results-actions .btn-back,
    .ha-results-actions .btn-pdf {
        width: 100%;
        justify-content: center;
    }
    .resultado-comprar{
        font-size: 12px;
    }
}
