/**
 * Widget: header|v01 — icotea 2026
 *
 * Ogni regola e' discendente della classe root .header-v01 (isolamento widget).
 * Mobile first: il menu e' a scomparsa fino a 991px, orizzontale da 992px.
 */

.website-header.header-no-anim,
.website-header.header-no-anim * {
    transition: none !important;
}


.header-v01 {
    position: relative;
    z-index: 1000;
}

/* Sticky sul WRAPPER (non sull'header interno): così resta fisso per tutto
   lo scroll del body. Il wrapper è nel flusso della pagina. */
.header-v01.is-sticky {
    position: sticky;
    top: 0;
}

/* ==========================================================================
   Barra
   ========================================================================== */

.header-v01 .header-v01-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(3.5px);
    -webkit-backdrop-filter: blur(3.5px);
    transition: box-shadow .2s ease, background-color .2s ease;
}

.header-v01 .header-v01-bar.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
}

.header-v01 .header-v01-container {
    max-width: var(--icotea-container-max);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.header-v01 .header-v01-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: auto;
}

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

/* ==========================================================================
   Hamburger (fino a 991px)
   ========================================================================== */

.header-v01 .header-v01-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--icotea-brand-blue);
    cursor: pointer;
}

.header-v01 .hamburger-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
}

.header-v01 .hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.header-v01 .header-v01-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-v01 .header-v01-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.header-v01 .header-v01-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Navigazione
   ========================================================================== */

.header-v01 .header-v01-nav {
    order: 4;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--icotea-white);
    box-shadow: 0 12px 20px rgba(0, 43, 86, 0.12);
    transition: max-height .25s ease;
}

.header-v01 .header-v01-nav.is-open {
    max-height: calc(100vh - var(--icotea-header-height));
    overflow-y: auto;
}

.header-v01 .header-v01-menu {
    list-style: none;
    margin: 0;
    padding: 8px 20px 16px;
    display: flex;
    flex-direction: column;
}

.header-v01 .header-v01-menu li {
    position: relative;
}

.header-v01 .header-v01-menu a {
    display: block;
    padding: 10px 0;
    font-family: var(--icotea-font-heading);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    text-transform: capitalize;
    text-decoration: none;
    color: var(--icotea-second-title);
}

.header-v01 .header-v01-menu a:hover,
.header-v01 .header-v01-menu a:focus-visible {
    color: var(--icotea-brand-blue);
    text-decoration: underline;
}

.header-v01 .header-v01-menu .current-menu-item > a,
.header-v01 .header-v01-menu a[aria-current="page"] {
    color: var(--icotea-brand-blue);
}

/* Voce evidenziata: classe CSS "is-highlight" sulla voce di menu */
.header-v01 .header-v01-menu .is-highlight > a {
    display: inline-block;
    padding: 2px 10px;
    background: var(--icotea-accent);
    color: var(--icotea-second-title);
}

.header-v01 .header-v01-menu .is-highlight > a:hover,
.header-v01 .header-v01-menu .is-highlight > a:focus-visible {
    background: var(--icotea-accent-dark);
    color: var(--icotea-dark-blue);
}

/* Sottomenu */
.header-v01 .header-v01-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.header-v01 .header-v01-menu .sub-menu a {
    font-size: 15px;
    text-transform: none;
}

/* ==========================================================================
   Azioni: ricerca, e-learning, carrello
   ========================================================================== */

.header-v01 .header-v01-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-v01 .header-v01-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--icotea-brand-blue);
    color: var(--icotea-white);
    cursor: pointer;
    transition: background-color .2s ease;
}

.header-v01 .header-v01-search-toggle:hover,
.header-v01 .header-v01-search-toggle:focus-visible {
    background: var(--icotea-brand-blue-dark);
}

.header-v01 .header-v01-search-toggle svg {
    width: 18px;
    height: 18px;
}

.header-v01 .header-v01-elearning {
    display: none;
    font-family: var(--icotea-font-heading);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    text-transform: capitalize;
    text-decoration: none;
    color: var(--icotea-brand-blue);
    white-space: nowrap;
}

.header-v01 .header-v01-elearning:hover,
.header-v01 .header-v01-elearning:focus-visible {
    text-decoration: underline;
}

/* Nel menu mobile il link e-learning e' sempre visibile */
.header-v01 .header-v01-elearning--mobile {
    display: block;
    margin: 0 20px 20px;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--icotea-brand-blue);
    color: var(--icotea-white);
    text-align: center;
}

.header-v01 .header-v01-elearning--mobile:hover,
.header-v01 .header-v01-elearning--mobile:focus-visible {
    background: var(--icotea-brand-blue-dark);
    color: var(--icotea-white);
}

.header-v01 .header-v01-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--icotea-brand-blue);
    text-decoration: none;
}

.header-v01 .header-v01-cart svg {
    width: 24px;
    height: 24px;
}

.header-v01 .header-v01-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 9999px;
    background: var(--icotea-brand-blue);
    color: var(--icotea-white);
    font-family: var(--icotea-font-heading);
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

/* Account */
.header-v01 .header-v01-account {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    color: var(--icotea-brand-blue);
    text-decoration: none;
}
.header-v01 .header-v01-account-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}
.header-v01 .header-v01-account-ico svg {
    width: 24px;
    height: 24px;
}
/* Pallino verde = utente loggato */
.header-v01 .header-v01-account-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background: #00C950;
    border: 2px solid var(--icotea-white);
    box-sizing: content-box;
}
.header-v01 .header-v01-account-name {
    font-family: var(--icotea-font-heading);
    font-size: .875rem;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-v01 .header-v01-account:hover,
.header-v01 .header-v01-account:focus-visible {
    color: var(--icotea-brand-blue-dark);
}
@media (max-width: 991px) {
    .header-v01 .header-v01-account-name { display: none; }
}

/* ==========================================================================
   Pannello di ricerca
   ========================================================================== */

.header-v01 .header-v01-search-panel {
    border-top: 1px solid rgba(0, 43, 86, 0.10);
    background: var(--icotea-white);
}

.header-v01 .header-v01-search-form {
    max-width: var(--icotea-container-max);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    gap: 8px;
}

.header-v01 .header-v01-search-field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(0, 43, 86, 0.20);
    border-radius: 6px;
    font-family: var(--icotea-font-body);
    font-size: 16px;
    color: var(--icotea-dark-blue);
}

.header-v01 .header-v01-search-field:focus-visible {
    outline: 2px solid var(--icotea-brand-blue);
    outline-offset: 1px;
}

.header-v01 .header-v01-search-submit {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--icotea-brand-blue);
    color: var(--icotea-white);
    font-family: var(--icotea-font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

.header-v01 .header-v01-search-submit:hover,
.header-v01 .header-v01-search-submit:focus-visible {
    background: var(--icotea-brand-blue-dark);
}

.header-v01 .header-v01-actions .logELearning{
    color: var(--icotea-brand-blue);
    text-decoration: none;
}

.header-v01 .header-v01-actions .logELearning:hover{
    text-decoration: underline;
}


/* ==========================================================================
   Focus visibile (accessibilita')
   ========================================================================== */

.header-v01 a:focus-visible,
.header-v01 button:focus-visible {
    outline: 2px solid var(--icotea-brand-blue);
    outline-offset: 2px;
}


/* ==========================================================================
   Desktop
   ========================================================================== */


@media (min-width: 992px) {

    .header-v01 .header-v01-container {
        min-height: var(--icotea-header-height);
        padding: 0;
        gap: 24px;
    }

    .header-v01 .header-v01-logo {
        margin-right: 0;
    }

    .header-v01 .header-v01-logo img {
        height: 53px;
        margin-bottom: 18px;
    }

    .header-v01 .header-v01-toggle {
        display: none;
    }

    .header-v01 .header-v01-nav {
        order: 2;
        position: static;
        max-height: none;
        overflow: visible;
        flex: 1 1 auto;
        background: transparent;
        box-shadow: none;
    }

    .header-v01 .header-v01-menu {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 29px;
        padding: 0;
        margin-top: 8px;
    }

    .header-v01 .header-v01-menu a {
        padding: 0;
    }

    .header-v01 .header-v01-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10;
        min-width: 220px;
        padding: 8px 0;
        border-radius: 8px;
        background: var(--icotea-white);
        box-shadow: 0 8px 20px rgba(0, 43, 86, 0.15);
        opacity: 0;
        visibility: hidden;
        transition: opacity .15s ease;
    }

    .header-v01 .header-v01-menu li.menu-open > .sub-menu,
    .header-v01 .header-v01-menu li:hover > .sub-menu,
    .header-v01 .header-v01-menu li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
    }

    .header-v01 .header-v01-menu .sub-menu a {
        padding: 8px 16px;
    }

    .header-v01 .header-v01-actions {
        order: 3;
        gap: 18px;
    }


    .header-v01 .header-v01-elearning {
        display: inline-block;
    }

    .header-v01 .header-v01-elearning--mobile {
        display: none;
    }
}

/* Riduzione movimento */
@media (prefers-reduced-motion: reduce) {

    .header-v01 .header-v01-nav,
    .header-v01 .hamburger-line,
    .header-v01 .header-v01-menu .sub-menu {
        transition: none;
    }
}
