/* ===== ESTILOS DEL HEADER (COMÚN PARA TODAS LAS PÁGINAS) ===== */

/* Header móvil */
header {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 1000;
    padding: 15px 0;
    border-top: 1px solid #000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

.nav-links a.active {
    text-decoration: underline;
}

/* Ocultar datos-links en móvil */
.datos-links {
    display: none;
}

.idiom-links {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ===== HEADER PARA DESKTOP ===== */
@media screen and (min-width: 769px) {
    /* Header desktop */
    header {
        position: static;
        padding: 25px 50px;
        border-top: none;
    }

    nav {
        padding: 0;
        max-width: none;
    }

    .nav-links {
        position: fixed;
        left: 25px;
        gap: 15px;
    }

    .nav-links a {
        font-weight: normal;
    }

    .datos-links {
        display: block;
        line-height: 25px;
        position: fixed;
        transform: translate(-50%, 0);
        left: 50%;
        top: 16.5px;
        text-align: center;
    }

    .datos-links p {
        /* margin-bottom: 2px; */
        line-height: 25px;
    }

    .idiom-links {
        position: fixed;
        right: 25px;
        display: flex;
        gap: 15px;
    }
}

/* ===== ESTILOS PARA MENÚ DE IDIOMAS (COMÚN) ===== */

/* En DESKTOP: mostrar solo items desktop, ocultar móvil */
@media screen and (min-width: 769px) {
    .idiom-links .desktop-item {
        display: block;
    }
    .idiom-links .desktop-item:hover {
        text-decoration: underline;
    }

    .idiom-links .mobile-item {
        display: none;
    }

    .idiom-links a.active {
        text-decoration: underline;
    }
}

/* En MÓVIL: mostrar solo item móvil, ocultar desktop */
@media screen and (max-width: 768px) {
    .idiom-links .desktop-item {
        display: none;
    }

    .idiom-links .mobile-item {
        display: block;
        position: relative;
    }

    /* Estilos para el toggle móvil */
    .lang-toggle {
        display: inline-block;
        padding: 5px 10px;
        cursor: pointer;
        font-weight: 500;
        position: relative;
        padding-right: 15px;
    }

    /* Flecha/indicador en el toggle */
    .lang-toggle::after {
        content: "▼";
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        transition: transform 0.3s ease;
    }

    /* Opciones móviles (ocultas por defecto) */
    .mobile-options {
        display: none;
        position: absolute;
        bottom: 100%;
        right: 0;
        background: white;
        padding: 15px;
        border-radius: 10px 10px 0 0;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
        min-width: 100px;
        z-index: 1000;
    }

    /* Cuando el menú está activo */
    .mobile-item.active .mobile-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-item.active .lang-toggle::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Estilos para cada opción */
    .mobile-option {
        display: block;
        padding: 5px 0;
        text-align: right;
        text-decoration: none;
        color: #000;
        white-space: nowrap;
    }

    .mobile-option:hover {
        opacity: 0.7;
    }

    /* Estilo para opciones vacías */
    .mobile-option:empty {
        display: none;
    }
}

/* Transición suave para el menú desplegable */
.idiom-links {
    transition: all 0.3s ease;
}

/* Prevenir scroll cuando el menú está abierto en móvil */
body.menu-id-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}