/* =========================================================
   HEADER v2 — SCOPED CSS (Fix Mobile & SVG explosion)
   ========================================================= */

.header_v2 {
    position: relative;
    width: 100%;
    background-color: #ffffff;
    z-index: 99999;
}

/* REGOLA SALVA-VITA: Impedisce a qualsiasi SVG generato da WP di esplodere */
.header_v2 svg {
    max-width: 100%;
    max-height: 100%;
    height: auto;
}

.header_v2 .major_wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

.header_container_v2 {
    display: flex;
    flex-direction: column;
}

/* ---------------------------------------------------------
   RIGA 1: LOGO + BUTTONS (DESKTOP E MOBILE)
   --------------------------------------------------------- */
.header_top_row_v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    background-color: #ffffff;
    position: relative;
    z-index: 10;
}

.logoBox_v2 {
    width: 180px;
    display: flex;
    align-items: center;
}

.logoBox_v2 a img,
.logoBox_v2 a svg {
    width: 100%;
    max-height: 35px;
    display: block;
}

.hc_buttons_v2 {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Icone Utente e Cerca */
.user_icon_box_v2 a,
.search_icon_box_v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #111111;
}

.user_icon_box_v2 svg,
.search_icon_box_v2 svg {
    width: 18px;
    height: 18px;
    stroke: #111111;
    fill: none;
}

/* Dropdown Lingua (WPML) */
.lang_box_v2 {
    position: relative;
}

button#lang_switcher_btn_v2 {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #111111;
    padding: 0;
}

.lang_selector_v2 {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 10px;
    z-index: 1000;
    min-width: 120px;
}

.lang_box_v2.open .lang_selector_v2 {
    display: block;
}

/* Dropdown Paese (INT/USA) */
.country-selector-wrapper_v2 {
    position: relative;
}

.dropdown-selected_v2 {
    border: 1px solid #d0d0d0;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: transparent;
}

.dropdown-selected_v2 .text {
    font-size: 12px;
    font-weight: 600;
    color: #111111;
}

.dropdown-options_v2 {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    min-width: 80px;
}

.custom-dropdown_v2.open .dropdown-options_v2 {
    display: block;
}

.dropdown-options_v2 li {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #111111;
}

/* ---------------------------------------------------------
   RIGA 2: DESKTOP MENU
   --------------------------------------------------------- */
.header_bottom_row_v2 {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 16px;
}

.menu_wrapper_v2 {
    width: 100%;
}

.menu_wrapper_v2 ul.menu,
.menu_wrapper_v2 ul {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.menu_wrapper_v2 ul.menu > li > a {
    color: #111111;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-decoration: none;
    display: block;
}

/* Submenu Desktop */
.menu_wrapper_v2 ul.menu li.menu-item-has-children {
    position: relative;
}

.menu_wrapper_v2 ul.menu li.menu-item-has-children .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    display: flex !important;
    flex-direction: column !important;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    padding: 10px 0 !important;
    transition: all 0.2s ease;
    z-index: 100;
}

.menu_wrapper_v2 ul.menu li.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
}

.menu_wrapper_v2 ul.menu li.menu-item-has-children .sub-menu li a {
    color: #111111;
    font-size: 12px;
    padding: 8px 16px;
}

/* =========================================================
   STILI MOBILE (< 1200px)
   ========================================================= */
.btn_mob_menu_v2 {
    display: none;
}

@media (max-width: 1200px) {
    .header_v2 .major_wrapper {
        padding: 0 20px;
    }

    .header_bottom_row_v2 {
        display: none;
    }

    .btn_mob_menu_v2 {
        display: block;
    }

    /* Pulsante Hamburger */
    button#trigger_mobile_menu_v2 {
        background: transparent;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 0;
        width: 26px;
        height: 26px;
        position: relative;
        z-index: 100001;
    }

    button#trigger_mobile_menu_v2 .mob_line {
        width: 22px;
        height: 2px;
        background-color: #111111;
        transition: all 0.3s ease;
        display: block;
    }

    /* Icona Hamburger trasforma in X */
    .header_v2.mob_open button#trigger_mobile_menu_v2 .mob_line.top {
        transform: translateY(7px) rotate(45deg);
    }
    .header_v2.mob_open button#trigger_mobile_menu_v2 .mob_line.mid {
        opacity: 0;
    }
    .header_v2.mob_open button#trigger_mobile_menu_v2 .mob_line.bottom {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* QUANDO IL MENU MOBILE È APERTO */
    body.header_v2_open {
        overflow: hidden !important;
    }

    .header_v2.mob_open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999999 !important;
        background-color: #3f3f3f !important;
        display: flex;
        flex-direction: column;
    }

    .header_v2.mob_open .header_container_v2 {
        height: 100%;
    }

    .header_v2.mob_open .header_top_row_v2 {
        flex-shrink: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .header_v2.mob_open .header_bottom_row_v2 {
        display: block !important;
        flex-grow: 1;
        overflow-y: auto !important;
        padding: 0 !important;
        border-bottom: none !important;
        background-color: #3f3f3f !important;
    }

    /* Elenco Voci del Menu Mobile */
    .header_v2.mob_open .menu_wrapper_v2 ul.menu,
    .header_v2.mob_open .menu_wrapper_v2 ul {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .header_v2.mob_open .menu_wrapper_v2 ul.menu > li {
        width: 100% !important;
        display: block !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        text-align: center;
    }

    .header_v2.mob_open .menu_wrapper_v2 ul.menu > li > a {
        color: #ffffff !important;
        padding: 18px 20px !important;
        font-size: 13px !important;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        display: block !important;
        width: 100%;
        pointer-events: auto !important; /* Forza i link a essere cliccabili */
        cursor: pointer !important;
    }

    .header_v2.mob_open .menu_wrapper_v2 ul.menu > li > a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Submenu Mobile */
    .header_v2.mob_open .menu_wrapper_v2 ul.menu li.menu-item-has-children .sub-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        background-color: #2e2e2e !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .header_v2.mob_open .menu_wrapper_v2 ul.menu li.menu-item-has-children .sub-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header_v2.mob_open .menu_wrapper_v2 ul.menu li.menu-item-has-children .sub-menu li a {
        color: #cccccc !important;
        padding: 12px 20px !important;
        font-size: 12px !important;
    }

    /* Limita le icone SVG eventualmente iniettate nei link */
    .header_v2.mob_open .menu_wrapper_v2 svg {
        max-width: 16px !important;
        max-height: 16px !important;
    }
}
