/* -------------------------- New Navbar (Senza Bootstrap) -----------------*/

/* Reset base */
.custom-navbar-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.custom-navbar-container a {
    text-decoration: none;
}

/* Contenitore principale */
.custom-navbar-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%; /* Larghezza ridotta */
    max-width: 1000px;
    z-index: 1000;
    height: 84px; /* Altezza fissa per il contenitore */
}

.custom-navbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
}

/* Sfondo animato */
.navbar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6); /* Effetto glass più accentuato */
    backdrop-filter: blur(16px); /* Blur aumentato */
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(220, 220, 220, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    transition: height 0.2s ease-in-out; /* Modifica questo valore */
    z-index: -1;
}

/* Logo */
.navbar-logo img {
    height: 60px;
    width: auto;
    display: block;
}

/* Menu di navigazione (Desktop) */
.nav-menu {
    position: absolute;
    left: 65%;
    transform: translateX(-65%);
    width: 65%;
}
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5vw; /* Spazio ridotto per far stare tutto */
}
.nav-link {
    display: block;
    padding: 8px 12px; /* Padding ridotto */
    color: #333;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-link:hover, .nav-link.active {
    background-color: #265D87;
    color: #fff;
}

/* Pulsante CTA */
.nav-cta {
    margin-left: auto;
}
.btn-cta-new {
    display: block;
    background-color: #dbaf4e;
    color: #265D87;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
    transition: background-color 0.2s ease;
}
.btn-cta-new:hover {
    background-color: #1d4a6e;
}

/* Dropdown */
/* Rimosso .nav-item-dropdown { position: static; } perché non più necessario */

.dropdown-content {
    position: absolute;
    top: 100%;
    
    padding-top: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    transform: translateY(-10px);
    /* Rimosse le proprietà left, right e width in conflitto */
}

/* Rimuoviamo :hover e usiamo la classe .show gestita da JS */
.dropdown-content.show {
    display: grid; /* Cambiato da block a grid per coerenza */
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0); /* Aggiunto per animazione */
}

/* RIMOSSA la regola precedente da qui */
.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: #333;
    white-space: nowrap;
}
.dropdown-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

/* Stile per i box dei sottomenu con descrizione */
.dropdown-link-item {
    display: block;
    width: auto; /* Modificato da 22vw a auto */
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(245, 245, 247, 0.7); /* Sfondo più opaco */
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}
.dropdown-link-item:hover {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(220, 220, 220, 0.9);
}
.dropdown-link-item strong {
    color: #2B2D2F;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}
.dropdown-link-item span {
    color: #5A5A5A;
    font-size: 1.3vw;
    line-height: 1.2;
}
/* Stili per dropdown contatti */
.contact-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1vw;
}

.contact-dropdown-item i {
    font-size: 1.5rem;
    color: #dbaf4e;
    width: 25px;
    text-align: center;
}

.contact-dropdown-item span {
    font-size: 1em;
    line-height: 1.2;
}

.contact-dropdown-item span strong {
    font-size: 0.8em;
    text-transform: uppercase;
    color: #5a5a5a;
    margin-bottom: 0.1rem;
}

.contact-dropdown-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

.contact-dropdown-social a {
    font-size: 1.8rem;
    color: #5a5a5a;
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-dropdown-social a:hover {
    color: #265D87;
    transform: scale(1.1);
}

/* Mega Menu (usato per tutti i dropdown) */
/* Rimuoviamo la larghezza fissa, ora è gestita da .dropdown-content */
/*
.mega-menu {
    width: 800px; 
}
*/
.mega-menu-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 800px; /* Controlla la larghezza massima qui */
    margin: 0 auto; /* Centra la griglia nel contenitore */
}

/* Rimuoviamo la colonna interna non più necessaria */
/*
.mega-menu .mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
*/

/* Stile per il CTA mobile */
.mobile-cta {
    display: none; /* Nascosto di default */
}

/* Hamburger Menu (Mobile) */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

/* Stili per mobile */
@media (max-width: 1024px) { /* Nuovo breakpoint per gestire la larghezza */
    .custom-navbar-container {
        width: 90%;
    }
}
@media (max-width: 852px) {
    .nav-menu, .nav-cta {
        display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
    .custom-navbar-container {
        width: 100%;
        top: 0;
        border-radius: 0;
    }
    .navbar-logo {
        margin-left: 1rem;
    }
    .navbar-bg {
        border-radius: 0;
    }
    .custom-navbar {
        padding: 0 1vw;
    }
    body.mobile-menu-open .nav-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between; /* Spinge il CTA in fondo */
        position: fixed;
        top: 84px; /* Sotto la navbar */
        left: 65%; /* Modificato per occupare tutta la larghezza */
        width: 100%;
        height: calc(100vh - 84px);
        background-color: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(15px);
        padding: 2rem;
        text-align: center;
        overflow-y: auto; /* Permette lo scroll se il menu è lungo */
    }
    body.mobile-menu-open .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    body.mobile-menu-open .nav-link {
        font-size: 1.5rem;
        background-color: rgba(255, 255, 255, 0.6);
    }
    body.mobile-menu-open .nav-link:hover {
        background-color: #265D87;
    }

    /* Mostra il CTA mobile */
    .mobile-cta {
        display: block;
        margin-top: 2rem;
        padding-bottom: 1rem;
    }

    .mobile-cta .logo-cta img {
        height: 35vw; /* Dimensione adatta per il menu mobile */
        margin: 0 auto;
    }

    /* Modifiche per dropdown su mobile */
    .dropdown-content, .dropdown-content.show {
        display: none;
        position: relative; /* Cambiato da static */
        top: auto; /* Reset */
        left: auto; /* Reset */
        transform: none;
        opacity: 1;
        pointer-events: auto;
        width: 100%;
        margin: 2vw auto;
        border: 1px solid #ccc;
        border-radius: 4vw;
        background-color: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(20px);
    }
    .nav-item-dropdown.open > .dropdown-content {
        display: block;
    }
    .mega-menu-columns {
        grid-template-columns: 1fr; /* Colonne singole su mobile */
        gap: 0.5rem;
    }
    /* Rimuoviamo la colonna interna non più necessaria */
    /*
    .mega-menu .mega-menu-column {
        gap: 0.5rem;
    }
    */
    .dropdown-link-item {
        background-color: transparent;
        padding: 8px;
        border: none;
    }
    .dropdown-link-item:hover {
        background-color: rgba(0, 0, 0, 0.05);
        border: none;
    }

    .dropdown-link-item span {
    font-size: 3vw;
}
    .contact-dropdown-social {
        justify-content: flex-start;
        padding-left: 8px;
    }

    /* Animazione hamburger */
    body.mobile-menu-open .mobile-nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    body.mobile-menu-open .mobile-nav-toggle span:nth-child(2) {
        opacity: 0;
    }
    body.mobile-menu-open .mobile-nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* Nuovi stili per il logo nell'area CTA */
.logo-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.logo-cta img {
    height: 60px; /* Adatta l'altezza del logo */
    width: auto;
    transition: transform 0.3s ease;
}

.logo-cta:hover img {
    transform: scale(1.05);
}
.logo-cta:hover img {
    transform: scale(1.05);
}
