/* Smartphone Italia — mobile menu + Apple homepage overflow (20260704-menu-subcat) */

/* ── A. Hide desktop menu bar on mobile; keep drawer content visible ── */
@media (max-width: 991px) {
    /* Empty shell + horizontal desktop bar (ps_mainmenu lives in #tvcmsdesktop-main-menu) */
    #tvcmsdesktop-main-menu,
    .tvcms-header-menu-offer-wrapper .tvcmsmain-menu-wrapper.container,
    #tvdesktop-megamenu,
    .container_tv_megamenu,
    .tvcms-header-menu .container .tvcmsmain-menu-wrapper {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Do NOT hide #tv-top-menu globally — custom.js moves it into #tvmobile-megamenu */

    #tvcms-mobile-view-header,
    #tvcms-mobile-view-header.hidden-lg-up {
        display: block !important;
        visibility: visible !important;
    }

    /* Menu shell stays in DOM for drawer portal; hamburger toggle hidden (bottom nav) */
    .tvcmsmobile-header-menu {
        width: 0 !important;
        min-width: 0 !important;
        flex: 0 0 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .tvmobile-sliderbar-btn,
    .tvmobile-sliderbar-btn a {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    #tvcms-mobile-view-header .tvcmsmobile-cart-acount-text,
    #tvcms-mobile-view-header #tvmobile-cart,
    #tvcms-mobile-view-header #tvcmsmobile-account-button {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvcmsmobile-header-menu-offer-text {
        justify-content: center !important;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvcmsmobile-header-logo-right-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center;
    }

    .tvcmsmobile-header-menu .tvmobile-slidebar {
        visibility: visible !important;
    }

    /* Menu inside mobile drawer (after showView moves ps_mainmenu HTML) */
    #tvmobile-megamenu,
    #tvmobile-megamenu .tvcmsmain-menu-wrapper,
    #tvmobile-megamenu .tv-header-menu,
    #tvmobile-megamenu #tv-top-menu,
    #tvmobile-megamenu .tvmain-menu-wrapper {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    #tvmobile-megamenu #tv-top-menu > li {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    #tvmobile-megamenu .tvmenu-button-wrapper {
        display: none !important;
    }

    /* Drawer layout — menu scrollable, phone contact at bottom (not sole content) */
    body > .tvmobile-slidebar,
    #tvcms-mobile-view-header .tvmobile-slidebar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu {
        flex: 1 1 auto !important;
        min-height: 180px !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    body > .tvmobile-slidebar .tvcmsmobile-contact,
    #tvcms-mobile-view-header .tvmobile-slidebar .tvcmsmobile-contact {
        order: 99;
        flex-shrink: 0;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
        font-size: 0.875rem;
    }

    body > .tvmobile-slidebar .tvcmsmobile-contact a,
    #tvcms-mobile-view-header .tvmobile-slidebar .tvcmsmobile-contact a {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        color: var(--si-text-secondary, #6e6e73);
        text-decoration: none;
    }

    /* Fallback empty cart inside drawer */
    .si-cart-empty-msg {
        margin: 24px 16px 8px;
        text-align: center;
        color: var(--si-text-secondary, #6e6e73);
        font-size: 0.9375rem;
    }

    .si-cart-empty-link {
        display: block;
        margin: 0 16px 24px;
        padding: 12px 16px;
        text-align: center;
        background: var(--si-accent, #39b54a);
        color: #fff !important;
        border-radius: var(--si-radius-pill, 980px);
        text-decoration: none;
        font-weight: 600;
        min-height: 44px;
        line-height: 20px;
    }
}

/* ── B. Homepage overflow — Apple layout ── */
@media (max-width: 991px) {
    html,
    body#index {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    body#index .tv-main-div,
    body#index #wrapper,
    body#index #content-wrapper,
    body#index #content-wrapper.col-xl-12,
    body#index .container.tv-full-layout,
    body#index .container.tv-full-layout > .row,
    body#index .si-b2b-home,
    body#index .si-b2b-hero,
    body#index .si-b2b-trust,
    body#index .si-b2b-categories {
        box-sizing: border-box;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    body#index .si-b2b-home .container,
    body#index #content-wrapper .si-b2b-home .container,
    body#index #wrapper > .si-b2b-home .container,
    body#index .si-b2b-hero .container,
    body#index .si-b2b-trust .container,
    body#index .si-b2b-categories .container,
    body#index .si-b2b-steps .container,
    body#index .si-b2b-brands .container,
    body#index .si-b2b-faq .container,
    body#index .si-b2b-contact .container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    body#index .si-b2b-steps,
    body#index .si-b2b-brands,
    body#index .si-b2b-faq,
    body#index .si-b2b-contact {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    body#index .si-b2b-steps__grid,
    body#index .si-b2b-brands__grid,
    body#index .si-b2b-faq__grid,
    body#index .si-b2b-contact__panel {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body#index .si-b2b-hero__layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body#index .si-b2b-hero__main,
    body#index .si-b2b-hero__card {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    body#index .si-b2b-hero__card {
        min-height: 0 !important;
        padding: 24px 20px !important;
    }

    body#index .si-b2b-hero h1,
    body#index .si-b2b-hero-mobile__title {
        max-width: 100% !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    body#index .si-b2b-hero__text {
        max-width: 100% !important;
    }

    body#index .si-b2b-hero__actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        max-width: 100% !important;
    }

    body#index .si-b2b-hero__cta,
    body#index .si-b2b-hero__card-link {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    body#index .si-b2b-trust__list {
        margin-top: 0 !important;
        max-width: 100% !important;
    }

    body#index .si-b2b-categories__grid {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body#index .si-b2b-categories__card {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body#index .si-b2b-categories__icon,
    body#index .si-b2b-categories__label,
    body#index .si-b2b-categories__hint {
        max-width: 100% !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    body#index .si-b2b-categories__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 767px) and (min-width: 431px) {
    body#index .si-b2b-categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    body#index .si-b2b-hero h1,
    body#index .si-b2b-hero-mobile__title {
        font-size: clamp(1.375rem, 6vw, 1.875rem) !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 767px) {
    body#index .si-b2b-hero h1,
    body#index .si-b2b-hero-mobile__title {
        font-size: 28px !important;
        line-height: 1.15 !important;
    }
}

@media (max-width: 430px) {
    body#index .si-b2b-hero h1,
    body#index .si-b2b-hero-mobile__title {
        font-size: 28px !important;
        line-height: 1.15 !important;
    }

    body#index .si-b2b-trust__list {
        gap: 10px !important;
    }

    body#index .si-b2b-categories__grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body#index .si-b2b-categories__card {
        min-height: 150px !important;
        padding: 20px 18px !important;
    }
}

/* ── C. Mobile header clip fix — cart + hamburger drawer (20260704-header-clip) ── */
@media (max-width: 991px) {
    #header,
    #header .header-top,
    .tvheader-mobile-layout,
    #tvcms-mobile-view-header,
    #tvcms-mobile-view-header .tvcmsmobile-top-wrapper,
    #tvcms-mobile-view-header .tvcmsmobile-header-menu-offer-text,
    #tvcms-mobile-view-header .tvcmsmobile-header-menu,
    #tvcms-mobile-view-header .tvcmsmobile-cart-acount-text,
    #tvcms-mobile-view-header .tvcmsmobile-header-logo-right-wrapper,
    #tvcms-mobile-view-header #tvmobile-cart,
    #tvcms-mobile-view-header .blockcart,
    #tvcms-mobile-view-header .tvheader-cart-wrapper,
    #tvcms-mobile-view-header .tvcms-header-cart {
        overflow: visible !important;
    }

    /* Bootstrap col-* on header row squeezes/clips right-side icons */
    #tvcms-mobile-view-header.mobile-header-1 .tvcmsmobile-header-menu-offer-text > [class*="col-"] {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvcmsmobile-header-menu-offer-text {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: max(8px, env(safe-area-inset-left, 0px));
        padding-right: max(8px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
        overflow: visible !important;
    }

    /* Top-row icons hidden — see si-header.css / si-bottom-nav.css */

    #tvcms-mobile-view-header #tvcmsmobile-account-button .tv-myaccount-btn {
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
    }

    /* Prevent sticky transform from trapping position:fixed overlays */
    #tvcms-mobile-view-header .tvcmsheader-sticky.sticky {
        transform: none !important;
        -webkit-transform: none !important;
    }

    /* Body scroll lock — menu + cart */
    body.si-overlay-open,
    body.tv-menu-open,
    body.mobile-menu-open,
    body.classicCartOpen {
        overflow: hidden !important;
        touch-action: none;
    }
}

/* ── D. Mobile overlay portal — menu + cart above bottom nav (20260704-drawer-above-nav) ── */
@media (max-width: 991px) {
    /* backdrop-filter on #header traps position:fixed children — disable on mobile */
    #header,
    #header .header-top,
    #tvcms-mobile-view-header,
    .tvcmsmobile-header-wrapper,
    .tvcmsmobile-header-menu-offer-text,
    .tvcmsmobile-header-menu-offer-text.tvcmsheader-sticky,
    .tvcmsmobile-header-menu-offer-text.tvcmsheader-sticky.sticky {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        -webkit-transform: none !important;
        filter: none !important;
        isolation: auto !important;
    }

    #header,
    #tvcms-mobile-view-header,
    .tv-main-div > header {
        overflow: visible !important;
    }

    /* Dark backdrop behind drawer/cart — ends above bottom nav (bar stays tappable) */
    .si-mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px)));
        width: 100%;
        z-index: 99991;
        background: rgba(0, 0, 0, 0.5);
        pointer-events: none;
        -webkit-tap-highlight-color: transparent;
    }

    .si-mobile-overlay.active {
        display: block;
        pointer-events: auto;
    }

    /* ThemeVolty legacy backdrop must not steal taps from bottom nav when idle */
    body:not(.mobile-menu-open):not(.classicCartOpen):not(.footerCartOpen):not(.si-overlay-open):not(.dropdown-open) .full-wrapper-backdrop {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Menu drawer — direct child of body after JS portal; stops above bottom nav */
    body > .tvmobile-slidebar,
    #tvcms-mobile-view-header .tvmobile-slidebar {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -320px;
        bottom: var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px))) !important;
        width: min(320px, 85vw) !important;
        min-width: 260px;
        max-width: 85vw !important;
        height: calc(100dvh - var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px)))) !important;
        max-height: calc(100dvh - var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px)))) !important;
        margin: 0 !important;
        z-index: 99992 !important;
        transform: none !important;
        -webkit-transform: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
        padding-top: max(15px, env(safe-area-inset-top, 0px));
        padding-bottom: 15px;
        padding-left: max(15px, env(safe-area-inset-left, 0px));
        padding-right: max(15px, env(safe-area-inset-right, 0px));
    }

    body > .tvmobile-slidebar.open,
    #tvcms-mobile-view-header .tvmobile-slidebar.open {
        left: auto !important;
        right: 0 !important;
        visibility: visible !important;
    }

    /* Cart panel — direct child of body after JS portal; stops above bottom nav */
    body > .ttvcmscart-show-dropdown-right,
    body.classicCartOpen > .ttvcmscart-show-dropdown-right {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -100% !important;
        bottom: var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px))) !important;
        width: min(320px, 85vw) !important;
        max-width: 85vw !important;
        height: calc(100dvh - var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px)))) !important;
        max-height: calc(100dvh - var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px)))) !important;
        margin: 0 !important;
        z-index: 99992 !important;
        transform: none !important;
        -webkit-transform: none !important;
        overflow: hidden !important;
        box-sizing: border-box;
        padding-top: env(safe-area-inset-top, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        padding-bottom: 0;
    }

    body.classicCartOpen > .ttvcmscart-show-dropdown-right {
        right: 0 !important;
        visibility: visible !important;
    }

    body > .modal-backdrop-cart,
    body.classicCartOpen > .modal-backdrop-cart {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: var(--si-bottom-nav-offset, calc(var(--si-bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px))) !important;
        z-index: 99991 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        pointer-events: auto !important;
    }

    /* Keep page content below overlay layers (menu + cart) */
    body.si-overlay-open .tv-main-div,
    body.si-overlay-open #wrapper,
    body.si-overlay-open #content-wrapper,
    body.si-overlay-open #content,
    body.si-overlay-open #main,
    body.si-overlay-open main,
    body.si-overlay-open .si-b2b-home,
    body.classicCartOpen .tv-main-div,
    body.classicCartOpen #wrapper,
    body.classicCartOpen #content-wrapper,
    body.classicCartOpen #content,
    body.classicCartOpen #main,
    body.classicCartOpen main,
    body.classicCartOpen .si-b2b-home,
    body#index.classicCartOpen .si-b2b-hero,
    body#index.classicCartOpen .si-b2b-trust,
    body#index.classicCartOpen .si-b2b-categories,
    body#index.classicCartOpen .si-b2b-steps,
    body#index.classicCartOpen .si-b2b-brands,
    body#index.classicCartOpen .si-b2b-faq,
    body#index.classicCartOpen .si-b2b-contact {
        z-index: auto !important;
        isolation: auto !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    body.si-overlay-open #header,
    body.si-overlay-open #tvcms-mobile-view-header {
        z-index: 1000 !important;
    }

    /* Override ThemeVolty custom.css left-slide drawer (left:-300px conflicts with right drawer) */
    .tvmobile-slidebar,
    body > .tvmobile-slidebar,
    #tvcms-mobile-view-header .tvmobile-slidebar {
        left: auto !important;
        right: -100% !important;
        visibility: hidden;
        transform: none !important;
        -webkit-transform: none !important;
        transition: right 0.3s ease, visibility 0.3s ease !important;
    }

    .tvmobile-slidebar.open,
    body > .tvmobile-slidebar.open,
    #tvcms-mobile-view-header .tvmobile-slidebar.open {
        left: auto !important;
        right: 0 !important;
        visibility: visible !important;
    }

    /* Cart panel: support both body.classicCartOpen and .open on panel */
    body > .ttvcmscart-show-dropdown-right.open,
    body.classicCartOpen > .ttvcmscart-show-dropdown-right,
    .ttvcmscart-show-dropdown-right.open {
        right: 0 !important;
        visibility: visible !important;
    }

    /* si-header.css re-applies backdrop-filter — must win for fixed overlays */
    #tvcms-mobile-view-header,
    #tvcms-mobile-view-header .tvcmsmobile-header-menu-offer-text,
    #tvcms-mobile-view-header .tvcmsmobile-header-menu-offer-text.tvcmsheader-sticky,
    #tvcms-mobile-view-header .tvcmsmobile-header-menu-offer-text.tvcmsheader-sticky.sticky,
    .tvcmsmobile-header-wrapper {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        isolation: auto !important;
    }
}

/* ── E. Right-thumb close — modals + search overlay (20260704-close-right) ── */
@media (max-width: 991px) {
    .modal.show .modal-header .close,
    .modal.show .tvmodel-close,
    .modal.show button.close[data-dismiss="modal"],
    #blockcart-modal.show .tv-addtocart-close,
    .quickview.modal.show .tvmodel-close {
        position: fixed !important;
        top: max(8px, env(safe-area-inset-top, 0px)) !important;
        right: max(14px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        margin: 0 !important;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        opacity: 1 !important;
        z-index: 100005;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
        border: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s ease, color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .modal.show .modal-header .close span,
    .modal.show .tvmodel-close span,
    .modal.show button.close[data-dismiss="modal"] span,
    #blockcart-modal.show .tv-addtocart-close span {
        color: var(--si-text, #1d1d1f) !important;
        text-shadow: none;
        font-size: 28px;
        font-weight: 300;
        line-height: 1;
        opacity: 1;
    }

    .modal.show .modal-header .close:active,
    .modal.show .tvmodel-close:active,
    .modal.show button.close[data-dismiss="modal"]:active,
    #blockcart-modal.show .tv-addtocart-close:active {
        background: rgba(57, 181, 74, 0.08);
    }

    .modal.show .modal-header .close:active span,
    .modal.show .tvmodel-close:active span,
    .modal.show button.close[data-dismiss="modal"]:active span,
    #blockcart-modal.show .tv-addtocart-close:active span {
        color: var(--si-accent, #39b54a) !important;
    }
}

/* ── F. Mobile search inline expand (20260706-pre-overlay-rollback) ── */
@media (max-width: 991px) {
    /* Legacy custom.js adds #wrapper.visible on input focus — blocks page after close */
    #wrapper.visible::after {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Overlay legacy — never show on mobile after rollback */
    .si-search-backdrop {
        display: none !important;
        pointer-events: none !important;
    }

    #tvcms-mobile-view-header .si-search-close-mobile {
        display: none !important;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper {
        position: relative;
        z-index: 10050;
    }

    /* Open form = same pill as collapsed trigger (.tvheader-search-display-icon) */
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open form {
        display: flex !important;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
        border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
        border-radius: var(--si-radius-pill, 980px);
        overflow: hidden;
        background: var(--si-bg-alt, #f5f5f7);
        margin: 0;
        padding: 0 16px;
        transition: border-color var(--si-transition, 0.3s ease), background var(--si-transition, 0.3s ease);
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open form:focus-within {
        border-color: var(--si-accent, #39b54a);
        box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.12);
        background: #fff;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvheader-top-search {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvcmssearch-words,
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open #si-header-search-input {
        width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        line-height: 1.3 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        color: #1d1d1f !important;
        -webkit-text-fill-color: #1d1d1f !important;
        caret-color: #39b54a;
        font-family: var(--si-font, Inter, system-ui, sans-serif) !important;
        font-size: 1rem !important;
        font-weight: 400 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        pointer-events: auto !important;
        -webkit-user-select: text !important;
        user-select: text !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        clip: auto !important;
        overflow: visible !important;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvcmssearch-words:focus,
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open #si-header-search-input:focus {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        outline: none !important;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvcmssearch-words::placeholder,
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open #si-header-search-input::placeholder {
        color: var(--si-text-secondary, #6e6e73) !important;
        opacity: 1 !important;
        -webkit-text-fill-color: var(--si-text-secondary, #6e6e73) !important;
    }

    /* Submit lens — same gray icon as trigger, not green block */
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvheader-top-search-wrapper {
        order: -1;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        background: transparent !important;
        margin: 0;
        padding: 0;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvheader-search-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        width: 20px;
        min-height: 20px;
        height: 20px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvheader-search-btn .si-search-btn-icon {
        font-family: 'Material Icons';
        font-size: 20px;
        line-height: 1;
        color: var(--si-text-secondary, #6e6e73);
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open form:focus-within .tvheader-search-btn .si-search-btn-icon {
        color: var(--si-text-secondary, #6e6e73);
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper.open .tvserach-name {
        display: none;
    }

    /* Empty results shell — no white box until AJAX injects content */
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper .tvsearch-result:empty {
        display: none !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    /* Results dropdown — anchored under bar in header */
    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper .tvsearch-result:not(:empty) {
        display: block;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        z-index: 10051;
        max-height: min(420px, calc(100dvh - 220px - var(--si-bottom-nav-offset, 56px)));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        border: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
        border-radius: var(--si-radius, 18px);
        background: #fff;
        box-shadow: var(--si-shadow-hover, 0 8px 28px rgba(0, 0, 0, 0.12));
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper .tvsearch-result .tvcmssearch-dropdown {
        max-height: min(380px, calc(100dvh - 260px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #tvcms-mobile-view-header.mobile-header-1 .tvsearch-header-display-wrappper .tvsearch-result .tvsearch-dropdown-wrapper a {
        color: #1d1d1f;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        text-decoration: none;
        pointer-events: auto;
    }

    /* Legacy ThemeVolty close selectors */
    #tvcms-mobile-view-header .tvsearch-top-wrapper.tvsearch-open .tvsearch-close,
    #tvcms-mobile-view-header .tvcmsmobile-header-search .tvsearch-top-wrapper.open .tvsearch-close {
        display: none !important;
    }
}

/* ── G. Mobile drawer — accordion submenus (20260704-menu-subcat) ── */
@media (max-width: 991px) {
    body > .tvmobile-slidebar #tvmobile-megamenu #tv-top-menu > li.tv-has-child,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu #tv-top-menu > li.tv-has-child {
        border-bottom: 1px solid var(--si-line, rgba(0, 0, 0, 0.08));
    }

    body > .tvmobile-slidebar #tvmobile-megamenu #tv-top-menu li.tv-has-child > .tvmenu-link-wrapper,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu #tv-top-menu li.tv-has-child > .tvmenu-link-wrapper {
        position: relative;
        width: 100%;
        padding-right: 44px;
        box-sizing: border-box;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu .tvmenu-toggle-icon,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu .tvmenu-toggle-icon {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 2;
        -webkit-tap-highlight-color: transparent;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu .tvmenu-toggle-icon i,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu .tvmenu-toggle-icon i {
        transition: transform 0.2s ease;
        color: var(--si-text-secondary, #6e6e73);
    }

    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmenu-link-wrapper .tvmenu-toggle-icon i,
    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmenu-link-wrapper .tvmenu-toggle-icon i,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmenu-link-wrapper .tvmenu-toggle-icon i,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmenu-link-wrapper .tvmenu-toggle-icon i {
        transform: rotate(180deg);
        color: var(--si-accent, #39b54a);
    }

    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child > .tvmain-menu-dropdown,
    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child > .tvmain-menu-mobile-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child > .tvmain-menu-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child > .tvmain-menu-mobile-dropdown {
        display: none !important;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0 !important;
        margin: 0;
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmain-menu-dropdown,
    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmain-menu-mobile-dropdown,
    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmain-menu-dropdown,
    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmain-menu-mobile-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmain-menu-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmain-menu-mobile-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmain-menu-dropdown,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.sub-menu-open > .tvmain-menu-mobile-dropdown {
        display: block !important;
        max-height: 2000px;
        overflow: visible !important;
        opacity: 1;
        padding: 0 0 12px 0 !important;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="1"],
    body > .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="2"],
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="1"],
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="2"] {
        padding-left: 16px;
        margin: 0;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="1"] > li > .tvmenu-link-wrapper,
    body > .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="2"] > li > .tvmenu-link-wrapper,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="1"] > li > .tvmenu-link-wrapper,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu ul[data-depth="2"] > li > .tvmenu-link-wrapper {
        min-height: 44px;
        padding: 4px 44px 4px 0;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu .tvdropdown-submenu .tvmain-menu-text-box,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu .tvdropdown-submenu .tvmain-menu-text-box {
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--si-text-secondary, #6e6e73) !important;
    }

    body > .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmenu-link-wrapper .tvmain-menu-text-box,
    #tvcms-mobile-view-header .tvmobile-slidebar #tvmobile-megamenu li.tv-has-child.open > .tvmenu-link-wrapper .tvmain-menu-text-box {
        color: var(--si-accent, #39b54a) !important;
    }
}
