/* ============================================================
   SGH – Serigest Header Menu – Frontend Styles
   ============================================================ */

/* ── Reset / vars ─────────────────────────────────────────── */
.sgh-header *,
.sgh-drawer *,
.sgh-megamenu * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sgh-height:       90px;
    --sgh-bg:           #ffffff;
    --sgh-border:       #ebebeb;
    --sgh-text:         #111111;
    --sgh-text-muted:   #777;
    --sgh-accent:       #111111;
    --sgh-hover-bg:     #f5f5f5;
    --sgh-mega-bg:      #ffffff;
    --sgh-drawer-width: 320px;
    --sgh-transition:   .18s ease;
    --sgh-radius:       8px;
    --sgh-font:         inherit;
}

/* ── Header shell ─────────────────────────────────────────── */
.sgh-header {
    position: relative;
    z-index: 1000;
    background: #ffffff;
}

.sgh-header__inner {
    display: flex;
    align-items: center;
    height: var(--sgh-height);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 32px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.sgh-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sgh-logo img {
    height: 36px;
    width: auto;
    display: block;
}

.sgh-logo__text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sgh-text);
    letter-spacing: -.02em;
}

/* ── Right side wrapper ───────────────────────────────────── */
.sgh-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Search inline (destra, vicino alle icone) ────────────── */
.sgh-search-inline {
    display: flex;
    align-items: center;
}

/* Il campo è il contenitore pill che include anche il bottone */
.sgh-search-inline__field {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--sgh-border);
    border-radius: 50px;
    padding: 7px 7px 7px 20px;
    background: #fff;
    transition: border-color .15s, width .22s ease, max-width .22s ease;
    width: 440px;
}

.sgh-search-inline__field:focus-within {
    border-color: #bbb;
}

.sgh-search-inline__field svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #9ca3af;
}

.sgh-search-inline__field input[type="search"] {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--sgh-text);
    outline: none;
    min-width: 0;
}

.sgh-search-inline__field input[type="search"]::placeholder {
    color: #9ca3af;
}

/* Bottone dentro il pill, con ombra che lo fa sembrare sollevato */
.sgh-search-inline__submit {
    flex-shrink: 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

.sgh-search-inline__submit:hover {
    background: #2a2a2a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
}

/* Wrapper campo ricerca (desktop) */
.sgh-search-expand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Desktop nav ──────────────────────────────────────────── */
.sgh-nav {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sgh-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.sgh-item {
    position: static;
}

.sgh-item--link {
    position: relative;
}

/* Il mega item resta static: il dropdown si ancora a .sgh-header */
.sgh-item--mega {
    position: static;
}

/* ── Link con underline animato ───────────────────────────── */
.sgh-item__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 22px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: normal;
    text-transform: none;
    color: var(--sgh-text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--sgh-font);
    transition: color var(--sgh-transition);
    /* Allinea verticalmente al centro dell'header */
    margin-top: 16px;
}

/* Underline animata che scorre da centro verso i lati */
.sgh-item__link::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 50%;
    right: 50%;
    height: 2px;
    background: var(--sgh-text);
    border-radius: 2px;
    transition: left .22s ease, right .22s ease;
}

.sgh-item__link:hover {
    color: var(--sgh-text);
    opacity: .75;
}

.sgh-item__link:hover::after,
.sgh-item--mega.is-open > .sgh-item__link::after {
    left: 14px;
    right: 14px;
}

.sgh-item--mega.is-open > .sgh-item__link {
    color: var(--sgh-text);
}

.sgh-item--highlight.sgh-item--mega.is-open > .sgh-item__link {
    color: #2e81bb;
}

.sgh-chevron {
    transition: transform var(--sgh-transition);
    flex-shrink: 0;
    opacity: .5;
}

.sgh-item--mega.is-open .sgh-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ── Voce “in evidenza” (admin: Spicca) — colore + vibrazione periodica ── */
.sgh-item--highlight .sgh-item__link {
    color: #2e81bb;
    opacity: 1;
}

.sgh-item--highlight .sgh-item__link::after {
    background: #2e81bb;
}

.sgh-item--highlight .sgh-item__link:hover {
    color: #2e81bb;
    opacity: 0.92;
}

.sgh-highlight-label {
    display: inline-block;
    will-change: transform;
    animation: sgh-menu-vibrate 3.5s ease-in-out infinite;
}

@keyframes sgh-menu-vibrate {
    0%,
    86%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    87% {
        transform: translate3d(-3px, -2px, 0);
    }
    88% {
        transform: translate3d(3px, 2px, 0);
    }
    89% {
        transform: translate3d(-2px, 2px, 0);
    }
    90% {
        transform: translate3d(2px, -2px, 0);
    }
    91% {
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgh-highlight-label {
        animation: none;
    }
}

/* ── Actions (search, account, cart, hamburger) ───────────── */
.sgh-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sgh-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    color: var(--sgh-text);
    text-decoration: none;
    transition: background var(--sgh-transition);
}

.sgh-action:hover {
    background: var(--sgh-hover-bg);
}

.sgh-cart-count {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: #e53935;
    border-radius: 50%;
    font-size: 0;
    padding: 0;
    min-width: 0;
    pointer-events: none;
    border: 2px solid #fff;
}

.sgh-cart-count.is-empty {
    display: none;
}

/* ── Hamburger ────────────────────────────────────────────── */
.sgh-action--hamburger {
    flex-direction: column;
    gap: 5px;
    display: none;   /* shown only on mobile */
}

.sgh-action--hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--sgh-transition), opacity var(--sgh-transition);
    transform-origin: center;
}

.sgh-action--hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sgh-action--hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.sgh-action--hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Search bar ───────────────────────────────────────────── */
/* Dropdown searchbar legacy disabilitato — search è inline desktop + mobile header */
.sgh-searchbar {
    display: none !important;
}

/* Icona ricerca header: solo mobile (vedi media query) */
.sgh-action--header-search {
    display: none;
}

.sgh-action--header-search svg {
    width: 18px;
    height: 18px;
}

.sgh-action--header-search.is-open {
    background: var(--sgh-hover-bg);
}

.sgh-searchbar {
    border-top: 1px solid var(--sgh-border);
    background: var(--sgh-bg);
    overflow: hidden;
    max-height: 0;
    transition: max-height .28s ease, padding .28s ease;
    padding: 0;
}

.sgh-searchbar:not([hidden]) {
    max-height: 90px;
    padding: 14px 0;
}

.sgh-searchbar[hidden] {
    display: block !important;
    max-height: 0;
    padding: 0;
}

.sgh-searchbar__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sgh-searchbar__inner form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Campo input con icona */
.sgh-searchbar__field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    border: 1.5px solid var(--sgh-border);
    border-radius: 50px;
    padding: 10px 18px;
    background: #fff;
    transition: border-color .15s;
}

.sgh-searchbar__field:focus-within {
    border-color: #999;
}

.sgh-searchbar__field svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #9ca3af;
}

.sgh-searchbar__field input[type="search"] {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--sgh-text);
    outline: none;
    min-width: 0;
}

.sgh-searchbar__field input[type="search"]::placeholder {
    color: #9ca3af;
}

/* Pulsante Cerca */
.sgh-searchbar__submit {
    flex-shrink: 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.sgh-searchbar__submit:hover {
    background: #333;
}

/* Pulsante chiudi */
.sgh-searchbar__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--sgh-text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    transition: color var(--sgh-transition);
    flex-shrink: 0;
}

.sgh-searchbar__close:hover {
    color: var(--sgh-text);
}

/* ── Mega menu dropdown ───────────────────────────────────── */

/*
 * Il mega menu si aggancia all'header (position: relative sul nav)
 * e si estende per tutta la larghezza disponibile senza uscire dal viewport.
 */
.sgh-nav {
    position: static; /* il mega si aggancia a .sgh-header */
}

.sgh-header {
    position: relative; /* ancora per il mega menu */
}

.sgh-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--sgh-border);
    box-shadow: 0 20px 48px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
        opacity .25s cubic-bezier(.4,0,.2,1),
        visibility .25s cubic-bezier(.4,0,.2,1),
        transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 999;
    isolation: isolate;
}

/* Bridge tra trigger e dropdown */
.sgh-megamenu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.sgh-item--mega.is-open .sgh-megamenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.sgh-megamenu__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 24px 32px 32px;
    max-width: 1440px;
    margin: 0 auto;
}

/* ── Mega menu column ─────────────────────────────────────── */
.sgh-mega__col {
    padding: 0 20px;
    border-left: 1px solid var(--sgh-border);
}

.sgh-mega__col:nth-child(4n+1) {
    border-left: none;
    padding-left: 0;
}

/* Link categoria genitore */
.sgh-mega__parent {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 8px;
    margin-bottom: 6px;
    text-decoration: none;
    border-radius: 8px;
    background: #fff;
    transition: background .18s ease, box-shadow .18s ease;
    text-align: left;
}

.sgh-mega__parent:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.sgh-mega__icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sgh-mega__icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter .18s ease;
    border-radius: 50%;
}

.sgh-mega__parent:hover .sgh-mega__icon img {
    filter: grayscale(0%);
}

.sgh-mega__icon--placeholder {
    color: var(--sgh-text-muted);
}

.sgh-mega__parent-name {
    font-size: .7rem;
    font-weight: 700;
    color: var(--sgh-text);
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Sottocategorie */
.sgh-mega__children {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sgh-mega__children a {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px 8px;
    font-size: .8125rem;
    color: var(--sgh-text-muted);
    text-decoration: none;
    border-radius: 5px;
    transition: color .15s ease, padding-left .15s ease;
    white-space: normal;
    position: relative;
}

.sgh-mega__children a::before {
    content: '→';
    font-size: .7rem;
    opacity: 0;
    margin-right: 0;
    transition: opacity .15s ease, margin-right .15s ease;
    color: var(--sgh-text);
    flex-shrink: 0;
}

.sgh-mega__children a:hover {
    color: var(--sgh-text);
    padding-left: 14px;
}

.sgh-mega__children a:hover::before {
    opacity: 1;
    margin-right: 5px;
    position: absolute;
    left: 0;
}

/* ── Overlay — nascosto (drawer è full-screen) ─────────────── */
.sgh-overlay { display: none !important; }

/* ── Mobile drawer — full screen ──────────────────────────── */
.sgh-drawer {
    position: fixed;
    inset: 0;
    width: 100vw;
    background: var(--sgh-bg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.sgh-drawer.is-open {
    transform: translateX(0);
}

/* Header drawer */
.sgh-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 68px;
    border-bottom: 1px solid var(--sgh-border);
    flex-shrink: 0;
}

.sgh-drawer__logo img {
    height: 36px;
    width: auto;
}

/* X di chiusura */
.sgh-drawer__close {
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--sgh-transition), color var(--sgh-transition);
    flex-shrink: 0;
}

.sgh-drawer__close:hover {
    background: #e0e0e0;
    color: #000;
}

/* Toggle label (non più button) */
.sgh-drawer__mega-toggle {
    display: block;
    padding: 12px 24px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #aaa;
    cursor: default;
}

/* Nav */
.sgh-drawer__nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0;
}

.sgh-drawer__menu {
    list-style: none;
}

.sgh-drawer__item > a,
.sgh-drawer__mega-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sgh-text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--sgh-font);
    transition: background var(--sgh-transition);
    border-radius: 0;
}

.sgh-drawer__item > a:hover,
.sgh-drawer__mega-toggle:hover {
    background: var(--sgh-hover-bg);
}

.sgh-drawer__mega-toggle .sgh-chevron {
    transition: transform var(--sgh-transition);
}

.sgh-drawer__mega-toggle[aria-expanded="true"] .sgh-chevron {
    transform: rotate(180deg);
}

.sgh-drawer__item--highlight > a,
.sgh-drawer__item--highlight .sgh-drawer__mega-toggle {
    color: #2e81bb;
}

.sgh-drawer__item--highlight > a:hover,
.sgh-drawer__item--highlight .sgh-drawer__mega-toggle:hover {
    color: #2e81bb;
    opacity: 0.95;
}

/* Submenu categorie */
.sgh-drawer__submenu {
    list-style: none;
    background: #fafafa;
    border-top: 1px solid var(--sgh-border);
    border-bottom: 1px solid var(--sgh-border);
    padding: 12px 0;
}

/* Categoria con icona tonda */
.sgh-drawer__subitem--parent > .sgh-drawer__parent-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--sgh-text);
    text-decoration: none;
    transition: background var(--sgh-transition);
}

.sgh-drawer__parent-link:hover {
    background: var(--sgh-hover-bg);
    color: var(--sgh-accent);
}

/* Icona tonda categoria nel drawer */
.sgh-drawer__cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgh-drawer__cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sgh-drawer__subchildren {
    list-style: none;
    padding: 2px 0 6px;
}

.sgh-drawer__subchildren a {
    display: block;
    padding: 7px 24px 7px 84px;
    font-size: .825rem;
    color: var(--sgh-text-muted);
    text-decoration: none;
    transition: color var(--sgh-transition);
}

.sgh-drawer__subchildren a:hover {
    color: var(--sgh-text);
}

/* Footer drawer — pill neri come Cerca / submit searchbar */
.sgh-drawer__footer {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--sgh-border);
    flex-shrink: 0;
    background: var(--sgh-bg);
}

.sgh-drawer__footer--single .sgh-drawer__action {
    flex: 1;
    justify-content: center;
}

.sgh-drawer__action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: #111;
    border: none;
    border-radius: 50px;
    transition: background .15s ease, color .15s ease, transform .12s ease;
    box-shadow: none;
}

.sgh-drawer__action:hover {
    background: #333;
    color: #fff;
}

.sgh-drawer__action:active {
    transform: scale(0.98);
}

/* Voce in evidenza (solo nel pulsante, non in elenco): blu brand, testo bianco */
.sgh-drawer__action--spica {
    background: #2e81bb;
    color: #fff;
}

.sgh-drawer__action--spica:hover {
    background: #2570a3;
    color: #fff;
}

.sgh-drawer__action--spica .sgh-drawer__action-label {
    max-width: 46vw;
}

.sgh-drawer__action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: inherit;
}

.sgh-drawer__action-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sgh-drawer__action-icon--round {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

.sgh-drawer__action-icon--round img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sgh-drawer__action-icon--round svg {
    width: 16px;
    height: 16px;
    opacity: 0.95;
}

.sgh-drawer__action-label {
    min-width: 0;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 781px) {
    .sgh-nav {
        display: none;
    }

    /* Barra ricerca desktop nascosta; quella nel dropdown mobile è eccezione sotto */
    .sgh-search-expand .sgh-search-inline {
        display: none !important;
    }

    .sgh-action--header-search {
        display: inline-flex !important;
    }

    .sgh-action--account {
        display: none;
    }

    .sgh-right {
        margin-left: auto;
    }

    .sgh-action--hamburger {
        display: inline-flex;
    }

    .sgh-header__inner {
        padding: 0 16px;
        gap: 8px;
    }

    .sgh-logo img {
        height: 30px;
    }

    /* Pannello ricerca sotto header: stesso pill del desktop */
    .sgh-mobile-search-dropdown {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 1002;
        background: #fff;
        border-bottom: 1px solid var(--sgh-border);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition:
            max-height .32s cubic-bezier(.4, 0, .2, 1),
            opacity .22s ease,
            visibility 0s linear .32s;
    }

    .sgh-mobile-search-dropdown.is-open {
        max-height: min(420px, 85vh);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
            max-height .36s cubic-bezier(.4, 0, .2, 1),
            opacity .22s ease .04s,
            visibility 0s linear 0s;
    }

    .sgh-mobile-search-dropdown:not(.is-open) {
        pointer-events: none;
    }

    .sgh-mobile-search-dropdown__inner {
        padding: 12px 16px 16px;
    }

    .sgh-mobile-search-dropdown .sgh-search-inline {
        display: flex !important;
        width: 100%;
    }

    .sgh-mobile-search-dropdown .sgh-search-inline__field {
        width: 100%;
        max-width: none;
    }

    .sgh-mobile-search-tags {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid var(--sgh-border);
    }

    .sgh-mobile-search-tags__heading {
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--sgh-text-muted);
        margin-bottom: 8px;
    }

    .sgh-mobile-search-tags__heading--spaced {
        margin-top: 14px;
    }

    .sgh-mobile-search-tags__empty {
        font-size: 13px;
        color: var(--sgh-text-muted);
        margin-bottom: 0;
    }

    .sgh-mobile-search-dropdown .sgh-search-tags--mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sgh-mobile-search-dropdown .sgh-search-tag {
        display: inline-flex;
        align-items: center;
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 600;
        color: var(--sgh-text);
        text-decoration: none;
        border: 1px solid var(--sgh-border);
        border-radius: 999px;
        background: #2376aa33;
        transition: background var(--sgh-transition), border-color var(--sgh-transition);
    }

    .sgh-mobile-search-dropdown .sgh-search-tag:hover {
        background: #2376aa55;
        border-color: #2376aa88;
    }

    /* Overlay sotto l’header: blur + scurito (ricerca mobile aperta) */
    .sgh-mobile-search-backdrop {
        position: fixed;
        inset: 0;
        z-index: 998;
        background: rgba(15, 15, 15, 0.45);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .28s ease, visibility .28s ease;
    }

    .sgh-mobile-search-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

@media (min-width: 782px) {
    .sgh-action--header-search {
        display: none !important;
    }

    .sgh-mobile-search-dropdown {
        display: none !important;
    }

    .sgh-mobile-search-backdrop {
        display: none !important;
    }

    .sgh-action--hamburger {
        display: none;
    }

    /* Colonna centrale: menu o tag (ricerca attiva) */
    .sgh-nav {
        flex: 1;
        min-width: 0;
        justify-content: flex-start;
        gap: 0;
    }

    /* Ricerca attiva: nascondi voci menu, mostra tag nello stesso spazio */
    .sgh-header--search-expanded .sgh-menu {
        display: none !important;
    }

    .sgh-search-panel {
        position: relative;
        flex: 1;
        min-width: 0;
        align-items: center;
        padding: 0 8px 0 0;
    }

    .sgh-search-panel[hidden] {
        display: none !important;
    }

    .sgh-search-panel:not([hidden]) {
        display: flex;
    }

    .sgh-header--search-expanded .sgh-search-inline__field {
        width: 520px;
        max-width: min(520px, 46vw);
    }

    .sgh-search-panel__close {
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        border: none;
        background: transparent;
        font-size: 1.25rem;
        line-height: 1;
        cursor: pointer;
        color: var(--sgh-text-muted);
        border-radius: 8px;
        transition: background var(--sgh-transition), color var(--sgh-transition);
    }

    .sgh-search-panel__close:hover {
        background: var(--sgh-hover-bg);
        color: var(--sgh-text);
    }

    .sgh-search-panel__cols {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 24px;
        align-items: start;
        width: 100%;
        padding-right: 32px;
    }

    .sgh-search-panel__heading {
        font-size: 11px;
        font-weight: 800;
        color: var(--sgh-text-muted);
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-bottom: 6px;
    }

    .sgh-search-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .sgh-search-tag {
        display: inline-flex;
        align-items: center;
        padding: 4px 10px;
        font-size: 12px;
        font-weight: 600;
        color: var(--sgh-text);
        text-decoration: none;
        border: 1px solid var(--sgh-border);
        border-radius: 999px;
        background: #2376aa33;
        transition: background var(--sgh-transition), border-color var(--sgh-transition);
    }

    .sgh-search-tag:hover {
        background: #2376aa55;
        border-color: #2376aa88;
    }

    .sgh-search-panel__empty {
        font-size: 12px;
        color: var(--sgh-text-muted);
    }
}

/* ── Prevent body scroll when drawer is open ──────────────── */
body.sgh-drawer-open {
    overflow: hidden;
}
