/* Language Switcher Styles - Respiracción */

.lang-switcher-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
}

/* Botón principal usa boton-perfecto-2 del theme */
.lang-switcher-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    min-width: auto !important;
    width: auto !important;
    position: relative !important;
    cursor: pointer !important;
}

.lang-switcher-toggle .lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-switcher-toggle .lang-name {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-switcher-toggle .lang-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: 4px;
}

.lang-switcher-toggle[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.lang-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 8px 0;
    min-width: 150px;
    margin: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-switcher-container.open .lang-switcher-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Opciones de idioma */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--color-texto-principal-oscuro, #333);
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 14px;
}

.lang-option:hover {
    background: var(--color-celeste-claro-bloques, rgba(121, 175, 210, 0.1));
    color: var(--color-azul-corporativo-medio, #295a99);
}

.lang-option .lang-flag {
    font-size: 18px;
}

.lang-option .lang-name {
    font-weight: 600;
}

/* Hide for logged-in users if enabled */
body.logged-in .lang-switcher-hide-logged-in {
    display: none !important;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .lang-switcher-container {
        top: 80px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .lang-switcher-container {
        top: auto;
        bottom: 80px;
        /* Moved higher to avoid footer/nav overlap */
        right: 15px;
        z-index: 99999;
        /* Ensure it's above other mobile elements */
    }

    .lang-switcher-toggle {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 40px;
        /* Minimum touch target */
        min-width: 40px;
        justify-content: center;
    }

    /* Ocultar nombre en móvil, solo mostrar bandera */
    .lang-switcher-toggle .lang-name {
        display: none;
    }

    .lang-switcher-toggle .lang-flag {
        font-size: 18px;
    }

    .lang-switcher-toggle .lang-arrow {
        display: none;
        /* Hide arrow on mobile for cleaner look */
    }

    .lang-switcher-dropdown {
        right: 0;
        bottom: calc(100% + 8px);
        /* Open upward on mobile */
        top: auto;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .lang-switcher-container {
        bottom: 70px;
        right: 10px;
    }

    .lang-switcher-toggle {
        padding: 6px 10px !important;
        min-height: 36px;
        min-width: 36px;
    }

    .lang-switcher-toggle .lang-flag {
        font-size: 16px;
    }
}

/* Accesibilidad */
.lang-switcher-toggle:focus {
    outline: 2px solid var(--color-acento-vibrante-dinamismo, #25c2f2);
    outline-offset: 2px;
}

.lang-option:focus {
    outline: 2px solid var(--color-acento-vibrante-dinamismo, #25c2f2);
    outline-offset: -2px;
}

/* Animación de entrada */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-switcher-container.open .lang-switcher-dropdown {
    animation: slideDown 0.2s ease forwards;
}