/* --- NAVBAR CORE --- */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(5, 5, 5, 0.95); /* Nero profondo quasi opaco */
    border-bottom: 1px solid #222;
    z-index: 1000;
    padding: 15px 0;
    width: 100%;
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 1001; /* Sopra a tutto */
    text-decoration: none;
}

/* --- HAMBURGER (Solo Mobile) --- */
.hamburger {
    display: none; /* Nascosto su desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 2000; /* Livello massimo: deve stare sopra al menu aperto */
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: #fff;
    margin: 6px 0;
    transition: 0.4s;
}

/* Animazione Hamburger -> X */
.hamburger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); background: var(--accent); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); background: var(--accent); }


/* --- DESKTOP MENU (Default) --- */
.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0; padding: 0;
}

.mobile-menu-header { display: none; } /* Nascosto su desktop */

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    text-decoration: none;
    position: relative;
    padding: 5px 0;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* Linea animata Desktop */
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: 0.3s; box-shadow: 0 0 8px var(--accent);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }


/* --- MOBILE MENU (SIDEBAR) --- */
@media (max-width: 768px) {
    
    .nav-container {
        /* Layout Mobile: Hamburger a Sx, Logo al Centro */
        justify-content: center; 
    }

    .hamburger {
        display: block;
        position: absolute;
        left: 0; /* Hamburger fisso a sinistra */
        top: 50%;
        transform: translateY(-50%);
    }

    .logo {
        font-size: 1.4rem; /* Logo un po' più piccolo */
    }

    /* IL MENU LATERALE */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%; /* Nascosto a sinistra */
        width: 80%; /* Occupa l'80% dello schermo */
        max-width: 300px;
        height: 100vh;
        background: #0a0a0a;
        border-right: 1px solid #222;
        
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0;
        padding-top: 0;
        
        transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1); /* Slide fluido */
        z-index: 1500;
        box-shadow: 10px 0 30px rgba(0,0,0,0.8);
    }

    /* Classe per aprire il menu */
    .nav-links.open {
        left: 0;
    }

    /* Header interno al menu (Logo ripetuto) */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 80px;
        border-bottom: 1px solid #222;
        margin-bottom: 20px;
        background: #050505;
    }
    
    .mobile-logo-text {
        font-family: 'Playfair Display', serif;
        color: var(--accent);
        font-size: 1.5rem;
        letter-spacing: 2px;
        font-weight: 700;
    }

    /* Link Mobile */
    .nav-links li { width: 100%; }

    .nav-links a {
        display: block;
        padding: 15px 30px;
        font-size: 1.1rem;
        border-bottom: 1px solid #111;
        width: 100%;
    }
    
    .nav-links a:hover, .nav-links a.active {
        background: #111;
        padding-left: 40px; /* Piccolo movimento a destra */
        color: var(--accent);
    }

    .nav-links a::after { display: none; } /* Niente sottolineatura su mobile */

    /* OVERLAY SCURO */
    .mobile-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.8);
        z-index: 1400; /* Sotto al menu, sopra al sito */
        opacity: 0; visibility: hidden;
        transition: 0.3s;
        backdrop-filter: blur(2px);
    }
    
    .mobile-overlay.active {
        opacity: 1; visibility: visible;
    }
}