/* =========================================================================
   SELECTOR DE IDIOMA FLOTANTE (.pls)
   Botón fijo arriba a la derecha, sobre el hero oscuro: [🇪🇸 ES | 🇬🇧 EN]
   Todo cuelga de .pls para que ni Astra ni el CSS de las landings lo pisen.
   ========================================================================= */

.pls {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 999;
}

/* La barra de admin de WordPress es fija: sin esto el botón queda debajo. */
.admin-bar .pls { top: 52px; }
@media (max-width: 782px) {
    .admin-bar .pls { top: 66px; }
}

.pls *,
.pls *::before {
    box-sizing: border-box;
}

.pls__langs {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0 !important;
    padding: 4px !important;
    background: rgba(23, 23, 23, .55);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.pls .pls__lang {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pls .pls__lang > a {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

.pls .pls__lang img {
    width: 20px !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    opacity: .6;
    transition: opacity .2s ease;
}

.pls .pls__lang > a:hover,
.pls .pls__lang > a:focus-visible {
    color: #fff;
}

.pls .pls__lang > a:hover img {
    opacity: .9;
}

.pls .pls__lang > a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

/* Idioma activo: píldora blanca */
html[lang^="es"] .pls .ls-es > a,
html[lang^="en"] .pls .ls-en > a {
    background: #fff;
    color: #171717;
}

html[lang^="es"] .pls .ls-es img,
html[lang^="en"] .pls .ls-en img {
    opacity: 1;
}

/* El selector flotante de TranslatePress queda redundante con este. */
.trp-floating-switcher {
    display: none !important;
}

@media (max-width: 600px) {
    .pls { top: 12px; right: 12px; }
    .admin-bar .pls { top: 12px; } /* aquí la barra de admin deja de ser fija */
    .pls .pls__lang > a { height: 28px; padding: 0 10px; font-size: 12px; }
}
