/* ==========================================================
   VBC Framework
   Header
   Version: 2.1.0
========================================================== */

.vbc-sticky-top{
    position:sticky;
    top:0;
    z-index:9999;
}

/*
 * The WP admin toolbar is position:fixed at top:0 with a z-index far
 * above this wrapper's -- while logged in, that means once scrolled,
 * this sticky wrapper (also pinned at top:0) slides up underneath it
 * and the announcement bar visually disappears behind the admin bar,
 * even though it's technically still there. Only affects logged-in
 * admin/staff views; regular visitors never see the admin bar at all.
 * Heights match WordPress core's own admin-bar breakpoint exactly.
 */

body.admin-bar .vbc-sticky-top{
    top:32px;
}

@media (max-width:782px){

    body.admin-bar .vbc-sticky-top{
        top:46px;
    }

}

.vbc-header{
    position:relative;
    background:var(--vbc-color-primary);
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.vbc-header-main{
    background:var(--vbc-color-primary);
    color:#fff;
}

.vbc-header-main__inner{
    display:grid;
    grid-template-columns:
        220px
        minmax(600px,1fr)
        320px;
    align-items:center;
    gap:32px;
}

.vbc-logo{
    width:130px;
    min-width:130px;
    max-width:130px;
    flex:0 0 130px;
    display:flex;
    align-items:center;
}

.vbc-logo__link{
    display:block;
    width:130px;
}

.vbc-logo__image,
.custom-logo{
    display:block;
    width:130px !important;
    max-width:130px !important;
    min-width:130px !important;
    height:auto !important;
    margin-top:4px;
}

.vbc-logo__link{
    display:flex;
    align-items:center;
}

.vbc-logo__image,
.custom-logo{
    display:block;
    max-width:120px;
    width:100%;
    height:auto;
}

.vbc-search{
    flex:1;
    margin:0 28px;
}

.vbc-search__form{
    display:flex;
    align-items:center;
    height:44px;
    background:#ffffff;
    border:1px solid #d8d1c8;
    border-radius:0;
    overflow:hidden;
    box-shadow:none;
}

.vbc-search__scope{
    width:120px;
    min-width:120px;
    border:none;
    border-right:1px solid #e8e1d8;
    background:#ffffff;
    padding:0 14px;
    font-size:13px;
    font-weight:500;
    color:#333;
}

.vbc-search__input{
    flex:1;
    border:none;
    background:#ffffff;
    padding:0 18px;
    font-size:14px;
    color:#333;
}

.vbc-search__input:focus{
    outline:none;
}

.vbc-search__button{
    width:54px;
    min-width:54px;
    border:none;
    background:#ffffff;
    border-left:1px solid #e8e1d8;
    color:#4d4d4d;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:.2s;
}

.vbc-search__button:hover{
    background:#f8f8f8;
}

.vbc-search__button i{
    font-size:18px;
}

.vbc-header-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:26px;
    flex:0 0 auto;
}

.vbc-header-action{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    text-decoration:none;
    color:#fff;
    font-size:11px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.05em;
    position:relative;
}

.vbc-header-action i{
    font-size:22px;
    color:#dcb46b;
}

.vbc-header-action:hover{
    color:#f6e2bc;
}

.vbc-header-action__count{
    position:absolute;
    top:-6px;
    right:-8px;
    width:18px;
    height:18px;
    border-radius:50%;
    background:#dcb46b;
    color:#4b1713;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:10px;
    font-weight:700;
}

.vbc-navigation{
    background:#231f20;
    border-top:1px solid rgba(255,255,255,.08);
}

.vbc-menu{
    display:flex;
    align-items:center;
    justify-content:center;   /* Center the whole menu */
    gap:10px;
    list-style:none;
    margin:0;
    padding:0;
    min-height:52px;          /* Control navbar height */
}

.vbc-menu__item{
    position:relative;
}
.vbc-menu__item > a{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:1px 24px;      /* was 18px */
    line-height:1;
    color:#fff;
    text-decoration:none;
    font-size:14px;
    font-weight:700;
    letter-spacing:.03em;
    text-transform:uppercase;
    transition:.25s;
}
.vbc-menu__item>a:hover{
    background:rgba(255,255,255,.08);
}

.vbc-menu__item--has-children>a::after{
    content:"";
    display:inline-block;
    width:6px;
    height:6px;
    margin-left:8px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg) translateY(-2px);
}

.vbc-mega{
    position:absolute;
    left:0;
    top:100%;
    min-width:240px;
    background:#fff;
    border:1px solid #ddd;
    display:none;
    flex-direction:column;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    z-index:1000;
}

.vbc-menu__item:hover .vbc-mega{
    display:flex;
}

.vbc-mega a{
    padding:12px 18px;
    color:#333;
    text-decoration:none;
}

.vbc-mega a:hover{
    background:#f6f3ef;
    color:#7a221b;
}

.vbc-header-toggle{
    display:none;
    background:none;
    border:none;
    padding:0;
    color:#fff;
    cursor:pointer;
}

.vbc-header-toggle i{
    width:22px;
    height:22px;
}

.vbc-nav-close{
    display:none;
}

.vbc-menu__item--mobile-only{
    display:none;
}

.vbc-nav-overlay{
    display:none;
}

.vbc-header-search-toggle{
    display:none;
    background:none;
    border:none;
    padding:0;
    color:#fff;
    cursor:pointer;
}

.vbc-header-search-toggle i{
    width:20px;
    height:20px;
}

@media(max-width:1024px){

    /*
     * .vbc-header-main__inner is `display:grid` further up this file,
     * with grid-template-columns:220px minmax(600px,1fr) 320px -- that
     * hardcodes a 600px minimum on the search column alone, so the
     * header (and the whole page, since nothing contains it) could
     * never shrink below ~1200px. The flex-wrap/padding overrides
     * below existed already but had no effect, because they were
     * applied to a grid container that was still `display:grid` --
     * flex properties do nothing there. Adding `display:flex` here is
     * the actual fix; grid-template-columns simply stops applying
     * once display is no longer grid.
     */

    .vbc-header-main__inner{
        position:relative;
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        justify-content:flex-end;
        padding:16px 0;
        min-height:78px;
    }

    .vbc-header-toggle{
        display:flex;
        align-items:center;
        order:3;
    }

    .vbc-logo{
        position:absolute;
        left:50%;
        top:12px;
        transform:translateX(-50%);
        flex:none;
        width:auto !important;
        height:54px;
        display:flex;
        justify-content:center;
    }

    .vbc-logo__link,
    .vbc-logo__image,
    .custom-logo{
        width:auto !important;
        max-width:none !important;
        min-width:0 !important;
        height:54px !important;
        max-height:54px !important;
    }

    .vbc-header-search-toggle{
        display:flex;
        align-items:center;
        justify-content:center;
        order:1;
        width:36px;
        height:36px;
        margin-right:14px;
    }

    /*
     * Cart already lives in the bottom nav (see bottom-nav.php), and
     * Bike Finder / Account / Wishlist already live in the hamburger
     * drawer -- so the icon row itself doesn't need this group at
     * all on mobile.
     */

    .vbc-header-actions{
        display:none;
    }

    /*
     * The full search form (scope select + input + submit) is now
     * hidden by default and only revealed as a dropdown row when
     * #vbc-search-toggle is tapped -- see core.js initSearchToggle().
     * The icon-only toggle button above is what's visible in the
     * header row itself.
     */

    .vbc-search{
        display:none;
        order:4;
        flex:1 1 100%;
        margin:16px 0 0;
    }

    .vbc-search.is-open{
        display:flex;
    }

    .vbc-search__form{
        width:100%;
        height:46px;
        border:none;
        border-radius:0;
        box-shadow:none;
    }

    .vbc-search__input{
        border-radius:0;
        padding:0 20px;
    }

    .vbc-search__button{
        border-left:1px solid #e8e1d8;
        border-radius:0;
    }

    .vbc-search__scope{
        display:none;
    }

    .vbc-menu__item--mobile-only{
        display:block;
    }

    /*
     * The category bar (Motorcycles / Brands / Body Parts / etc.)
     * becomes an off-canvas drawer instead of a horizontal-scrolling
     * bar -- toggled via #vbc-nav-toggle, closed via #vbc-nav-close
     * or by tapping the overlay. See core.js initMobileMenu().
     */

    .vbc-navigation{
        position:fixed;
        top:0;
        left:0;
        bottom:0;
        width:280px;
        max-width:85vw;
        overflow-y:auto;
        transform:translateX(-100%);
        transition:transform .3s ease;
        z-index:1000;
        border-top:none;
    }

    .vbc-navigation.is-open{
        transform:translateX(0);
    }

    .vbc-navigation .vbc-container{
        max-width:none;
        padding:0;
    }

    .vbc-nav-close{
        display:flex;
        align-items:center;
        justify-content:center;
        width:44px;
        height:44px;
        margin:8px 8px 0 auto;
        background:none;
        border:none;
        color:#fff;
        cursor:pointer;
    }

    .vbc-nav-close i{
        width:20px;
        height:20px;
    }

    .vbc-menu{
        flex-direction:column;
        align-items:stretch;
        justify-content:flex-start;
        gap:0;
        min-height:0;
        padding:8px 0 24px;
    }

    .vbc-menu__item>a{
        display:block;
        padding:14px 20px;
    }

    .vbc-mega{
        position:static;
        box-shadow:none;
    }

    .vbc-nav-overlay{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.5);
        z-index:999;
        opacity:0;
        pointer-events:none;
        transition:opacity .3s ease;
    }

    .vbc-nav-overlay.is-open{
        opacity:1;
        pointer-events:auto;
    }

}

body.vbc-nav-open{
    overflow:hidden;
}