/*
 * Spazio Casa — albero menu approvato (8 reparti) r1.
 * Solo regole aggiuntive per le voci create da sc-menu-tree-r1.js; colori e
 * dimensioni vengono dalle variabili di sc-menu-v2. Attivo solo con la classe
 * .sc-menu-tree-r1 messa dallo script.
 */

/* Indietro: resta in vista mentre si scorre un reparto aperto. */
.sc-menu-tree-r1 .sc-tree__back {
    position: -webkit-sticky;
    position: sticky;
    top: var(--sc-menu-search-bottom, 130px);
    z-index: 5;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 10px 16px;
    color: var(--sc-menu-ink, #202124);
    background: var(--sc-menu-soft, #f6f7f8);
    border: 0;
    border-bottom: 1px solid var(--sc-menu-border, #e2e4e7);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

.sc-menu-tree-r1 .sc-tree__back[hidden] {
    display: none;
}

/* Il tema azzera l'outline con !important: qui il focus da tastiera torna visibile. */
.sc-menu-tree-r1 .sc-tree__back:focus-visible,
.sc-menu-tree-r1 #nt_mobile_menu_ul a:focus-visible,
.sc-menu-tree-r1 #nt_mobile_menu_ul button:focus-visible {
    outline: 3px solid var(--sc-menu-focus, #1264a3) !important;
    outline-offset: -3px;
}

.sc-menu-tree-r1 .sc-tree__back-icon {
    display: block;
    width: 9px;
    height: 9px;
    margin: 0 2px 0 4px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(45deg);
}

/* Vedi tutti: prima riga del reparto o della categoria aperta. */
.sc-menu-tree-r1 #nt_mobile_menu_ul .sc-tree__all > a {
    color: var(--sc-menu-red-dark, #bd151b) !important;
    font-weight: 700;
}

/* Reparto aperto: etichetta evidenziata, per capire dove ci si trova. */
.sc-menu-tree-r1 #nt_mobile_menu_ul
    > li.sc-menu-v2__item-open > .sc-menu-v2__group-label {
    color: var(--sc-menu-red-dark, #bd151b) !important;
    background: #fff7f7 !important;
}

.sc-menu-tree-r1 #nt_mobile_menu_ul .sc-tree__offerte > a {
    color: var(--sc-menu-red-dark, #bd151b) !important;
}

/* Elenco completo e utility: peso visivo minore dei reparti. */
.sc-menu-tree-r1 #nt_mobile_menu_ul > .sc-tree__legacy,
.sc-menu-tree-r1 #nt_mobile_menu_ul > .sc-tree__offerte {
    border-top: 8px solid var(--sc-menu-soft, #f6f7f8);
}

.sc-menu-tree-r1 #nt_mobile_menu_ul > .sc-tree__legacy
    > .sc-menu-v2__group-label,
.sc-menu-tree-r1 #nt_mobile_menu_ul > .sc-tree__utility > a {
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
}
/* Preserve the existing production V1 sticky-header spacing on migration to V2. */
@media (min-width: 1000px) {
    html.sc-menu-v2 .header-container.has_sticky {
        padding-bottom: 0 !important;
    }
}
