
@media (max-width: 991.98px) {

    /* ------------------------------------------------------------------
       TOP BAR  (header.navbar-default > .container-fluid > .row > .store_nav)
       Row 1:  [menu]   ethniv logo (centred in the free space)   [USD v] [cart]
       Row 2:  the collapse (drawer), forced below via `order`
       ------------------------------------------------------------------ */
    header.navbar-default {
        padding: 0 8px !important;      
    }

    header.navbar-default .store_nav {
        position: relative;
        padding: 0 !important;          
        min-height: 56px;
        align-items: center;
    }

    /* wrapper div that holds the logo link + the toggler */
    header.navbar-default .store_nav > div:first-child {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: center;
        height: 56px;
    }

    header.navbar-default .store_nav > div:first-child .navbar-toggler {
        order: -1;                       /* menu first, logo after it */
        float: none !important;          /* markup has .pull-left */
        margin: 0 4px 0 0;
        padding: 6px;
        border: 0;
        border-radius: 8px;
        box-shadow: none;
    }

    header.navbar-default .store_nav > div:first-child .navbar-toggler:focus {
        box-shadow: none;
        outline: 0;
    }

    /* white hamburger on the orange gradient (Bootstrap's navbar-light icon is dark) */
    header.navbar-default .store_nav .navbar-toggler-icon {
        width: 1.4em;
        height: 1.4em;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.4' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    header.navbar-default .store_nav > div:first-child > a {
        flex: 1;
        text-align: center;
        line-height: 0;
    }

    header.navbar-default .store_nav > div:first-child img {
        height: 28px !important;
        width: auto !important;
    }

    header.navbar-default .usd {
        margin: 0 8px 0 0 !important;
    }

    header.navbar-default #liCartbox {
        margin: 0 10px 0 0;
    }

    header.navbar-default #liCartbox a {
        float: none !important;
        display: inline-flex;
        align-items: center;
        position: relative;
        padding: 6px !important;
        font-size: 0 !important;        /* hides the bare "Cart" text node */
        line-height: 1;
    }

    header.navbar-default #liCartbox a i {
        font-size: 22px;
        margin: 0;
    }

    header.navbar-default #liCartbox a .caret,
    header.navbar-default #liCartbox a .cart-paren {
        display: none;
    }

    header.navbar-default #liCartbox a b {
        font-size: 0 !important;
    }

    header.navbar-default #liCartbox a .cart-count {
        position: absolute;
        top: -2px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 10px;
        background: #fff;
        color: #94190d !important;      /* Theme 3's inline css forces header text white */
        font-size: 11px;
        font-weight: 600;
        line-height: 18px;
        text-align: center;
        box-sizing: border-box;
    }

    /* cart popup: keep it on screen under the cart icon (the box itself is
       styled by css-shop/hdrbasket.css, same as ShopMaster's mini-cart) */
    header.navbar-default #divCartMenu {
        left: auto !important;
        right: 8px !important;
        top: 56px !important;
        width: 250px;
        max-width: calc(100vw - 16px);
    }

    /* ---- the drawer ---- */
        header.navbar-default .store_nav > .navbar-collapse {
            order: 10; /* below the USD/cart, not between them */
            flex: 0 0 calc(100% + 16px); /* edge to edge: header has 8px side padding */
            max-width: none;
            width: calc(100% + 16px);
            margin: 0 -8px;
            background: #e85912;
            justify-content: flex-start !important;
        }

    header.navbar-default .store_nav > .navbar-collapse .navbar-nav {
        flex-wrap: wrap;
        width: 100%;
        margin: 0 !important;
        padding: 0;
    }

    header.navbar-default .store_nav > .navbar-collapse .navbar-nav > li {
        flex: 0 0 100%;
        width: 100%;
    }

    header.navbar-default .store_nav > .navbar-collapse .navbar-nav > li > a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 13px 18px !important;
        font-size: 15px;
        color: #fff;
        text-decoration: none;
        border-top: 1px solid rgba(255, 255, 255, .15);
    }

    header.navbar-default .store_nav > .navbar-collapse .navbar-nav > li > a i {
        width: 22px;
        margin: 0;
        font-size: 18px;
        text-align: center;
    }

    header.navbar-default .store_nav > .navbar-collapse .navbar-nav > li > a:hover,
    header.navbar-default .store_nav > .navbar-collapse .navbar-nav > li > a:active {
        color: #fff;
        background: rgba(138, 70, 3, .9);
    }

    /* ------------------------------------------------------------------
       STORE BAR  (.product_wrp > .store_nav > .container-fluid) - Themes 1 & 2
       Row 1:  store logo                                    [menu]
       Row 2:  search field (always visible)
       Row 3:  departments as an accordion (the collapse), when opened
       ------------------------------------------------------------------ */
    .product_wrp .store_nav .container-fluid {
        padding: 8px 12px;
        align-items: center;
    }

    .product_wrp .store_nav #divThemeStoreLogo {
        flex: 1 1 0;
        min-width: 0;
    }

    .product_wrp .store_nav .navbar-brand {
        max-width: 140px !important;
        margin: 0;
        padding: 0;
    }

    /* Theme 2 wraps the logo in a.navbar-brand; Theme 1 emits a bare img.img-fluid
       (max-width:100%, which let it fill the row at 303px) - cap both the same way. */
    .product_wrp .store_nav .navbar-brand img,
    .product_wrp .store_nav #divThemeStoreLogo img {
        max-height: 44px;
        max-width: 140px;
        width: auto !important;
        padding: 0;
    }

    .product_wrp .store_nav .navbar-toggler {
        float: none !important;          /* Theme 1 has .pull-left on it */
        margin: 0;
        padding: 6px 8px;
        border: 1px solid #e5e9ec;
        border-radius: 8px;
    }

    .product_wrp .store_nav .navbar-toggler:focus {
        box-shadow: none;
    }

    /* search row directly under the logo row */
    .product_wrp .store_nav .search_wrp {
        order: 5;
        flex: 0 0 100%;
        width: 100%;
        max-width: none !important;     /* theme keeps its desktop 450px cap; from ~540px up that let the box
                                           slip beside the logo and menu button instead of taking its own row */
        margin: 8px 0 0;
        padding: 0 !important;          /* theme gives it 10px top/bottom, which offset the button from the input */
    }

    .product_wrp .store_nav .search_wrp input.form-control {
        height: 42px;
        padding-right: 54px;
        border-radius: 8px;
    }

    .product_wrp .store_nav .search_wrp button {
        position: absolute;
        top: 0;
        right: 0;
        width: 48px;
        height: 42px;
        padding: 0;
        border: 1px solid #ced4da;
        border-left: 0;
        border-radius: 0 8px 8px 0;
        background: #f0f0f0;
    }

    .product_wrp .store_nav .search_wrp button i {
        font-size: 22px;
        line-height: 1;
    }

    /* departments collapse -> accordion card */
    .product_wrp .store_nav #navbarSupportedContent {
        order: 6;
        flex: 0 0 100%;
        margin-top: 8px;
        background: #fff;
        border: 1px solid #e5e9ec;
        border-radius: 8px;
        overflow: hidden;
        justify-content: flex-start !important;
    }

    .product_wrp .store_nav #navbarSupportedContent .navbar-nav {
        width: 100%;
        margin: 0 !important;
        padding: 0;
    }

    .product_wrp .store_nav #navbarSupportedContent .nav-item:empty {
        display: none;                   /* the first <li> is empty */
    }

    .product_wrp .store_nav #navbarSupportedContent .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px !important;
        font-size: 14px !important;
        font-weight: 600;
        line-height: 1.3 !important;
        color: #e85912;
        border-top: 1px solid #e5e9ec;
    }

    .product_wrp .store_nav #navbarSupportedContent .nav-item:empty + .nav-item .nav-link,
    .product_wrp .store_nav #navbarSupportedContent .nav-item:first-child .nav-link {
        border-top: 0;
    }

    .product_wrp .store_nav #navbarSupportedContent .nav-link.active {
        color: #e85912;
    }

    .product_wrp .store_nav #navbarSupportedContent .dropdown-toggle::after {
        margin-left: auto;
    }

    .product_wrp .store_nav #navbarSupportedContent .dropdown-menu {
        position: static !important;
        float: none;
        margin: 0;
        padding: 0 14px 6px;
        border: 0;
        border-radius: 0;
        background: #fafafa;
        box-shadow: none;
    }

    .product_wrp .store_nav #navbarSupportedContent .dropdown-item {
        padding: 9px 0;
        border-top: 1px solid #f1f3f5;
        font-size: 13px !important;
        color: #1f2933;
        background: transparent;
        white-space: normal;
    }

    .product_wrp .store_nav #navbarSupportedContent .dropdown-item:first-child {
        border-top: 0;
    }

    /* search suggestions (GetSearchResult.aspx -> #results): a card under the search row */
    .product_wrp .store_nav #results {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 100%;
        z-index: 1050;
        width: auto !important;
        max-width: none;
        max-height: 60vh;
        overflow: auto;
        padding: 8px 12px;
        background: #fff;
        border: 1px solid #e5e9ec;
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    }

    /* the div is empty (innerHTML "") until a search returns rows - don't paint an empty card */
    .product_wrp .store_nav #results:empty {
        display: none;
    }

    .product_wrp .store_nav #results table {
        width: 100%;
    }

    .product_wrp .store_nav #results td {
        font-size: 13px;
    }

    .product_wrp .store_nav #results b {
        display: block;
        padding: 6px 0 4px;
        font-size: 11px;
        letter-spacing: .4px;
        text-transform: uppercase;
        color: #e85912;
    }

    /* ------------------------------------------------------------------
       THEME 3 (header.store-theme3): its header is the flat blue #287296
       from the CDN css, not the orange gradient, so the drawer, hover and
       badge take a matching blue instead of the #94190d family.
       ------------------------------------------------------------------ */
    header.navbar-default.store-theme3 .store_nav > .navbar-collapse {
        background: #1d5a75;
    }

    header.navbar-default.store-theme3 .store_nav > .navbar-collapse .navbar-nav > li > a:hover,
    header.navbar-default.store-theme3 .store_nav > .navbar-collapse .navbar-nav > li > a:active {
        background: rgba(255, 255, 255, .12);
    }

    header.navbar-default.store-theme3 #liCartbox a .cart-count {
        color: #287296 !important;
    }
}

/* =============================================================================
   TABLETS (768px to 991.98px) - Themes 1 & 2 store bar; footer of all three themes.
   The collapsed navbar rules above apply here too; on top of them:
     - Bootstrap's col-md-* already lay the footer out as four 188px columns
       and the store-hours row as 7 + 1 + 4 columns, which is too tight for
       the long product names.
   Layout only - fonts and colours stay the theme's.
   ============================================================================= */
@media (min-width: 768px) and (max-width: 991.98px) {

    /* row 1: store logo on the left, menu button on the right */
    .product_wrp .store_nav .navbar-brand,
    .product_wrp .store_nav .navbar-brand img,
    .product_wrp .store_nav #divThemeStoreLogo img {
        max-width: 180px !important;
    }

    .product_wrp .store_nav .navbar-brand img,
    .product_wrp .store_nav #divThemeStoreLogo img {
        max-height: 56px;
    }

    /* footer: two columns per row instead of four. The columns are plain
       col-md-3 in Theme 1 and col-md-3.footer-top-col in Themes 2/3, so match
       on the Bootstrap class. */
    footer .footer_top .row > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 18px;
    }

    footer .footer_top .row > .col-md-3:nth-last-child(-n+2) {
        margin-bottom: 0;
    }

    /* store hours (col-md-7) and contact (col-md-4 offset-sm-1) stacked, no offset */
    footer .footer_bottom .row > .col-md-7,
    footer .footer_bottom .row > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0 !important;
    }

    footer .footer_bottom .row > .col-md-7 + .col-md-4 {
        margin-top: 18px;
    }
}

/* =============================================================================
   Store content, phones only (< 768px - where Bootstrap's col-md-* stack).
   ============================================================================= */
@media (max-width: 767.98px) {

    /* The square banner cards (.square_pic in col-md-4 / col-md-6) stack with no
       space between them; the theme already gives .rect_pic a 15px bottom margin,
       so give the squares the same. */
    .product_wrp .square_pic {
        margin-bottom: 15px;
    }

    footer .footer_bottom .row > .col-md-4 {
        margin-left: 0 !important;
    }

    footer .footer_bottom .row > .col-md-7 + .col-md-4 {
        margin-top: 14px;
    }
}

/* =============================================================================
   Currency <select> chip - ALL widths (Themes 1, 2, 3).
   The native control (white box, grey border, inline margin-bottom:7px and, on
   Theme 1, margin-left:-14px) is replaced by the same white outline chip the
   phone header uses, so desktop and mobile match. The !importants beat the
   inline style the DropDownList carries.
   ============================================================================= */
header.navbar-default .usd {
    display: flex;
    align-items: center;
}

@media (min-width: 992px) {
    header.navbar-default .usd {
        margin: 0 10px 0 0;         /* was the select's own inline margin-right */
    }
}

header.navbar-default .usd label {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
}

header.navbar-default .usd select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 26px;
    margin: 0 !important;
    padding: 0 22px 0 10px !important;
    font-size: 12px !important;
    line-height: 24px;
    color: #fff;
    cursor: pointer;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='rgba%28255,255,255,0.9%29' stroke-width='1.5' d='M1 1l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 8px center / 9px 6px;
    border: 1px solid rgba(255, 255, 255, .7) !important;
    border-radius: 14px !important;
    outline: 0;
}

    header.navbar-default .usd select:hover {
        border-color: #fff !important;
    }

    header.navbar-default .usd select option {
        color: #000;
        background: #fff;
    }
