/* ========================================= */
/* NAVEGADOR PRINCIPAL (ESCRITORIO)          */
/* ========================================= */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(249, 249, 249, 0.85); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999; 
    padding: 1.2rem 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1300px; 
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Ocultamos los elementos de celular en la PC */
.hamburger-btn, .nav-overlay {
    display: none; 
}

/* El sidebar funciona como una fila normal en PC */
.nav-sidebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #111111;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem; 
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #111111;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover { color: #666666; }

.nav-contact-btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    background-color: #111111; 
    padding: 10px 24px;
    border-radius: 50px; 
    text-decoration: none;
    transition: background-color 0.3s;
}
.nav-contact-btn:hover { background-color: #444444; }

/* ========================================= */
/* NAVEGADOR EN MÓVILES (Celulares)          */
/* ========================================= */
@media (max-width: 991px) {

    .main-nav {
        position: fixed;
        top: 0 !important;
        height: 65px !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        z-index: 9999;
    }

    .nav-container {
        width: 100%;
        height: 100%; 
        display: flex;
        justify-content: flex-end; 
        align-items: center; 
        padding: 0 1.5rem;
    }

    /* 1. Botón Hamburguesa */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 3000; /* Por encima de todo */
    }

    .hamburger-btn span {
        width: 100%;
        height: 3px;
        background-color: #111;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    /* 2. Capa Oscura (Fondo opaco bloqueado) */
    .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 2100; /* Debajo del sidebar, encima del contenido */
    }

    /* 3. El Menú Deslizante (Sidebar de 50%) */
    .nav-sidebar {
        position: fixed;
        top: 0;
        left: -100%; /* Oculto fuera de la pantalla a la izquierda */
        width: 55%; /* 55% para que los textos respiren un poco mejor que al 50% exacto */
        min-width: 250px;
        height: 100dvh;
        background-color: #fcfcfc;
        flex-direction: column; /* Organizado en columna */
        justify-content: flex-start;
        align-items: flex-start;
        padding: 5rem 2rem 2rem 2rem;
        transition: left 0.4s ease;
        z-index: 2500; /* Encima del overlay */
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }

    .nav-links {
        flex-direction: column; /* Enlaces hacia abajo */
        gap: 1.5rem;
        margin-top: 2rem;
        width: 100%;
    }

    .nav-logo {
        font-size: 1.4rem;
        border-bottom: 2px solid #eee;
        padding-bottom: 1rem;
        width: 100%;
    }

    .nav-contact-btn {
        margin-top: auto; /* Empuja el botón hasta el fondo de la pantalla */
        width: 100%;
        text-align: center;
        padding: 12px 0;
    }

    /* ========================================= */
    /* CLASES ACTIVAS (Agregadas por JS)         */
    /* ========================================= */
    
    /* Muestra el fondo oscuro */
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Desliza el menú hacia adentro */
    .nav-sidebar.active {
        left: 0;
    }

    /* Anima la hamburguesa para que se convierta en una "X" */
    .hamburger-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger-btn.active span:nth-child(2) { opacity: 0; }
    .hamburger-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}
