@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .menu-cta {
        width: 100%;
        text-align: center;
    }

    .menu-cta .cta-btn {
        width: auto;
        min-width: 120px;
        max-width: 90vw;
        display: inline-block;
        font-size: 1rem;
        padding: 0.5rem 1.2rem;
        margin: 0.7rem auto 0.5rem auto;
        border-radius: 10px;
    }
}

@media (min-width: 900.1px) {
    .menu-cta {
        display: none !important;
    }

    .header-cta {
        display: flex !important;
        align-items: center;
    }
}

/* Disabilita hover/active/focus su hamburger e immagini (tutte le dimensioni) */
.header-hamburger:hover,
.header-hamburger:active,
.header-hamburger:focus,
.header-hamburger img:hover,
.header-hamburger img:active,
.header-hamburger img:focus {
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
    filter: none !important;
    opacity: 1 !important;
    cursor: default !important;
}

/* Hamburger menu base */

.header-hamburger {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: default !important;
    position: relative;
    z-index: 1002;
    margin-left: auto;
    padding: 0;
}

.header-hamburger img {
    width: 44px;
    height: 44px;
    position: absolute;
    top: 0;
    left: 0;
    transition: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default !important;
}

@media (max-width: 900px) {
    .header-nav {
        position: fixed;
        left: 0;
        top: 80px;
        width: 100vw;
        max-width: 100vw;
        height: 0;
        background: #fff;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
        transform: translateY(-100%);
        transition: transform 0.35s cubic-bezier(.4, 0, .2, 1), height 0.35s cubic-bezier(.4, 0, .2, 1);
        z-index: 1001;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding-left: 0;
        padding-right: 0;
        gap: 2rem;
        overflow-y: hidden;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .header-nav.open {
        transform: translateY(0);
        height: calc(100vh - 80px);
        padding-top: 1.5rem;
        overflow-y: auto;
    }

    .header-nav ul {
        flex-direction: column;
        gap: 0.6rem;
        width: 100%;
        align-items: center;
    }

    .header-nav a {
        text-align: center;
    }

    .header-nav li {
        width: 100%;
    }

    .header-nav a {
        font-size: 1.3rem;
        width: 100%;
        display: block;
        padding: 0.7rem 0;
    }

    .header-hamburger {
        display: block !important;
        margin-left: auto;
        grid-column: 3;
        justify-self: end;
    }

    .header-cta {
        display: none;
    }



    /* Nascondi il bottone menu-cta su desktop */
    .menu-cta {
        display: none !important;
    }

    .header-cta {
        display: none !important;
    }

    @media (max-width: 900px) {
        .menu-cta {
            display: block !important;
            width: 100%;
            margin-top: 2.5rem;
            text-align: left;
        }

        .menu-cta .cta-btn {
            width: 100%;
            display: block;
            text-align: center;
            font-size: 1.2rem;
            padding: 0.8rem 0;
        }
    }

    @media (min-width: 900.1px) {
        .header-cta {
            display: flex !important;
            justify-self: end;
            align-items: center;
        }
    }

    .header-nav {
        box-shadow: -2px 0 16px rgba(0, 0, 0, 0.08);
    }

    /* Gestione PNG hamburger/close */
    .header-hamburger #hamburger-open {
        display: block;
    }

    .header-hamburger #hamburger-close {
        display: none;
    }

    .header-hamburger.active #hamburger-open {
        display: none;
    }

    .header-hamburger.active #hamburger-close {
        display: block;
    }
}

@media (max-width: 600px) {
    .header-container {
        padding: 0.5rem 0.7rem;
    }
}

/* Hamburger menu JS */
@media (max-width: 900px) {
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open .header-nav.open {
        overflow-y: auto;
        touch-action: pan-y;
    }

    /* Rimuovi vecchie regole .close-x/.bar */
}

.header-logo img {
    height: 56px;
    width: auto;
    display: block;
    margin: 6px 0;
}

.header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0.5rem 2rem;
    background: white;
    position: relative;
    max-width: 100vw;
}

.header-logo {
    justify-self: start;
}

.header-logo img {
    height: 56px;
    width: auto;
    display: block;
}

.header-nav {
    justify-self: center;
}

.header-nav ul {
    .header-hamburger {
        justify-self: end;
        margin-left: auto;
    }

    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.header-nav a {
    color: #222;
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--primary-color, #1c475a);
}

.header-cta {
    justify-self: end;
    display: flex;
    align-items: center;
}

@media (max-width: 900px) {
    .header-cta {
        display: none !important;
    }

    .menu-cta {
        width: 100%;
        margin-top: 2.5rem;
        text-align: left;
    }

    .menu-cta .cta-btn {
        width: 100%;
        display: block;
        text-align: center;
        font-size: 1.2rem;
        padding: 0.8rem 0;
    }
}


.cta-btn {
    background: #e6f94f;
    color: #222;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 10px;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    box-shadow: none;
    border: none;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}

.cta-btn:hover {
    background: var(--accent-light-color, #f7fcb7);
    color: #111;
    cursor: pointer;
}

.header-nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.header-nav a {
    color: #222;
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--primary-color, #1c475a);
}

.header-cta {
    justify-self: end;
    display: flex;
    align-items: center;
}

.cta-btn {
    background: #e6f94f;
    color: #222;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 10px;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    box-shadow: none;
    border: none;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}

.cta-btn:hover {
    background: var(--accent-light-color, #f7fcb7);
    color: #111;
    cursor: pointer;
}
