/* Caricamento Font */
@font-face {
    font-family: 'SEGO';
    src: url('/asset/fonts/sego/SEGO.ttf') format('truetype'),
         url('/asset/fonts/sego/SEGO.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* HEADER BASE */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: transparent;
    z-index: 2000;
    transition: transform 0.4s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
}

header.scrolled {
    height: 100px;
    background-color: rgba(31, 17, 68, 0.98);
}

header.hidden {
    transform: translateY(-110%);
}

.header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribuisce Logo, Nav, Burger */
}

/* 1. LOGO (Sinistra) */
.logo {
    flex: 1; 
    display: flex;
    justify-content: flex-start;
    z-index: 2002; /* Sopra tutto */
}

.logo img { 
    height: 60px; 
    transition: 0.3s; 
}

/* 2. NAV WRAPPER (Centro Reale) */
.nav-wrapper {
    /* Rimuoviamo il flex: 2 per desktop */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-list a {
    font-family: 'SEGO', sans-serif;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

/* 3. BURGER (Destra) */
.burger {
    flex: 1; 
    display: flex; 
    justify-content: flex-end;
    visibility: hidden; /* Mantiene lo spazio a destra su desktop per sicurezza */
}

.burger span {
    display: block;
    width: 30px;
    height: 3px;
    background: white;
    margin: 6px 0;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* MOBILE LAYOUT */
@media (max-width: 900px) {
    .nav-wrapper {
        position: fixed; /* Torna fixed come prima */
        left: 0;
        transform: translateX(100%); /* Ripristina l'effetto slide */
        inset: 0;
        width: 100%;
        height: 100vh;
        background: #1f1144;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2000;
    }

    .nav-wrapper.active {
        transform: translateX(0); /* Entrata del menu mobile */
    }

    .burger {
        visibility: visible;
        display: flex;
    }

    /* EFFETTO ENTRATA A SCORRIMENTO */
    .nav-list li {
        list-style: none;
        transform: translateX(50px); /* Parte spostato a destra */
        opacity: 0;
        transition: 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    }

    /* Quando il menu è attivo, gli elementi scorrono dentro */
    .nav-wrapper.active .nav-list li {
        transform: translateX(0);
        opacity: 1;
    }

    .nav-list a {
        font-size: 1.8rem;
        text-transform: uppercase; /* Opzionale, per stile */
    }

    /* Ritardo progressivo per ogni link (Effetto Cascata) */
    .nav-list li:nth-child(1) { transition-delay: 0.1s; }
    .nav-list li:nth-child(2) { transition-delay: 0.2s; }
    .nav-list li:nth-child(3) { transition-delay: 0.3s; }
    .nav-list li:nth-child(4) { transition-delay: 0.4s; }
    .nav-list li:nth-child(5) { transition-delay: 0.5s; }

    /* Quando il burger è attivo */
    .burger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .burger.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .burger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }


    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
}