@media (min-width: 992px) {
    .pc-menu-sticky {
        transform: translateY(0);
        transition: transform 220ms ease;
        will-change: transform;
    }

    .pc-menu-sticky.mg-smart-header--hidden {
        pointer-events: none;
        transform: translateY(calc(-100% - 2px));
    }

    .pc-menu-sticky.mg-smart-header--visible {
        pointer-events: auto;
        transform: translateY(0);
    }

    .pc-menu-sticky .site-header__search-section {
        position: relative;
        z-index: 21;
        background: #fff;
    }

    body.site-menu-open .pc-menu-sticky,
    body.site-menu-open .pc-menu-sticky.mg-smart-header--visible {
        z-index: 999991;
        transform: none !important;
    }

    /* A viewport-level overlay independent of the header's stacking context. */
    body.site-menu-open::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 999990;
        background: rgba(0, 0, 0, 0.48);
        pointer-events: none;
    }

    /* The body layer replaces the older overlay nested inside the header. */
    body.site-menu-open .pc-menu-sticky .site-menu-overlay {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Keep the category filter attached to whichever edge the smart header
       currently exposes: viewport top while hidden, below the header while visible. */
    body.tax-product_cat .mg-category-catalog-section__filter {
        top: 144px;
        transition: top 220ms ease;
    }

    body.tax-product_cat.mg-smart-header-hidden .mg-category-catalog-section__filter {
        top: 0;
    }

    body.tax-product_cat.mg-smart-header-visible .mg-category-catalog-section__filter {
        top: 144px;
    }

    /* Keep the product gallery next to the header only while it is visible. */
    body.single-product #wooswipe {
        top: 155px;
        transition: top 220ms ease;
    }

    body.single-product.mg-smart-header-hidden #wooswipe {
        top: 8px;
    }

    body.single-product.mg-smart-header-visible #wooswipe {
        top: 155px;
    }
}

@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
    .pc-menu-sticky {
        transition: none;
    }

    body.tax-product_cat .mg-category-catalog-section__filter {
        transition: none;
    }

    body.single-product #wooswipe {
        transition: none;
    }
}
