/**
 * Theme additions (2026): header language switcher (ACF hreflangs).
 * Main style.css is left as your restored bundle.
 */

/* .container:not(.container--menu) has overflow:hidden in base — clips absolute dropdown */
.header .container.header__top {
    overflow: visible;
}

.header-lang {
    flex-shrink: 0;
    margin-left: 12px;
    margin-right: 4px;
    position: relative;
    z-index: 1100;
}

.header-lang__details {
    position: relative;
}

@media (max-width: 991px) {
    .header-lang {
        margin-left: 8px;
    }
}

.header-lang__single,
.header-lang__summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    user-select: none;
}

.header-lang__summary {
    cursor: pointer;
    list-style: none;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid hsla(0, 0%, 100%, 0.15);
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s, background 0.2s;
}

.header-lang__summary::-webkit-details-marker {
    display: none;
}

.header-lang__summary:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
}

.header-lang__details[open] .header-lang__summary {
    border-color: rgba(255, 255, 255, 0.35);
}

.header-lang__details[open] .header-lang__caret svg {
    transform: rotate(180deg);
}

.header-lang__caret {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.75);
    margin-left: 2px;
}

.header-lang__caret svg {
    display: block;
    transition: transform 0.2s ease;
}

.header-lang__code {
    letter-spacing: 0.04em;
}

.header-lang__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-lang__flag--emoji {
    font-size: 1.35em;
    line-height: 1;
}

.header-lang__flag--glyph img {
    display: block;
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.header-lang__list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1101;
    min-width: 168px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: linear-gradient(173deg, rgba(37, 46, 76, 0.98) 2%, rgba(25, 32, 51, 0.98));
    border: 1px solid hsla(0, 0%, 100%, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.header-lang__item {
    margin: 0;
}

.header-lang__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header-lang__link:hover,
.header-lang__link:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #f9b242;
    outline: none;
}

.header-lang__link.is-current {
    color: #f9b242;
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 991px) {
    .btnTop {
        display: none !important;
    }
}
/* ---------------------------------------------------------------------
 * ULTRA 2026 — ajustes mínimos para que el marcado mejorado se vea
 * exactamente igual que antes.
 * ------------------------------------------------------------------ */

/* El índice ahora usa <a> reales (rastreables) en lugar de <span>. */
.toc_list a,
.toc_list a:hover,
.toc_list a:focus {
    color: inherit;
    text-decoration: none;
}

.toc_list li:hover a {
    color: #00cfa6;
}

/* La primera fila de las tablas pasa a <th scope="col">: se mantiene
   la alineación a la izquierda que tenían las celdas <td>. */
.content-text table th {
    text-align: left;
    font-weight: inherit;
}

/* =====================================================================
 * 2026 — cabecera móvil, carrusel sin librería y utilidades
 * ================================================================== */

/* El relleno derecho de Lucky Drive deja sitio a la imagen del coche.
   Estaba escrito en línea dentro del HTML; ahora vive en la hoja de
   estilos para poder ajustarlo por tamaño de pantalla. */
.header__grey-button--ld {
    padding-right: 100px;
}

@media (max-width: 991px) {
    /* Dos botones en una sola fila: «Dinero gratis» y «Bonos».
       Lucky Drive se retira en móvil por falta de espacio horizontal. */
    .header__grey-button--ld {
        display: none !important;
    }

    .header__top {
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 8px;
    }

    .header__top-item,
    .header__top-item:last-of-type {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 10px;
        min-width: 0;
    }

    .header__yellow-button {
        padding-left: 46px;
        padding-right: 24px;
        font-size: 13px;
        white-space: nowrap;
    }

    .header__yellow-button svg {
        right: 9px;
    }

    .header__grey-button {
        padding-left: 34px;
        padding-right: 34px;
        margin-right: 0;
        font-size: 12px;
        white-space: nowrap;
    }

    .button-img {
        height: 36px;
        bottom: -6px;
    }

    .button-img--left {
        left: -4px;
    }
}

@media (max-width: 360px) {
    .header__yellow-button {
        padding-left: 40px;
        padding-right: 18px;
        font-size: 12px;
    }

    .header__grey-button {
        padding-left: 30px;
        padding-right: 26px;
    }

    .button-img {
        height: 32px;
        bottom: -5px;
    }
}

/* ---------------------------------------------------------------------
 * Carrusel nativo: desplazamiento con anclaje, sin Swiper.
 * Conserva las clases originales para no tocar el resto de estilos.
 * ------------------------------------------------------------------ */

.slider--native {
    overflow: hidden;
}

.slider--native .swiper-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slider--native .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.slider--native .swiper-slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (prefers-reduced-motion: reduce) {
    .slider--native .swiper-wrapper {
        scroll-behavior: auto;
    }
}

/* ---------------------------------------------------------------------
 * Botón «arriba»: ahora se muestra con clase, no con fadeIn de jQuery.
 * ------------------------------------------------------------------ */

.btnTop {
    border: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.btnTop.is-on {
    opacity: 1;
    visibility: visible;
}

/* ---------------------------------------------------------------------
 * Botones de Shortcodes Ultimate: las pocas reglas que el tema usa, para
 * no cargar los 45 KB de la hoja del plugin. Los colores siguen viniendo
 * de los atributos style en línea que genera el shortcode.
 * ------------------------------------------------------------------ */

.su-button {
    display: inline-block !important;
    text-align: center;
    text-decoration: none !important;
    box-sizing: content-box !important;
    transition: opacity .2s;
}

.su-button span {
    display: block !important;
    text-decoration: none !important;
    box-sizing: content-box !important;
    padding-top: .25em !important;
    padding-bottom: .25em !important;
    line-height: 1.2 !important;
}

.su-button img {
    border: 0 !important;
    vertical-align: middle !important;
    margin: -.2em .4em 0 -.3em !important;
    box-shadow: none !important;
}

.su-button-style-default {
    border-width: 1px;
    border-style: solid;
}

.su-button-style-default span {
    border-top-width: 1px;
    border-bottom-width: 1px;
    border-top-style: solid;
    border-bottom-style: solid;
}

.su-button-style-default:hover {
    opacity: .7;
}

.su-button-wide {
    display: block !important;
    margin: 1em 0;
}

.su-button-center {
    text-align: center;
}

/* Nota: no se aplica content-visibility al pie. `contain: paint`, que esa
   propiedad implica, convierte al elemento en bloque contenedor de sus
   descendientes con position: fixed, y la barra flotante del bono (.cta)
   vive dentro del pie: dejaría de quedarse pegada abajo. */

/* ---------------------------------------------------------------------
 * Enlace «saltar al contenido»: estaba visible en todas las páginas
 * porque la clase .screen-reader-text no tenía estilos. Ahora se oculta
 * y solo aparece al recibir el foco con el teclado.
 * ------------------------------------------------------------------ */

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus,
.screen-reader-text:focus-visible {
    position: fixed !important;
    top: 10px;
    left: 10px;
    z-index: 10000;
    width: auto;
    height: auto;
    padding: 12px 20px;
    margin: 0;
    clip: auto;
    clip-path: none;
    background: #171f33;
    color: #fff;
    border: 2px solid #f9b242;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

/* Foco visible y coherente en todo el sitio (criterio WCAG 2.4.11). */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #f9b242;
    outline-offset: 2px;
    border-radius: 4px;
}

/* =====================================================================
 * Primera pantalla en móvil: menos aire y carrusel sin recortes
 * ================================================================== */

@media (max-width: 991px) {
    /* El hueco entre la fila de botones y el carrusel era de 50 px
       (20 px de relleno de la cabecera + 30 px de margen). Baja a 18 px. */
    .header {
        padding-top: 12px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .slider {
        margin-bottom: 16px;
    }

    /* Las imágenes del carrusel son de 1820 × 728 (relación 2,5:1). Con una
       altura fija de 260 px el navegador recortaba casi la mitad del ancho.
       Fijando la proporción real se ve la imagen completa, sin recorte y sin
       bandas negras, y el bloque de texto pasa a apoyarse sobre un degradado
       en la parte inferior. */
    .slider__wrapper.is-mobile {
        height: auto;
        aspect-ratio: 1820 / 728;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        overflow: hidden;
    }

    .slider__wrapper.is-mobile::after {
        content: "";
        position: absolute;
        inset: auto 0 0 0;
        height: 70%;
        border-radius: 0 0 8px 8px;
        background: linear-gradient(180deg, rgba(9, 15, 30, 0) 0%, rgba(9, 15, 30, .82) 72%);
        pointer-events: none;
    }

    .slider__wrapper.is-mobile .slider__info {
        position: relative;
        z-index: 2;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        max-width: 100%;
        padding: 0 14px 12px;
        gap: 8px;
        justify-content: flex-end;
    }

    .slider__wrapper.is-mobile .slider__title {
        font-size: 16px;
        line-height: 19px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
    }

    .slider__wrapper.is-mobile .slider__info .button {
        align-self: flex-start;
        width: auto;
        min-height: 34px;
        padding: 0 22px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .slider__wrapper.is-mobile .slider__title {
        font-size: 15px;
        line-height: 18px;
    }

    .slider__wrapper.is-mobile .slider__info {
        padding: 0 12px 10px;
    }

    .slider__wrapper.is-mobile .slider__info .button {
        min-height: 32px;
        padding: 0 18px;
        font-size: 13px;
    }
}

/* =====================================================================
 * Migas de navegación y barra flotante de bono
 * ================================================================== */

/* La barra «/» se dibuja aquí, no como texto suelto en el HTML. El hueco
   de flex (15 px) queda a su izquierda y el margen (15 px) a su derecha:
   la misma separación a ambos lados. */
.breadcrumb {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
    list-style: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin-right: 15px;
    color: rgba(255, 255, 255, .45);
    font-weight: 400;
}

.breadcrumb-item.active {
    color: #fff;
}

/* ---------------------------------------------------------------------
 * Barra flotante del bono: más compacta en móvil, sin recortar textos.
 * ------------------------------------------------------------------ */

@media (max-width: 991px) {
    .cta {
        gap: 10px;
        padding: 8px 14px;
        border-radius: 12px 12px 0 0;
    }

    .cta::before {
        left: 16px;
        right: 16px;
        height: 3px;
    }

    .cta__image {
        width: 38px;
        height: 38px;
        flex: none;
    }

    .cta__title {
        font-size: 13px;
        line-height: 16px;
        letter-spacing: 0;
        font-weight: 800;
    }

    .cta__button {
        flex: none;
        min-height: 32px;
        padding: 0 14px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .cta {
        gap: 8px;
        padding: 7px 10px;
    }

    .cta__image {
        width: 32px;
        height: 32px;
    }

    .cta__title {
        font-size: 12px;
        line-height: 15px;
    }

    .cta__button {
        min-height: 30px;
        padding: 0 11px;
        font-size: 12px;
    }
}

/* ---------------------------------------------------------------------
 * Imágenes que el tema dimensiona solo por altura.
 *
 * Si el HTML llega con un atributo width (por ejemplo desde una página aún
 * cacheada), ese atributo fijaría el ancho y la imagen se deformaría: el
 * icono de «Dinero gratis» pasaba de 40x32 a 120x32. Con width:auto el
 * ancho vuelve a calcularse desde la proporción real.
 * ------------------------------------------------------------------ */

.button-img {
    width: auto;
}
