/*
 * Header responsive fixes.
 *
 * Every header template switches to its desktop layout at Bootstrap's lg
 * breakpoint (992px), where the mobile bottom menu is also hidden, but the
 * desktop rows need 1200-1500px. On tablet landscape and small laptops icons
 * and links were pushed off-screen. Each block below is scoped to one template
 * through its .hdr-style-* hook class; where a row cannot fit, its menu moves
 * to a second row instead of overflowing.
 */

/* ---------- Style 1 header (style-one) ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hdr-style-one .top-bar .top-address span {
        white-space: nowrap;
    }

    .hdr-style-one .top-bar .top-address > div:first-child {
        display: none !important;
    }

    .hdr-style-one .navbar-nav {
        padding-left: 1rem !important;
    }

    .hdr-style-one .navbar-nav .nav-link {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
        margin-right: 0 !important;
        font-size: 15px;
    }

    .hdr-style-one .header-btn {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        margin-top: 0 !important;
    }

    .hdr-style-one .header-btn .btn-1 {
        white-space: nowrap;
        padding: 0.5rem 0.75rem !important;
    }
}

/* ---------- Style 2 header (style-two) ---------- */
@media (min-width: 992px) and (max-width: 1399.98px) {
    /* Menu drops to its own row under category, logo and icons. */
    .hdr-style-two .navbar-two {
        height: auto !important;
    }

    .hdr-style-two .navbar-two > div > .main-navbar {
        flex-wrap: wrap;
        row-gap: 0.5rem !important;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .hdr-style-two .main-navbar > .nav-menu {
        order: 3;
        width: 100%;
        height: 52px;
        line-height: 52px;
        gap: 1.5rem !important;
        border-top: 1px solid var(--border-color, #e5e7eb);
    }

    .hdr-style-two .main-navbar > .nav-logo {
        margin-left: auto !important;
    }
}

/* ---------- Style 4 header (style-five) ---------- */
@media (min-width: 1200px) {
    /* Categories button + 220px logo did not fit the col-xl-3 / col-xxl-2
       slot, so the menu links were drawn on top of the logo. */
    .hdr-style-five .bottom-navbar .row > div:first-child {
        flex: 0 0 auto;
        width: auto;
    }

    .hdr-style-five .bottom-navbar .row > .gr-menu {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .hdr-style-five .bottom-navbar .logo img {
        width: auto !important;
        height: 56px !important;
    }

    .hdr-style-five .bottom-navbar .navbar-nav .nav-link {
        white-space: nowrap;
    }
}

@media (min-width: 1200px) and (max-width: 1799.98px) {
    /* Logo, menu, search and account need ~1800px on one row;
       below that the menu drops to its own row. */
    .hdr-style-five .bottom-navbar .row {
        row-gap: 0.75rem;
    }

    .hdr-style-five .bottom-navbar .row > .gr-menu {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
    }

    .hdr-style-five .bottom-navbar .row > div:not(:first-child):not(.gr-menu) {
        flex: 1 1 0;
        width: auto;
    }
}

/* ---------- Style 6 header (style-seven) ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* The logo is 220px wide but its col-lg-2 slot is ~140px; it ran under the search bar. */
    .hdr-style-seven .main-navbar .logo img {
        width: auto;
        max-width: 100%;
        height: auto;
    }
}

/* "More" and its chevron wrapped onto two lines. */
.hdr-style-seven .navbar-nav .nav-link {
    white-space: nowrap;
}

/* ---------- Style 7 header (style-eight) ---------- */
@media (min-width: 992px) {
    /* Top bar: the right-hand links wrapped and spilled above the 40px bar. */
    .hdr-style-eight .hdr-topbar-start {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap !important;
    }

    .hdr-style-eight .hdr-topbar-start .notice-slider {
        flex: 1 1 auto;
        min-width: 0;
    }

    .hdr-style-eight .hdr-topbar-start > .dropdown {
        flex-shrink: 0;
    }

    .hdr-style-eight .hdr-topbar-end {
        flex-shrink: 0;
        flex-wrap: nowrap !important;
        white-space: nowrap;
    }

    /* The search box collapsed to a stub next to the menu. */
    .hdr-style-eight > nav .search-box {
        flex: 0 0 260px;
    }
}

@media (min-width: 992px) and (max-width: 1499.98px) {
    /* Search only had a width from xl up; menu drops to a second row. */
    .hdr-style-eight > nav > div {
        flex-wrap: wrap;
        row-gap: 0.5rem !important;
    }

    .hdr-style-eight .hdr-main-menu {
        order: 3;
        width: 100%;
        margin-left: 0 !important;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-gray-200, #e5e7eb);
    }

    .hdr-style-eight > nav .search-box {
        flex-basis: 360px;
        margin-left: auto;
    }
}

/* ---------- Style 8 header (style-nine) ---------- */
@media (min-width: 992px) {
    /* The icon group wrapped and spilled below the 60px bar. */
    .hdr-style-nine #headerSticky > div > nav > div:nth-child(3) {
        flex-shrink: 0;
        flex-wrap: nowrap !important;
    }

    /* Logo was taller than the 60px bar and clipped at the top. */
    .hdr-style-nine #headerSticky > div > nav > div:first-child img {
        width: auto !important;
        height: 48px !important;
    }
}

/* Needs ~1600px for logo + menu + icons on one row. */
@media (min-width: 992px) and (max-width: 1599.98px) {
    /* Menu drops to its own row under the logo and icons. */
    .hdr-style-nine #headerSticky {
        height: auto !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0 !important;
    }

    .hdr-style-nine #headerSticky > div > nav {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .hdr-style-nine #headerSticky > div > nav > ul {
        order: 3;
        width: 100%;
        height: 52px !important;
        gap: 1.25rem !important;
        border-top: 1px solid var(--color-gray-200, #e5e7eb);
    }
}

/* ---------- Style 9 header (style-ten) ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* The search input collapsed to ~30px inside its 65% wrapper. */
    .hdr-style-ten .fsbd-search-wrapper {
        width: 100% !important;
    }

    .hdr-style-ten .hdr-location {
        display: none !important;
    }
}

/* ---------- Style 11 header (style-twelve) ---------- */
@media (max-width: 991.98px) {
    /* Transparent fixed bar sat on top of the hero on phones and tablets. */
    .hdr-style-twelve:not(.sticky-header) {
        position: relative !important;
        background-color: var(--bg-white, #fff);
        border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
    }
}

@media (min-width: 992px) {
    /* Logo rendered taller than the 60px bar and was cut off at the top. */
    .hdr-style-twelve .hdr-bar .logo {
        width: auto !important;
        height: 48px !important;
    }

    /* The 50% wrapper squeezed the icons into a vertical column. */
    .hdr-style-twelve .hdr-nav-end {
        width: auto !important;
        flex: 1 1 auto;
        justify-content: flex-end !important;
        gap: 1.5rem;
    }

    .hdr-style-twelve .hdr-nav-end > div {
        flex-shrink: 0;
        flex-wrap: nowrap !important;
    }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
    /* Menu drops to its own row under logo, categories and icons. */
    .hdr-style-twelve .hdr-bar {
        height: auto !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0 !important;
    }

    .hdr-style-twelve .hdr-bar nav {
        flex-wrap: wrap;
        row-gap: 0 !important;
    }

    .hdr-style-twelve .hdr-nav-end {
        display: contents !important;
    }

    .hdr-style-twelve .hdr-main-menu {
        order: 3;
        width: 100%;
        height: 48px !important;
    }
}

/* ---------- Style 12 header (style-fourteen) ---------- */
@media (min-width: 992px) {
    /* 48px margins on both sides left the search input ~120px wide. */
    .hdr-style-fourteen .hdr-search {
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
        min-width: 0;
    }

    .hdr-style-fourteen > div:first-child a {
        white-space: nowrap;
    }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
    .hdr-style-fourteen .hdr-search .fsbd-search-btn-text {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Wishlist, Bag and the Offers button ran past the right edge. */
    .hdr-style-fourteen .hdr-btn-label,
    .hdr-style-fourteen .hdr-notice,
    .hdr-style-fourteen .hdr-search .fsbd-search-category {
        display: none !important;
    }

    .hdr-style-fourteen .hdr-search {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }

    .hdr-style-fourteen > nav ul > li > a {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }
}
