/*
 * Header Job Camere: stessa struttura del tema, rifinita.
 * Menu più leggero, voce LAVORO in evidenza, pulsanti allineati e coerenti con il resto del sito.
 */

/* ---------- Riga desktop ---------- */
.header .header-main.hide-on-mobile .header--row-inner {
    border-bottom: 1px solid #e8e8e8;
}

.header .header-main.hide-on-mobile .builder-item--logo img.neve-site-logo {
    max-height: 64px;
    width: auto;
}

/* Menu sempre su una riga: il contenitore del menu occupa lo spazio libero. */
.header .header-main.hide-on-mobile .builder-item.has-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.header .menu-desktop {
    flex-wrap: nowrap;
    align-items: center;
}

.header .menu-desktop > li {
    flex: 0 0 auto;
    margin-left: 8px !important;
    margin-right: 8px !important;
}

/* Contenitore rimasto vuoto dopo lo spostamento di «Lavora con noi» nel menu. */
.header .hfg-is-group > .item--inner:not(:has(a)) {
    display: none;
}

/* Azzera il padding verticale aggiunto dal tema ai link desktop. */
.header .primary-menu-ul.nav-ul.menu-desktop > li > .wrap > a {
    padding-block: 0;
}

/* Voci del menu principale */
.header .menu-desktop > li > .wrap > a,
.header .menu-desktop > li > a {
    position: relative;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 20px;
    white-space: nowrap;
    color: #303030;
    transition: color .15s ease;
}

/* Nessuna sottolineatura: né quella del tema (.wrap::after) né altre. Solo il colore rosso. */
.header .nav-ul li > .wrap::after,
.header .nav-ul li > .wrap::before,
.header .nav-ul li > .wrap > a::after,
.header .nav-ul li > a::after {
    display: none !important;
}

.header .menu-desktop > li > .wrap > a:hover,
.header .menu-desktop > li > a:hover,
.header .menu-desktop > li.current-menu-item > .wrap > a,
.header .menu-desktop > li.current-menu-item > a {
    color: #dd0731;
}

.header .menu-desktop > li.current-menu-ancestor > .wrap > a,
.header .menu-desktop > li.current-menu-parent > .wrap > a {
    color: #dd0731;
}

/* Sottomenu */
.header .menu-desktop .sub-menu {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(48, 48, 48, .12);
    padding: 8px 0;
    overflow: hidden;
}

.header .menu-desktop .sub-menu a {
    font-size: 14px;
    font-weight: 500;
    color: #303030;
}

.header .menu-desktop .sub-menu a:hover {
    color: #dd0731;
}

/* ---------- Voci LAVORO e FILIALI in evidenza (desktop e menu mobile) ---------- */
.header .nav-ul a[href*="ricerca-annunci"],
.header .nav-ul .jc-menu-branches > .wrap > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    /* Il tema imposta padding-top: 1px sui link del menu: senza priorità il testo non resta centrato. */
    padding: 6px 15px 6px 13px !important;
    line-height: 20px;
    border-radius: 999px;
    background: #fdecef;
    color: #dd0731 !important;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background-color .15s ease, color .15s ease;
}

.header .nav-ul a[href*="ricerca-annunci"]::before,
.header .nav-ul .jc-menu-branches > .wrap > a::before {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 13h18'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 13h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Icona segnaposto per Filiali. */
.header .nav-ul .jc-menu-branches > .wrap > a::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
}

.header .nav-ul a[href*="ricerca-annunci"]:hover,
.header .nav-ul a[href*="ricerca-annunci"]:focus-visible,
.header .nav-ul .jc-menu-branches > .wrap > a:hover,
.header .nav-ul .jc-menu-branches > .wrap > a:focus-visible,
.header .nav-ul .jc-menu-branches.current-menu-item > .wrap > a {
    background: #dd0731;
    color: #fff !important;
}

/* ---------- Selettore lingue ---------- */
.header .jc-lang__name,
.header .jc-lang__code {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #303030;
}

.header .pll-parent-menu-item img,
.header .lang-item img {
    width: 18px !important;
    height: 12px !important;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(48, 48, 48, .12);
    object-fit: cover;
}

/* Posizione: a destra, accanto a Login. Menu a tendina autonomo (hover, focus da tastiera, clic sulla freccia). */
.header .jc-lang-switch {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.header .jc-lang-menu,
.header .jc-lang-menu .sub-menu {
    list-style: none;
    margin: 0;
}

.header .jc-lang-menu {
    display: flex;
    padding: 0;
}

.header .jc-lang-menu > .pll-parent-menu-item {
    position: relative;
}

.header .jc-lang-menu > .pll-parent-menu-item > .wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.header .jc-lang-menu > .pll-parent-menu-item > .wrap > a,
.header .jc-lang-menu > .pll-parent-menu-item > .wrap > a > span {
    display: inline-flex;
    align-items: center;
    flex: none !important;
    width: auto !important;
    max-width: none !important;
    color: #303030;
    text-decoration: none;
}

.header .jc-lang-menu > .pll-parent-menu-item,
.header .jc-lang-menu > .pll-parent-menu-item > .wrap {
    flex: none;
    width: auto;
}

.header .jc-lang-menu > .pll-parent-menu-item > .wrap > .caret-wrap {
    margin-left: 6px !important;
}

/* Voci del menu: niente spaziature ereditate dal tema. */
.header .jc-lang-menu .lang-item,
.header .jc-lang-menu .lang-item > .wrap {
    margin: 0 !important;
    padding: 0 !important;
}

.header .jc-lang-menu .lang-item > .wrap > a {
    line-height: 1.3;
}

.header .jc-lang-menu > .pll-parent-menu-item > .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 100;
    display: block;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(48, 48, 48, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

/* Ponte invisibile tra pulsante e menu, per non perdere l'hover. */
.header .jc-lang-menu > .pll-parent-menu-item > .sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.header .jc-lang-menu > .pll-parent-menu-item:hover > .sub-menu,
.header .jc-lang-menu > .pll-parent-menu-item:focus-within > .sub-menu,
.header .jc-lang-menu > .pll-parent-menu-item.dropdown-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Pulsante (desktop) */
.header .jc-lang-menu > .pll-parent-menu-item > .wrap {
    gap: 4px;
    padding: 5px 10px 5px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 999px;
    transition: border-color .15s ease;
}

.header .jc-lang-menu > .pll-parent-menu-item > .wrap:hover,
.header .jc-lang-menu > .pll-parent-menu-item:focus-within > .wrap {
    border-color: #303030;
}

.header .jc-lang-menu > .pll-parent-menu-item > .wrap > a > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.header .jc-lang-menu > .pll-parent-menu-item .caret-wrap {
    margin-left: 0 !important;
}

.header .jc-lang-menu > .pll-parent-menu-item .caret svg {
    width: 9px;
    height: 9px;
}

/* Menu a tendina (desktop) */
.header .jc-lang-menu > .pll-parent-menu-item > .sub-menu {
    left: auto;
    right: 0;
    min-width: 176px;
    padding: 6px;
}

.header .jc-lang-menu .lang-item > .wrap {
    display: block;
}

.header .nav-ul .lang-item > .wrap > a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px !important;
    border-radius: 8px;
    transition: background-color .15s ease;
}

.header .nav-ul .lang-item > .wrap > a:hover,
.header .nav-ul .lang-item > .wrap > a:focus-visible {
    background: #f4f4f4;
}

.header .lang-item .jc-lang__name {
    font-weight: 600;
    letter-spacing: 0;
    font-size: 14px;
}

/* Lingua corrente: nome rosso e spunta. */
.header .lang-item.current-lang .jc-lang__name {
    color: #dd0731;
}

.header .jc-lang-menu .lang-item.current-lang > .wrap > a {
    padding-right: 34px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dd0731' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}

/* Menu mobile: le lingue sono sempre visibili, come pillole affiancate. */
.header-menu-sidebar .menu-mobile > .pll-parent-menu-item {
    border-bottom: 0;
    padding-top: 16px;
}

.header-menu-sidebar .menu-mobile > .pll-parent-menu-item > .wrap {
    display: none;
}

.header-menu-sidebar .menu-mobile > .pll-parent-menu-item > .sub-menu {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    position: static;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    visibility: visible;
    opacity: 1;
    transform: none;
}

.header-menu-sidebar .menu-mobile .lang-item {
    flex: 1 1 0;
    width: auto !important;
    min-width: 0;
    border: 0;
}

.header-menu-sidebar .menu-mobile .lang-item > .wrap > a {
    justify-content: center;
    min-height: 44px;
    gap: 6px;
    border: 1px solid #e8e8e8;
    border-radius: 999px;
    padding: 0 6px !important;
}

.header-menu-sidebar .menu-mobile .lang-item .jc-lang__name {
    font-size: 13px;
    white-space: nowrap;
}

.header-menu-sidebar .menu-mobile .lang-item.current-lang > .wrap > a {
    border-color: #dd0731;
    background: #fdecef;
}

@media (max-width: 359px) {
    .header-menu-sidebar .menu-mobile .lang-item > .wrap > a {
        gap: 6px;
        padding: 0 6px !important;
    }

    .header-menu-sidebar .menu-mobile .lang-item .jc-lang__name {
        font-size: 12px;
    }

    /* Sotto i 360 px le bandiere non entrano: restano i nomi delle lingue. */
    .header-menu-sidebar .menu-mobile .lang-item > .wrap > a img {
        display: none;
    }
}

/* ---------- Pulsanti ---------- */
.header a.button.button-primary {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .04em;
    white-space: nowrap;
    text-transform: uppercase;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* Lavora con noi: azione principale, rosso pieno */
.header a.button.button-primary[href*="lavora-con-noi"],
.header a.button.button-primary[href*="work-with-us"] {
    border: 2px solid #dd0731;
    background: #dd0731;
    color: #fff;
}

/* Login al portale: azione secondaria, grigio scuro con icona utente.
   I colori del tema sono nell'attributo style del link: servono regole !important. */
.header a.button.button-primary[href^="https://portale.jobcamere.com"] {
    border: 2px solid #303030 !important;
    background: #fff !important;
    color: #303030 !important;
}

.header a.button.button-primary[href^="https://portale.jobcamere.com"]::before {
    content: "";
    width: 15px;
    height: 15px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header a.button:focus-visible,
.header .nav-ul a:focus-visible {
    outline: 2px solid #dd0731;
    outline-offset: 3px;
}

/* Login visibile anche nelle pagine inglesi (il tema nascondeva il gruppo con :lang(en)). */
.header .header-main.hide-on-mobile .hfg-is-group:lang(en) {
    display: flex !important;
}

/* Gruppo pulsanti desktop: allineati e distanziati */
.header .header-main.hide-on-mobile .hfg-is-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header .header-main.hide-on-mobile .hfg-is-group > .builder-item,
.header .header-main.hide-on-mobile .hfg-is-group .builder-item--custom_html,
.header .header-main.hide-on-mobile .hfg-is-group .nv-html-content {
    margin: 0;
    padding: 0;
}

/* Sotto i 1060 px il menu completo non sta su una riga: si usa l'header mobile con hamburger. */
@media (min-width: 960px) and (max-width: 1059px) {
    .header .header-main.hide-on-mobile.hide-on-tablet {
        display: none !important;
    }

    .header .header-main.hide-on-desktop {
        display: block !important;
    }
}

/* Desktop stretto (fino a 1279 px): menu su una riga, Login solo icona. */
@media (min-width: 960px) and (max-width: 1279px) {
    .header .header-main.hide-on-mobile .builder-item--logo img.neve-site-logo {
        max-height: 52px;
    }

    .header .header-main.hide-on-mobile .hfg-slot.left > .builder-item:has(.builder-item--logo) {
        flex: 0 0 auto;
        width: auto;
    }

    .header .menu-desktop > li {
        margin-left: 4px !important;
        margin-right: 4px !important;
    }

    /* Spazio stretto: selettore lingue solo bandiera, pillole senza icona. */
    .header .jc-lang-menu .jc-lang__code {
        display: none;
    }

    .header .menu-desktop a[href*="ricerca-annunci"]::before,
    .header .menu-desktop .jc-menu-branches > .wrap > a::before {
        display: none;
    }

    .header .jc-lang-switch {
        margin-right: 6px;
    }

    .header .header-main.hide-on-mobile .hfg-is-group {
        gap: 8px;
    }

    .header .header-main.hide-on-mobile .builder-item.has-nav {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header .menu-desktop {
        flex-wrap: nowrap;
    }

    .header .menu-desktop > li {
        flex: 0 0 auto;
    }

    .header .menu-desktop > li > .wrap > a,
    .header .menu-desktop > li > a {
        font-size: 14px;
    }

    .header .menu-desktop a[href*="ricerca-annunci"],
    .header .menu-desktop .jc-menu-branches > .wrap > a {
        padding: 5px 12px 5px 10px !important;
    }

    .header .header-main.hide-on-mobile a.button.button-primary {
        padding: 0 16px;
        font-size: 13px;
    }

    /* Login solo icona: il testo resta disponibile ai lettori di schermo. */
    .header .header-main.hide-on-mobile a.button.button-primary[href^="https://portale.jobcamere.com"] {
        width: 42px;
        padding: 0;
        font-size: 0;
        letter-spacing: 0;
    }

    .header .header-main.hide-on-mobile a.button.button-primary[href^="https://portale.jobcamere.com"]::before {
        width: 17px;
        height: 17px;
    }
}

/* ---------- Mobile e tablet ---------- */
.header .header-main.hide-on-desktop .hfg-slot.left {
    grid-column: 1 / -1;
    width: 100%;
}

.header .header-main.hide-on-desktop .hfg-slot.left > .builder-item:has(.builder-item--nav-icon) {
    margin-left: auto;
}

.header .navbar-toggle {
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
}

.header-menu-sidebar .header-menu-sidebar-inner {
    padding: 8px 24px 24px;
}

/* Pulsante di chiusura allineato al margine destro delle voci. */
.header-menu-sidebar .close-sidebar-panel {
    position: relative;
    z-index: 2;
    padding: 16px 40px 8px !important;
    background: #fff;
}

.header-menu-sidebar .menu-mobile > li {
    border-bottom: 1px solid #e8e8e8;
}

.header-menu-sidebar .menu-mobile > li > .wrap > a,
.header-menu-sidebar .menu-mobile > li > a {
    font-size: 17px;
    font-weight: 600;
    color: #303030;
    padding-top: 14px;
    padding-bottom: 14px;
}

.header-menu-sidebar .menu-mobile > li.current-menu-item > .wrap > a,
.header-menu-sidebar .menu-mobile > li.current-menu-item > a {
    color: #dd0731;
}

.header-menu-sidebar .menu-mobile a[href*="ricerca-annunci"],
.header-menu-sidebar .menu-mobile .jc-menu-branches > .wrap > a {
    margin: 10px 0;
    padding: 10px 16px 10px 14px !important;
}

/* Frecce dei sottomenu: il tema le colora di bianco (invisibili su fondo bianco). */
.header-menu-sidebar .menu-mobile .caret-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto !important;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    color: #303030 !important;
}

.header-menu-sidebar .menu-mobile li:has(> .sub-menu.dropdown-open) > .wrap > a,
.header-menu-sidebar .menu-mobile li:has(> .sub-menu.dropdown-open) > .wrap > .caret-wrap {
    color: #dd0731 !important;
}

.header-menu-sidebar .menu-mobile li:has(> .sub-menu.dropdown-open) > .wrap > .caret-wrap {
    background: #fdecef !important;
}

/* Sottomenu: voci compatte, rientrate con una linea guida. */
.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu {
    margin: 0 0 12px 2px;
    padding: 0;
    border-left: 2px solid #f0f0f0;
}

.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu li,
.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu .wrap {
    border: 0;
    min-height: 0;
}

.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu a {
    padding: 8px 0 8px 16px !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
    color: #555 !important;
}

.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu a:hover,
.header-menu-sidebar .menu-mobile > li:not(.pll-parent-menu-item) > .sub-menu .current-menu-item > .wrap > a {
    color: #dd0731 !important;
}

.header-menu-sidebar .builder-item--button_base {
    margin-top: 12px;
}

.header-menu-sidebar a.button.button-primary {
    width: 100%;
    min-height: 48px;
}
