/* ════════════════════════════════════════════════════════════════
   Teleborsa Corporate — header-footer.css
   Design token dal Figma: Arancio #F75C06 | Grigio #424242 | Font: Figtree
   ════════════════════════════════════════════════════════════════ */

/* ── Token / variabili ─────────────────────────────────────────── */
:root {
    --tb-orange:      #F75C06;
    --tb-gray:        #424242;
    --tb-white:       #FFFFFF;
    --tb-bg-light:    #F1F1F1;
    --tb-mid:         #888888;

    --tb-font:        'Figtree', sans-serif;

    /* Altezze header dal Figma: topbar 34px + navbar 80px = 114px */
    --tb-topbar-h:    34px;
    --tb-navbar-h:    80px;
    --tb-header-h:    114px;   /* usato per offset pagine */

    --tb-gutter:      80px;
    --tb-max-w:       1728px;
    --tb-radius-pill: 400px;
    --tb-trans:       0.22s ease;
}

/* ════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--tb-trans);
}

/* WordPress admin bar (utente loggato): pusho l'header sotto la barra
   nera di amministrazione, altrimenti i primi 32px vengono coperti */
.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

/* ── Variante dark (homepage — navbar trasparente sopra il hero) */
.site-header--dark  .hdr-navbar { background: transparent; }
.site-header--dark  .hdr-menu__link,
.site-header--dark  .hdr-menu__link--has-sub { color: var(--tb-white); }
.site-header--dark  .hdr-logo__wordmark      { color: var(--tb-white); }
.site-header--dark  .hdr-logo__dot--white    { background: var(--tb-white); }
.site-header--dark  .hdr-hamburger__bar      { background: var(--tb-white); }

/* ── Variante light (pagine interne — navbar bianca) */
.site-header--light .hdr-navbar {
    background: var(--tb-white);
    box-shadow: 0 1px 0 rgba(66,66,66,0.10);
}
.site-header--light .hdr-menu__link,
.site-header--light .hdr-menu__link--has-sub { color: var(--tb-gray); }
.site-header--light .hdr-logo__wordmark      { color: var(--tb-orange); }
.site-header--light .hdr-logo__dot--white    { background: var(--tb-gray); }
.site-header--light .hdr-hamburger__bar      { background: var(--tb-gray); }

/* ── Sticky (dopo scroll su qualsiasi pagina)
   - Topbar nascosta
   - Navbar contratta (height ridotta)
   - Logo: solo pittogramma (i pallini), niente wordmark
   - Sfondo sempre bianco */
.site-header.is-sticky {
    --tb-navbar-h: 62px;
    --tb-header-h: 62px;
}
.site-header.is-sticky .hdr-topbar {
    display: none;
}
.site-header.is-sticky .hdr-navbar {
    background: var(--tb-white);
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
.site-header.is-sticky .hdr-menu__link,
.site-header.is-sticky .hdr-menu__link--has-sub { color: var(--tb-gray); }
.site-header.is-sticky .hdr-logo__wordmark      { color: var(--tb-orange); }
.site-header.is-sticky .hdr-logo__dot--white    { background: var(--tb-gray); }
.site-header.is-sticky .hdr-hamburger__bar      { background: var(--tb-gray); }

/* ════ TOP BAR ════════════════════════════════════════════════ */
.hdr-topbar {
    height: var(--tb-topbar-h);
    background: var(--tb-gray);
    display: flex;
    align-items: center;
}

.hdr-topbar__inner {
    width: 100%;
    max-width: var(--tb-max-w);
    margin: 0 auto;
    padding: 0 var(--tb-gutter);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.hdr-topbar__links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hdr-topbar__extlink {
    font-family: var(--tb-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--tb-white);
    text-decoration: none;
    line-height: 1;
    transition: color var(--tb-trans);
}
.hdr-topbar__extlink:hover { color: var(--tb-orange); }

.hdr-topbar__sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.35);
    flex-shrink: 0;
}

/* ════ SWITCHER LINGUA ════════════════════════════════════════ */
.hdr-lang {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.hdr-lang__btn {
    font-family: var(--tb-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--tb-white);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    line-height: 1;
    transition: color var(--tb-trans);
}
.hdr-lang__btn:hover { color: var(--tb-orange); }

.hdr-lang__arrow {
    transition: transform 0.22s ease;
}
.hdr-lang__btn[aria-expanded="true"] .hdr-lang__arrow {
    transform: rotate(180deg);
}

/* Dropdown lingua — nascosto di default, visibile solo con .is-open */
.hdr-lang__list {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 140px;
    background: var(--tb-white);
    border-radius: 5px;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.20);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 600;
    overflow: hidden;
}
.hdr-lang__list.is-open { display: block; }

.hdr-lang__list li { list-style: none; }

.hdr-lang__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background var(--tb-trans);
}
.hdr-lang__option:hover { background: var(--tb-bg-light); }
.hdr-lang__option.is-active { font-weight: 700; }

.hdr-lang__code {
    font-family: var(--tb-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--tb-gray);
    min-width: 22px;
}
.hdr-lang__name {
    font-family: var(--tb-font);
    font-size: 14px;
    color: var(--tb-gray);
}

/* ════ NAVBAR ════════════════════════════════════════════════ */
.hdr-navbar {
    position: relative;          /* contenitore del mega-menu full-width */
    height: var(--tb-navbar-h);
    transition: background var(--tb-trans), box-shadow var(--tb-trans);
}

.hdr-navbar__inner {
    height: 100%;
    max-width: var(--tb-max-w);
    margin: 0 auto;
    padding: 0 var(--tb-gutter);
    display: flex;
    align-items: center;
    gap: 40px;
}

/* ════ LOGO ══════════════════════════════════════════════════ */
.hdr-logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    flex-shrink: 0;
}

/* Custom logo WordPress */
.hdr-logo .custom-logo-link img {
    height: 44px;
    width: auto;
}

.hdr-logo__wordmark {
    font-family: var(--tb-font);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
    transition: color var(--tb-trans);
}

/* Tre pallini del logo */
.hdr-logo__dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.hdr-logo__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.hdr-logo__dot--orange { background: var(--tb-orange); }
.hdr-logo__dot--gray   { background: var(--tb-mid); }
.hdr-logo__dot--white  { transition: background var(--tb-trans); }

/* ════ NAV / MENU PRINCIPALE ════════════════════════════════ */
.hdr-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hdr-menu {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;        /* MAI andare a capo */
    gap: 44px;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

/* Item */
.hdr-menu__item {
    /* NB: niente position:relative — il dropdown full-width
       deve essere ancorato al navbar, non al singolo item */
    list-style: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Link voce: colore ereditato dalla variante header.
   Anche il trigger del mega-menu (button) usa lo stesso stile. */
.hdr-menu__link {
    font-family: var(--tb-font);
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--tb-trans), opacity var(--tb-trans);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    color: inherit;
}

/* Rollover voce primo livello (PDF Componenti): testo al 50% di opacità
   + barra arancione 6px sotto. Mantiene il colore base (bianco su dark,
   grigio su light), niente cambio in arancione. */
.hdr-menu__link:hover {
    opacity: 0.5;
}

.hdr-menu__item:not(.is-current):not(.current-menu-item):not(.current-menu-ancestor) > .hdr-menu__link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 6px;
    background: var(--tb-orange);
    border-radius: 3px;
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: center;
    transition: opacity var(--tb-trans), transform var(--tb-trans);
    pointer-events: none;
}
.hdr-menu__item:not(.is-current):not(.current-menu-item):not(.current-menu-ancestor) > .hdr-menu__link:hover::after,
.hdr-menu__item--has-sub:not(.is-current):hover > .hdr-menu__link::after,
.hdr-menu__item--has-sub:has(.hdr-menu__link[aria-expanded="true"]) > .hdr-menu__link::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Voce attiva: SOLO la barra arancio sotto, testo resta del colore normale */
.hdr-menu__item.is-current > .hdr-menu__link,
.hdr-menu__item.current-menu-item > .hdr-menu__link,
.hdr-menu__item.current-menu-ancestor > .hdr-menu__link {
    /* nessun cambio colore */
}

/* Sottolineatura arancio voce attiva — full-width sotto la voce (uniformata al hover).
   Applicata al link (position: relative) anziché all'item (non più relative). */
.hdr-menu__item.is-current > .hdr-menu__link::after,
.hdr-menu__item.current-menu-item > .hdr-menu__link::after,
.hdr-menu__item.current-menu-ancestor > .hdr-menu__link::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--tb-orange);
    border-radius: 3px;
    pointer-events: none;
    /* Sovrascrive l'opacità ridotta dell'hover-rule sulle voci non-current */
    opacity: 1;
    transform: none;
}

/* Freccia dropdown: dimensioni aumentate (18px) e weight maggiore */
.hdr-menu__arrow {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    transition: transform 0.22s ease;
}
.hdr-menu__link--trigger[aria-expanded="true"] .hdr-menu__arrow,
.hdr-menu__arrow-btn[aria-expanded="true"] .hdr-menu__arrow {
    transform: rotate(180deg);
}

/* L'item con sub deve essere flex per allineare link + freccia */
.hdr-menu__item--has-sub {
    display: inline-flex;
    align-items: center;
}

/* ════ MEGA-DROPDOWN ─ full-width ════════════════════════ */

/* Area cliccabile estesa sotto per coprire il "buco" tra item e dropdown */
.hdr-menu__item--has-sub {
    padding-bottom: 8px;
    margin-bottom: -8px;
}

.hdr-dropdown {
    /* Full-width: ancorato al navbar (position: relative).
       Il navbar è già 100% della viewport quindi width:100% basta —
       width:100vw stava facendo straripare a sx/dx. */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    background: var(--tb-white);
    border-top: 1px solid rgba(66,66,66,0.10);
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    list-style: none;
    padding: 0;
    z-index: 500;
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    /* Voci allineate a destra come da Webflow di riferimento */
    justify-content: flex-end;
    padding-right: var(--tb-gutter);
    padding-left: var(--tb-gutter);
    box-sizing: border-box;
}

/* Animazione apertura */
.hdr-dropdown.is-open {
    display: flex;
    animation: tbDropDown 0.18s ease;
}
@keyframes tbDropDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Pseudo-elemento PONTE invisibile sopra il dropdown */
.hdr-dropdown::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

.hdr-dropdown__item {
    list-style: none;
    display: flex;
    align-items: center;
    border-right: none;
}
.hdr-dropdown__item:last-child {
    border-right: none;
}

.hdr-dropdown__link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 22px 24px;
    font-family: var(--tb-font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--tb-gray);
    text-decoration: none;
    border-bottom: none;
    white-space: nowrap;
    transition: color var(--tb-trans);
}
.hdr-dropdown__item:last-child .hdr-dropdown__link { border-bottom: none; }
/* Rollover voci dropdown: cambia colore in arancione (come prima del Componenti) */
.hdr-dropdown__link:hover {
    color: var(--tb-orange);
    opacity: 1;
}

/* ─── DROPDOWN su header trasparente (--dark) ─────────────────
   Sfondo nero al 50% di opacità, voci in bianco */
.site-header--dark .hdr-dropdown {
    background: rgba(0, 0, 0, 0.5);
    border-top: none;
    box-shadow: none;
}
.site-header--dark .hdr-dropdown__link {
    color: var(--tb-white);
}
.site-header--dark .hdr-dropdown__link:hover {
    color: var(--tb-orange);
}

/* Quando in sticky, l'header è SEMPRE bianco anche se la pagina era
   in stato dark: il dropdown deve tornare bianco/grigio standard */
.site-header.is-sticky .hdr-dropdown {
    background: var(--tb-white);
    border-top: 1px solid rgba(66,66,66,0.10);
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
}
.site-header.is-sticky .hdr-dropdown__link {
    color: var(--tb-gray);
}

/* ════ HAMBURGER (mobile) ════════════════════════════════════ */
.hdr-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.hdr-hamburger__bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hdr-hamburger[aria-expanded="true"] .hdr-hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hdr-hamburger[aria-expanded="true"] .hdr-hamburger__bar:nth-child(2) {
    opacity: 0;
}
.hdr-hamburger[aria-expanded="true"] .hdr-hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ════════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════════ */

.site-footer {
    background: var(--tb-gray);
    color: var(--tb-white);
}

.ftr-inner {
    max-width: var(--tb-max-w);
    margin: 0 auto;
    padding: 80px var(--tb-gutter) 40px;
}

/* ════ TOP: 2 colonne — menu SX + side col DX ═══════════════ */
.ftr-top {
    display: grid;
    /* SX si espande, DX larghezza minima per icone+logo */
    grid-template-columns: 1fr auto;
    gap: 60px;
    padding-bottom: 40px;
}

/* ─── COLONNA SX: menu unico verticale ─── */
.ftr-menu-col {
    display: flex;
    flex-direction: column;
}

.ftr-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;          /* il line-height di ogni voce dà già il giusto spazio */
}
.ftr-menu__item { list-style: none; }

.ftr-menu__link {
    font-family: var(--tb-font);
    font-size: 20px;
    font-weight: 400;
    line-height: 32px;
    color: var(--tb-white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--tb-trans);
}
.ftr-menu__link:hover { color: var(--tb-orange); }

/* Toggle (Prodotti e servizi, Case history): la freccia ruota se aperta */
.ftr-menu__arrow {
    transition: transform 0.22s ease;
    flex-shrink: 0;
}
.ftr-menu__link--toggle[aria-expanded="true"] .ftr-menu__arrow {
    transform: rotate(180deg);
}

/* Sotto-voci di "Prodotti e servizi": indentate, hidden di default */
.ftr-submenu {
    list-style: none;
    margin: 4px 0 8px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.ftr-submenu[hidden] { display: none; }
.ftr-submenu__item { list-style: none; }

.ftr-submenu__link {
    font-family: var(--tb-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    display: inline-block;
    padding: 2px 0 2px 24px;     /* indentazione */
    transition: color var(--tb-trans);
}
.ftr-submenu__link:hover { color: var(--tb-orange); }

/* ─── COLONNA DX: socials in alto + badge in basso ─── */
.ftr-side-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 320px;        /* spinge il logo verso il basso */
    gap: 24px;
}

.ftr-socials {
    display: flex;
    gap: 14px;
    align-items: center;
}

.ftr-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--tb-white);
    text-decoration: none;
    /* Niente rollover: nessun cambio colore/trasformazione */
}
.ftr-social svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    display: block;
}

/* Logo "pallini" Teleborsa nella colonna DX */
.ftr-badge {
    display: flex;
    align-items: flex-end;
}
.ftr-badge img,
.ftr-badge svg {
    max-height: 40px;
    width: auto;
    height: auto;
    display: block;
}

/* ════ BOTTOM: copyright + privacy CENTRATI ══════════════════ */
.ftr-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 28px;
    text-align: center;
}

.ftr-copyright,
.ftr-privacy,
.ftr-whistleblowing {
    margin: 0;
    font-family: var(--tb-font);
    font-size: 14px;
    font-weight: 300;
    line-height: 22px;
    color: rgba(255,255,255,0.55);
}
.ftr-privacy a,
.ftr-whistleblowing a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color var(--tb-trans);
}
.ftr-privacy a:hover,
.ftr-whistleblowing a:hover { color: var(--tb-white); text-decoration: underline; }

/* Separatore "·" tra Privacy policy e Cookie policy nel footer */
.ftr-privacy .ftr-sep {
    margin: 0 4px;
    color: rgba(255,255,255,0.4);
    user-select: none;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE FOOTER
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ftr-inner {
        padding: 50px 24px 30px;
    }
    .ftr-top {
        grid-template-columns: 1fr;
        gap: 40px;
        padding-bottom: 30px;
    }
    /* Su mobile la colonna laterale va in fondo, social in riga */
    .ftr-side-col {
        align-items: center;
        min-height: 0;
        gap: 24px;
    }
    .ftr-menu__link { font-size: 18px; line-height: 28px; }
    .ftr-submenu__link { font-size: 15px; line-height: 26px; padding-left: 20px; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    :root { --tb-gutter: 48px; }
    .hdr-menu { gap: 28px; }
    .hdr-menu__link { font-size: 18px; }
    /* Footer: a 1200px restringo gap ma resta 1fr auto */
    .ftr-top { gap: 40px; }
}

@media (max-width: 960px) {
    :root {
        --tb-topbar-h: 32px;
        --tb-navbar-h: 68px;
        --tb-header-h: 100px;
    }

    /* Mostra hamburger, nascondi nav */
    .hdr-hamburger { display: flex; }
    .hdr-nav       { display: none; }

    /* Menu mobile aperto */
    .hdr-nav.is-open {
        display: flex;
        position: fixed;
        top: var(--tb-header-h);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(36, 36, 36, 0.98);
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hdr-nav.is-open .hdr-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding: 16px 0 40px;
    }

    .hdr-nav.is-open .hdr-menu__item {
        border-bottom: 1px solid rgba(255,255,255,0.07);
        width: 100%;
    }

    .hdr-nav.is-open .hdr-menu__link {
        color: var(--tb-white) !important;
        font-size: 20px;
        padding: 15px var(--tb-gutter);
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .hdr-nav.is-open .hdr-menu__item.is-current > .hdr-menu__link::after,
    .hdr-nav.is-open .hdr-menu__item.is-current::after,
    .hdr-nav.is-open .hdr-menu__item.current-menu-item::after,
    .hdr-nav.is-open .hdr-menu__item.current-menu-ancestor::after {
        display: none;
    }

    /* Su mobile l'item con sub deve permettere il click sull'intera area
       (link + freccia tutti su una riga) */
    .hdr-nav.is-open .hdr-menu__item--has-sub {
        flex-wrap: wrap;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .hdr-nav.is-open .hdr-menu__item--has-sub > .hdr-menu__link {
        flex: 1 1 auto;
    }
    .hdr-nav.is-open .hdr-menu__arrow-btn {
        padding: 15px 24px;
        color: var(--tb-white);
    }
    .hdr-nav.is-open .hdr-dropdown {
        flex: 1 1 100%;
        order: 2;
    }

    /* Dropdown mobile — espandibile inline a COLONNA */
    .hdr-nav.is-open .hdr-dropdown {
        position: static;
        transform: none;
        border-radius: 0;
        border-top: none;
        border-left: 3px solid var(--tb-orange);
        box-shadow: none;
        background: rgba(0,0,0,0.25);
        animation: none;
        margin: 0;
        /* Override del nuovo layout orizzontale: torna a colonna su mobile */
        flex-direction: column !important;
        flex-wrap: nowrap;
        max-width: none;
        white-space: normal;
    }
    .hdr-nav.is-open .hdr-dropdown:not([hidden]) {
        animation: none;
    }
    .hdr-nav.is-open .hdr-dropdown__item {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .hdr-nav.is-open .hdr-dropdown__item:last-child {
        border-bottom: none;
    }

    .hdr-nav.is-open .hdr-dropdown__link {
        color: rgba(255,255,255,0.75);
        padding: 11px var(--tb-gutter) 11px calc(var(--tb-gutter) + 16px);
        font-size: 16px;
        border-bottom-color: rgba(255,255,255,0.05);
        white-space: normal;
        height: auto;
    }
    .hdr-nav.is-open .hdr-dropdown__link:hover {
        background: rgba(247,92,6,0.15);
        color: var(--tb-orange);
    }

    /* Nasconde link esterni nella topbar su mobile */
    .hdr-topbar__links,
    .hdr-topbar__sep { display: none; }

    /* Footer su tablet/mobile: collassa in colonna */
    .ftr-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .ftr-side-col {
        align-items: center;
        min-height: 0;
    }
    .ftr-bottom {
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --tb-gutter:   24px;
        --tb-navbar-h: 60px;
        --tb-header-h: 92px;
    }

    .hdr-logo__wordmark { font-size: 22px; }
    .ftr-inner          { padding-top: 60px; }
    .ftr-logo__wordmark { font-size: 24px; }
}

/* ════════════════════════════════════════════════════════════════
   LOGO DOPPIO — bianco su dark/hero, colorato su light/sticky
   ════════════════════════════════════════════════════════════════ */

/* Logo bianco: visibile su dark, nascosto su light/sticky */
.hdr-logo__img--dark  { display: block; }
.hdr-logo__img--light { display: none;  }

.site-header--light .hdr-logo__img--dark  { display: none;  }
.site-header--light .hdr-logo__img--light { display: block; }

/* Sticky: nascondo TUTTI i loghi testuali/wordmark e mostro solo l'icona */
.site-header.is-sticky .hdr-logo__img--dark,
.site-header.is-sticky .hdr-logo__img--light,
.site-header.is-sticky .hdr-logo__img,
.site-header.is-sticky .hdr-logo__wordmark,
.site-header.is-sticky .hdr-logo__dots,
.site-header.is-sticky .custom-logo-link { display: none !important; }

/* Logo icona: nascosto di default, visibile solo in sticky */
.hdr-logo__icon { display: none; }
.site-header.is-sticky .hdr-logo__icon {
    display: block;
    height: 36px;
    width: auto;
}

/* Dimensioni logo (configurabili via ACF) */
.hdr-logo__img--dark,
.hdr-logo__img--light,
.hdr-logo__img,
.hdr-logo .custom-logo-link img {
    height: var(--logo-h, 44px);
    width: auto;
    max-width: 320px;
    object-fit: contain;
}

/* ════════════════════════════════════════════════════════════════
   ICONE FOCUS — SVG custom, upload, libreria
   ════════════════════════════════════════════════════════════════ */
.focus-icon__svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    color: var(--tb-gray);
}

.focus-icon__svg svg {
    width: 60px;
    height: 60px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.focus-icon__img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

/* ════════════════════════════════════════════════════════════════
   FOOTER BADGE — logo personalizzato in basso a destra
   ════════════════════════════════════════════════════════════════ */
.ftr-badge img,
.ftr-badge svg {
    height: var(--badge-h, 70px);
    max-height: var(--badge-h, 70px);
    width: auto;
    object-fit: contain;
    display: block;
}

.ftr-badge a {
    display: inline-flex;
    transition: opacity var(--tb-trans);
}
.ftr-badge a:hover {
    opacity: 0.8;
}
