/*
 * XenonFactory GTranslate Addon
 * Selector de idioma específico para Molinos del Duero.
 *
 * Escritorio (>= 1025 px):
 * - Trigger compacto ES / EN / PT.
 * - Dropdown flotante.
 *
 * Tablet / móvil (<= 1024 px):
 * - Trigger con nombre completo del idioma activo.
 * - Submenú integrado en el flujo de la navegación móvil / popup.
 * - El idioma activo no se repite dentro de la lista.
 */

/* ==========================================================
   1. VARIABLES Y CONTENEDOR
   ========================================================== */

.xf-gta-switcher {
    --xf-gta-blue: #0e334f;
    --xf-gta-amber: #efbb2d;
    --xf-gta-white: #ffffff;

    position: relative;
    display: inline-flex;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;

    width: 52px;
    min-width: 52px;
    max-width: 52px;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
    vertical-align: middle;

    font-family: "Plus Jakarta Sans", Arial, sans-serif;
}

/* ==========================================================
   2. TRIGGER
   ========================================================== */

.xf-gta-toggle,
.xf-gta-toggle:hover,
.xf-gta-toggle:active,
.xf-gta-toggle:focus,
.xf-gta-toggle:focus-visible,
.xf-gta-switcher.is-open .xf-gta-toggle {
    position: relative !important;

    display: grid !important;
    grid-template-columns: 22px 9px !important;
    column-gap: 5px !important;

    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 52px !important;

    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;

    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box !important;

    border: 0 !important;
    border-radius: 0 !important;

    outline: 0;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    box-shadow: none !important;

    color: var(--xf-gta-white) !important;

    font-family: "Plus Jakarta Sans", Arial, sans-serif !important;
    font-size: 15px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    letter-spacing: 0 !important;

    text-align: center !important;
    text-decoration: none !important;
    text-indent: 0 !important;
    text-transform: none !important;

    white-space: nowrap !important;

    transform: none !important;

    cursor: pointer !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    transition: none !important;
}

.xf-gta-toggle:focus-visible {
    outline: 2px solid var(--xf-gta-amber) !important;
    outline-offset: 3px !important;
    border-radius: 2px !important;
}

/* ==========================================================
   3. ETIQUETAS DEL IDIOMA ACTIVO
   ========================================================== */

.xf-gta-code {
    display: block !important;

    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;

    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;

    font: inherit !important;
    line-height: 1 !important;

    letter-spacing: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.xf-gta-name {
    display: none !important;
}

/* ==========================================================
   4. CHEVRON
   ========================================================== */

.xf-gta-chevron {
    display: block !important;

    flex: 0 0 9px !important;

    width: 9px !important;
    min-width: 9px !important;
    max-width: 9px !important;
    height: 6px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;

    color: inherit !important;

    transform: rotate(0deg);
    transform-origin: 50% 50%;

    transition: transform 160ms ease !important;
}

.xf-gta-switcher.is-open .xf-gta-chevron {
    transform: rotate(180deg) !important;
}

/* ==========================================================
   5. PANEL · ESCRITORIO
   ========================================================== */

.xf-gta-panel {
    position: absolute;
    z-index: 9999;

    top: calc(100% + 8px);
    right: 0;

    min-width: 158px;

    margin: 0;
    padding: 5px;

    box-sizing: border-box;

    border: 1px solid rgba(14, 51, 79, 0.14);
    border-radius: 4px;

    background: var(--xf-gta-white);

    box-shadow:
        0 10px 30px rgba(14, 51, 79, 0.16),
        0 2px 6px rgba(14, 51, 79, 0.08);
}

.xf-gta-panel[hidden] {
    display: none !important;
}

.xf-gta-panel::before {
    content: "";

    position: absolute;

    top: -5px;
    right: 17px;

    width: 9px;
    height: 9px;

    box-sizing: border-box;

    border-top: 1px solid rgba(14, 51, 79, 0.14);
    border-left: 1px solid rgba(14, 51, 79, 0.14);

    background: var(--xf-gta-white);

    transform: rotate(45deg);
}

/* ==========================================================
   6. LISTA
   ========================================================== */

.xf-gta-list {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;

    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
}

.xf-gta-list li {
    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
}

/* ==========================================================
   7. ENLACES · ESCRITORIO
   ========================================================== */

.xf-gta-list a.glink,
.xf-gta-list a.glink:hover,
.xf-gta-list a.glink:active,
.xf-gta-list a.glink:focus {
    display: flex !important;
    align-items: center !important;

    width: 100% !important;
    min-height: 40px !important;

    margin: 0 !important;
    padding: 9px 12px !important;

    box-sizing: border-box !important;

    border: 0 !important;
    border-radius: 2px !important;

    box-shadow: none !important;

    color: var(--xf-gta-blue) !important;

    font-family: "Plus Jakarta Sans", Arial, sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;

    letter-spacing: 0 !important;

    text-align: left !important;
    text-decoration: none !important;
    text-transform: none !important;

    transform: none !important;

    cursor: pointer !important;
}

.xf-gta-list a.glink {
    background: transparent !important;

    transition:
        background-color 120ms ease,
        color 120ms ease !important;
}

.xf-gta-list a.glink:hover,
.xf-gta-list a.glink:focus-visible {
    background: var(--xf-gta-amber) !important;
    color: var(--xf-gta-blue) !important;
}

.xf-gta-list a.glink:focus {
    outline: none !important;
}

.xf-gta-list a.glink:focus-visible {
    outline: 2px solid var(--xf-gta-amber) !important;
    outline-offset: -2px !important;
}

.xf-gta-list a.glink[aria-current="true"],
.xf-gta-list a.glink[aria-current="true"]:hover,
.xf-gta-list a.glink[aria-current="true"]:focus-visible {
    background: var(--xf-gta-blue) !important;
    color: var(--xf-gta-white) !important;
    font-weight: 600 !important;
}

.xf-gta-list a.glink img {
    display: none !important;
}

/* ==========================================================
   8. TABLET Y MÓVIL · SUBMENÚ INTEGRADO
   ========================================================== */

@media (max-width: 1024px) {

    .xf-gta-switcher {
        display: block;
        flex: 1 1 100%;

        width: 100%;
        min-width: 0;
        max-width: none;

        margin: 0;
        padding: 0;
    }

    /*
     * En móvil desaparece la abreviatura y se muestra el nombre completo del
     * idioma activo. El trigger puede crecer de acuerdo con su contenido.
     */
    .xf-gta-toggle,
    .xf-gta-toggle:hover,
    .xf-gta-toggle:active,
    .xf-gta-toggle:focus,
    .xf-gta-toggle:focus-visible,
    .xf-gta-switcher.is-open .xf-gta-toggle {
        display: inline-grid !important;
        grid-template-columns: auto 9px !important;
        column-gap: 6px !important;

        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;

        padding: 0 8px !important;
    }

    .xf-gta-code {
        display: none !important;
    }

    .xf-gta-name {
        display: block !important;

        margin: 0 !important;
        padding: 0 !important;

        color: inherit !important;

        font: inherit !important;
        line-height: 1 !important;

        white-space: nowrap !important;
    }

    /* El panel pasa a formar parte del flujo de la navegación móvil / popup. */
    .xf-gta-panel {
        position: static;

        width: 100%;
        min-width: 0;
        max-width: none;

        margin: 4px 0 0;
        padding: 4px 0 2px 14px;

        border: 0;
        border-radius: 0;

        background: transparent;

        box-shadow: none;
    }

    .xf-gta-panel::before {
        display: none;
    }

    .xf-gta-list,
    .xf-gta-list li {
        width: 100%;
    }

    .xf-gta-list a.glink,
    .xf-gta-list a.glink:hover,
    .xf-gta-list a.glink:active,
    .xf-gta-list a.glink:focus {
        position: relative;

        display: flex !important;
        align-items: center !important;

        width: 100% !important;
        min-height: 44px !important;

        margin: 0 !important;
        padding: 10px 8px !important;

        border: 0 !important;
        border-radius: 0 !important;

        background: transparent !important;

        box-shadow: none !important;

        color: var(--xf-gta-white) !important;

        font-size: 15px !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;

        text-decoration: none !important;
    }

    .xf-gta-list a.glink:hover {
        background: transparent !important;
        color: var(--xf-gta-amber) !important;
    }

    .xf-gta-list a.glink:focus-visible {
        background: transparent !important;
        color: var(--xf-gta-amber) !important;

        outline: 1px solid var(--xf-gta-amber) !important;
        outline-offset: -1px !important;
    }

    /*
     * El trigger ya identifica el idioma actual con su nombre completo, por lo
     * que repetirlo dentro de la lista añade redundancia y se oculta en móvil.
     */
    .xf-gta-list a.glink[aria-current="true"] {
        display: none !important;
    }
}
