.jcm-header {
    width: 100%;
    position: relative;
    z-index: 100;
}

.jcm-header__inner {
    width: 100%;
    margin: 0 auto;

    display: flex;
    align-items: center;

    padding: 20px 30px;
}


/* =========================
   AREE LATERALI
   ========================= */

.jcm-header__nav--left {
    flex: 1 1 0;

    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.jcm-header__right {
    flex: 1 1 0;

    display: flex;
    justify-content: flex-start;
    align-items: center;

    gap: 30px;
}


/* =========================
   LOGO
   ========================= */

.jcm-header__logo {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-left: 35px;
    margin-right: 35px;

    text-decoration: none;
}

.jcm-header__logo img {
    display: block;
    width: 160px;
    height: auto;
}


/* =========================
   MENU
   ========================= */

.jcm-header__menu {
    display: flex;
    align-items: center;

    gap: 25px;

    list-style: none;

    margin: 0;
    padding: 0;
}

.jcm-header__menu li {
    position: relative;

    margin: 0;
    padding: 0;
}

.jcm-header__menu > li > a {
    display: block;

    position: relative;

    text-decoration: none;
    white-space: nowrap;

    transition: color 0.3s ease;
}


/* =========================
   MENU - UNDERLINE EFFECT
   ========================= */

/*
 * Stato iniziale:
 * la linea esiste ma è compressa orizzontalmente.
 *
 * Questo replica il comportamento UDesign:
 * transform-origin: right center
 * transform: scale(0, 1)
 */

.jcm-header__menu--underline > li > a::before {
    content: "";

    display: block;
    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;

    border-bottom-style: solid;
    border-bottom-width: 2px;
    border-bottom-color: currentColor;

    transform-origin: right center;
    transform: scale(0, 1);

    transition: transform 0.3s ease;

    pointer-events: none;
}


/*
 * Hover
 *
 * La linea compare da sinistra verso destra.
 */

.jcm-header__menu--underline > li:hover > a::before,
.jcm-header__menu--underline > li > a:hover::before,
.jcm-header__menu--underline > li > a:focus-visible::before {
    transform-origin: left center;
    transform: scale(1, 1);
}


/*
 * Voce corrente.
 *
 * WordPress applica automaticamente
 * .current-menu-item alla pagina attiva.
 */

.jcm-header__menu--underline > li.current-menu-item > a::before {
    transform-origin: left center;
    transform: scale(1, 1);
}


/*
 * Ancestor corrente.
 *
 * Se ci troviamo in una sottopagina,
 * mantiene attiva la voce principale.
 */

.jcm-header__menu--underline > li.current-menu-ancestor > a::before {
    transform-origin: left center;
    transform: scale(1, 1);
}


/*
 * Compatibilità con eventuali menu
 * che usano current-menu-parent.
 */

.jcm-header__menu--underline > li.current-menu-parent > a::before {
    transform-origin: left center;
    transform: scale(1, 1);
}


/* =========================
   SUBMENU
   ========================= */

.jcm-header__menu .sub-menu {
    position: absolute;

    top: 100%;
    left: 0;

    min-width: 220px;

    display: none;

    list-style: none;

    margin: 0;
    padding: 10px 0;

    background: #fff;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.10);

    z-index: 1000;
}

.jcm-header__menu .sub-menu li {
    width: 100%;
}

.jcm-header__menu .sub-menu a {
    display: block;

    padding: 8px 18px;

    text-decoration: none;

    white-space: nowrap;
}

.jcm-header__menu li:hover > .sub-menu,
.jcm-header__menu li:focus-within > .sub-menu {
    display: block;
}


/* =========================
   CTA
   ========================= */

.jcm-header__cta {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 22px;

    text-decoration: none;

    white-space: nowrap;
}

.jcm-header__cta {
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}


/* =========================
   MOBILE BUTTON
   ========================= */

.jcm-header__toggle {
    display: none;

    width: 42px;
    height: 42px;

    padding: 8px;

    border: 0;
    background: transparent;

    cursor: pointer;

    flex-direction: column;
    justify-content: center;

    gap: 5px;
	
	color: #0e2e5a !important;
}

.jcm-header__toggle:hover,
.jcm-header__toggle:focus,
.jcm-header__toggle:active {
    color: #0e2e5a !important;
}

.jcm-header__toggle span {
    display: block;

    width: 100%;
    height: 2px;

    background: currentColor;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* =========================
   MOBILE / TABLET MENU
   ========================= */

@media (max-width: 1092px) {

    /*
     * Valori principali del menu mobile.
     *
     * Modificando questo valore cambia sia:
     * - distanza tra le singole voci
     * - distanza tra menu sinistro e menu destro
     */
    .jcm-header {
        --jcm-mobile-menu-gap: 10px;
        --jcm-mobile-link-padding-y: 4px;
    }


    .jcm-header__inner {
        flex-wrap: wrap;

        padding: 15px 20px;
    }


    /* =========================
       LOGO
       ========================= */

    .jcm-header__logo {
        order: 1;

        margin: 0 auto 0 0;
    }


    /* =========================
       HAMBURGER
       ========================= */

    .jcm-header__toggle {
        display: flex;

        order: 2;
    }


    /* =========================
       MENU SINISTRO
       ========================= */

    .jcm-header__nav--left {
        display: none;

        flex: 0 0 100%;

        order: 3;

        justify-content: flex-start;

        /*
         * Distanza tra logo/header
         * e inizio del menu.
         */
        padding-top: 16px;
    }


    /* =========================
       AREA DESTRA
       ========================= */

    .jcm-header__right {
        display: none;

        flex: 0 0 100%;

        order: 4;

        flex-direction: column;
        align-items: stretch;

        /*
         * Questa è la distanza tra:
         * menu sinistro e menu destro.
         *
         * Utilizziamo la stessa variabile
         * usata tra i singoli list-item.
         */
        margin-top: var(--jcm-mobile-menu-gap);

        /*
         * Distanza tra menu destro e CTA.
         * Questa invece può essere indipendente.
         */
        gap: 16px;

        padding-bottom: 20px;
    }


    /* =========================
       MENU APERTO
       ========================= */

    .jcm-header.is-open .jcm-header__nav--left,
    .jcm-header.is-open .jcm-header__right {
        display: flex;
    }


    .jcm-header__nav--right {
        width: 100%;
    }


    /* =========================
       LISTA MENU
       ========================= */

    .jcm-header__menu {
        width: 100%;

        flex-direction: column;
        align-items: stretch;

        /*
         * Distanza uniforme tra le voci.
         */
        gap: var(--jcm-mobile-menu-gap);
    }


    .jcm-header__menu > li {
        margin: 0;
        padding: 0;
    }


    .jcm-header__menu > li > a {
        /*
         * Prima avevamo 10px 0.
         * Questo era uno dei motivi
         * per cui il menu risultava molto arioso.
         */
        padding:
            var(--jcm-mobile-link-padding-y)
            0;
    }


    /* =========================
       SUBMENU
       ========================= */

    .jcm-header__menu .sub-menu {
        position: static;

        display: block;

        box-shadow: none;

        padding: 0 0 0 15px;
    }


    /* =========================
       CTA
       ========================= */

    .jcm-header__cta {
        width: 100%;
    }


    /* =========================
       HAMBURGER -> X
       ========================= */

    .jcm-header.is-open
    .jcm-header__toggle span:nth-child(1) {
        transform:
            translateY(7px)
            rotate(45deg);
    }

    .jcm-header.is-open
    .jcm-header__toggle span:nth-child(2) {
        opacity: 0;
    }

    .jcm-header.is-open
    .jcm-header__toggle span:nth-child(3) {
        transform:
            translateY(-7px)
            rotate(-45deg);
    }
}

/* FIX CUSTOM x mobile */
@media (max-width: 767px) {
	div#jcm-header-9965d15-right {
	    margin-top: 5px;
	}
}

@media (min-width: 768px) and (max-width: 1091px) {
	div#jcm-header-9965d15-right {
	    margin-top: 25px;
	}
}