/**
 * Sticky main navigation bar (#header in Magento_Theme/templates/html/header.phtml).
 *
 * The bar scrolls away with the page as usual. Once it is completely out of view, the script
 * in header.phtml adds .is-sticky: the bar becomes fixed and slides in from the top. A spacer
 * keeps its place in the flow, so the content does not jump.
 *
 * Plain CSS on purpose, like nav-drawer.css: works after setup:static-content:deploy without
 * a Tailwind rebuild.
 */

#header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Above page content; the nav drawer, search and cart drawer live inside #header. */
    z-index: 30;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    animation: sticky-header-slide-in .3s ease-out;
}

@keyframes sticky-header-slide-in {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #header.is-sticky {
        animation: none;
    }
}
