/*
 * VP-031 — Memarket smart sticky header for the Sahara theme: the states js/mm-smart-header.js
 * sets on the top bar (header#top). Nothing here applies until that script has run.
 */

/* links to a part of the page and fields given focus land below the bar, not under it */
html.mm-hdr-on {
    scroll-padding-top: var(--mm-hdr-h, 0px);
}

/* the bar's place while it is pinned (the script gives it the bar's height) */
.mm-hdr-slot {
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
}

/* pinned to the top of the window, over the page: above the listing gallery's zoom layer (999)
   and the cards' hover layers, below lightboxes (1100+), the phone menu and the site's notices */
header#top.mm-hdr-pinned {
    position: fixed;
    top: 0;
    z-index: 1000;
    transform: none;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 2px 8px rgba(0, 0, 0, .16);
    transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .15s ease-in-out;
}

header#top.mm-hdr-pinned.mm-hdr-hidden {
    transform: translate3d(0, -100%, 0);
    box-shadow: none;
}

header#top.mm-hdr-instant {
    transition: none !important;
}

/* a Bootstrap dialog (backdrop 9, dialog 10) covers the bar, as it does at the top of the page */
body.modal-open header#top.mm-hdr-pinned {
    z-index: 7;
}

/* the phone menu opens over the pinned bar; the theme's inline z-index 9 also left it under the
   listing gallery's zoom layer, which took the taps meant for the menu */
#sidebar5.tuxedo-menu-fixed {
    z-index: 1050 !important;
}

/* the search item of the pinned bar (wider screens; phones have the theme's search button) */
header#top .mm-hdr-search-item {
    display: none;
}

header#top.mm-hdr-pinned .mm-hdr-search-item {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    header#top.mm-hdr-pinned {
        transition: none;
    }
}

@media print {
    header#top.mm-hdr-pinned {
        position: static;
        transform: none;
        box-shadow: none;
        width: auto !important;
    }

    .mm-hdr-slot {
        display: none;
    }
}
