/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
    --bp-search-drawer-width:  420px;
    --bp-search-drawer-bg:     #fff;
    --bp-search-drawer-shadow: -2px 0 24px rgba(0, 0, 0, 0.13);
    --bp-search-overlay-bg:    rgba(0, 0, 0, 0.45);
    --bp-search-transition:    0.3s ease;
}

/* Custom Header Styles */
.bp-custom-header {
    font-family: inherit;
    background: #fff;
    position: relative;
    z-index: 100;
}

.bp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.bp-top-bar {
    background-color: #f7f7f7;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
}

.bp-top-bar p {
    margin: 0;
}

/* Logo — lives in the bottom header bar */
.bp-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bp-logo img,
.bp-logo .custom-logo {
    max-height: 45px;
    width: auto;
    display: block;
}

.bp-mini-cart {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0;
}

.bp-mini-cart a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #fff;
    transition: color 0.2s;
}

.bp-mini-cart a:hover {
    color: rgba(255, 255, 255, 0.75);
}

.bp-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #fff;
    color: #FF2A61;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
}

.bp-mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
}

/* Mobile elements hidden on desktop */
.bp-mobile-overlay,
.bp-mobile-menu-header {
    display: none;
}

/* ── Header icon group (search + account + cart) ────────────────────── */
.bp-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bp-search-toggle {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 0;
}

.bp-account-link {
    color: #fff;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    line-height: 0;
}

.bp-search-toggle:hover,
.bp-account-link:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.1);
}

.bp-search-toggle:focus-visible,
.bp-account-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* ── Mobile search row (inside hamburger drawer, hidden on desktop) ─── */
.bp-mobile-search-row {
    display: none;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.bp-mobile-search-row .bp-search-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: left;
}

.bp-mobile-search-row .bp-search-toggle:hover {
    background: #ebebeb;
    color: #222;
}

.bp-mobile-search-row .bp-search-toggle:focus-visible {
    outline: 2px solid #FF2A61;
    outline-offset: 2px;
}

/* ── Search overlay ──────────────────────────────────────────────────── */
.bp-search-overlay {
    position: fixed;
    inset: 0;
    background: var(--bp-search-overlay-bg);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bp-search-transition),
                visibility 0s linear 0.3s;
}

.bp-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--bp-search-transition), visibility 0s;
}

/* ── Search drawer (right-side, full height — mirrors mini-cart) ─────── */
.bp-search-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--bp-search-drawer-width);
    max-width: 100vw;
    background: var(--bp-search-drawer-bg);
    box-shadow: var(--bp-search-drawer-shadow);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform var(--bp-search-transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bp-search-drawer.is-open {
    transform: translateX(0);
}

.bp-search-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.bp-search-drawer__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bp-search-drawer__close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.bp-search-drawer__close:hover {
    color: #333;
}

.bp-search-drawer__close:focus-visible {
    outline: 2px solid #FF2A61;
    outline-offset: 2px;
}

.bp-search-drawer__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.bp-search-drawer__input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    flex-shrink: 0;
    box-sizing: border-box;
}

.bp-search-drawer__input:focus {
    border-color: #FF2A61;
    box-shadow: 0 0 0 3px rgba(255, 42, 97, 0.08);
}

.bp-search-drawer__results {
    margin-top: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Results rendered by JS inside drawer — override absolute defaults */
.bp-search-drawer__results .bp-search-results {
    position: static;
    width: 100%;
    max-width: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    overflow: visible;
    max-height: none;
}

/* Admin bar offset — drawer sits below the WP toolbar */
.admin-bar .bp-search-drawer,
.admin-bar .bp-search-overlay {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .bp-search-drawer,
    .admin-bar .bp-search-overlay {
        top: 46px;
    }
}

/* Mobile: drawer takes full width */
@media (max-width: 768px) {
    .bp-search-drawer {
        width: 100%;
    }

    .bp-header-icons {
        gap: 2px;
    }

    .bp-account-link {
        display: none;
    }
}

/* Bottom Header (Sticky) */
.bp-bottom-header {
    background-color: #FF2A61;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bp-bottom-header .bp-container {
    background-color: #FF2A61;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Navigation — flex: 1 so it fills space; justify-content centers the menu items */
.bp-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Navigation Base */
.bp-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bp-navigation .bp-menu {
    display: flex;
}

.bp-navigation .bp-menu>li {
    position: relative;
    margin: 0;
}

.bp-navigation .bp-menu>li>a {
    color: #fff;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

.bp-navigation .bp-menu>li>a:hover {
    background: rgba(0, 0, 0, 0.1);
}

.bp-navigation .bp-menu>li.menu-item-has-children>a::after {
    content: "▾";
    margin-left: 6px;
    font-size: 12px;
}

/* Sub-Menu Styles (Dropdowns) */
.bp-navigation .bp-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 99;
    padding: 10px 0;
    border-radius: 0 0 4px 4px;
    display: flex;
    flex-direction: column;
}

.bp-navigation .bp-menu li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bp-navigation .bp-menu .sub-menu li {
    position: relative;
    margin: 0;
}

.bp-navigation .bp-menu .sub-menu li a {
    color: #444;
    text-decoration: none;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
}

.bp-navigation .bp-menu .sub-menu li a:hover {
    color: #FF2A61;
    background: #fafafa;
}

/* Sub-menu inside Sub-menu */
.bp-navigation .bp-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    transform: translateX(10px);
    border-radius: 4px;
}

.bp-navigation .bp-menu .sub-menu li:hover>.sub-menu {
    transform: translateX(0);
}

.bp-navigation .bp-menu .sub-menu li.menu-item-has-children>a::after {
    content: "›";
    /* Chevron right for inside submenus */
    font-size: 16px;
}

/* Custom Highlight Menu Item */
.bp-navigation .bp-menu>li.bp-yellow-menu>a {
    color: #FFFF00 !important;
}

/* AJAX Search Results (used inside search drawer) */
.bp-search-results {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 500px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    border: 1px solid #eaeaea;
    overflow: hidden;
    max-height: 450px;
    overflow-y: auto;
}

.bp-search-container.show-results .bp-search-results {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bp-result-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.bp-result-item:last-child {
    border-bottom: none;
}

.bp-result-item:hover {
    background: #fafafa;
}

.bp-result-img-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.bp-result-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    background: #f5f5f5;
}

/* Badges */
.bp-result-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    color: #fff;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bp-badge-sale {
    background-color: #FF2A61;
}

.bp-badge-out-of-stock {
    background-color: #888;
}

.bp-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bp-result-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
    line-height: 1.3;
}

.bp-result-price {
    font-size: 14px;
    color: #FF2A61;
    font-weight: 600;
}

.bp-result-price del {
    color: #aaa;
    font-weight: 400;
    margin-right: 5px;
}

.bp-search-loading {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.bp-search-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.bp-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
    color: #FF2A61;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    position: sticky;
    bottom: 0;
}

.bp-view-all:hover {
    background: #f0f0f0;
}

/* Hide "See all results for" link — results themselves are unaffected. */
.bp-view-all {
    display: none !important;
}
/* When .bp-view-all is in the DOM (even hidden) it is :last-child, so the
   existing .bp-result-item:last-child rule no longer removes that item's
   border-bottom. This selector targets the last visible product result. */
#bp-search-drawer-results:has(> .bp-view-all) .bp-result-item:nth-last-child(2) {
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .bp-mobile-menu-toggle {
        display: block;
    }

    .bp-bottom-header .bp-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        position: relative;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    /* Logo: absolute-centred between hamburger and icons */
    .bp-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .bp-logo img,
    .bp-logo .custom-logo {
        max-height: 40px;
    }

    /* Hide search toggle from icon row — it lives in the mobile drawer instead */
    .bp-header-icons .bp-search-toggle {
        display: none;
    }

    /* Show mobile search row inside the off-canvas nav */
    .bp-mobile-search-row {
        display: block;
    }

    .bp-mini-cart {
        margin-left: 0;
    }

    /* Off-canvas Overlay —
       Must beat .bp-shop-sidebar (10000) and .mbn-bar (9999). */
    .bp-mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 10001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .bp-mobile-overlay.is-open {
        opacity: 1;
        visibility: visible;
    }

    /* Convert menu into an Off-canvas drawer —
       One step above the overlay so it always slides in on top. */
    .bp-navigation {
        display: block;
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 10002;
        margin: 0;
        padding: 0;
        border: none;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .bp-navigation.is-open {
        left: 0;
    }

    .bp-mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        background: #fafafa;
    }

    .bp-mobile-menu-title {
        font-weight: 700;
        font-size: 16px;
        color: #222;
        text-transform: uppercase;
    }

    .bp-mobile-menu-close {
        background: transparent;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: #888;
        cursor: pointer;
    }

    .bp-navigation .bp-menu {
        flex-direction: column;
        white-space: normal;
        padding: 10px 0;
    }

    .bp-navigation .bp-menu>li {
        width: 100%;
    }

    .bp-navigation .bp-menu>li>a {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        color: #222;
        font-weight: 700;
        text-transform: uppercase;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Submenus acts as accordion on mobile */
    .bp-navigation .bp-menu .sub-menu {
        position: static;
        top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #fdfdfd;
        border-radius: 0;
        display: none;
        /* Hidden by default */
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    /* Show only the direct child sub-menu of an opened item */
    .bp-navigation .bp-menu>li.mobile-open>.sub-menu {
        display: block;
    }

    /* Show nested sub-menus when their own parent li is opened */
    .bp-navigation .bp-menu .sub-menu li.mobile-open>.sub-menu {
        display: block;
    }

    /* Tier 2 Items (Baby Essentials) */
    .bp-navigation .bp-menu .sub-menu li a {
        color: #666;
        font-weight: 400;
        text-transform: none;
        padding: 12px 20px 12px 40px;
        /* Indent */
        border-bottom: 1px solid #f5f5f5;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .bp-navigation .bp-menu .sub-menu li a:hover {
        background: #f9f9f9;
        color: #222;
    }

    /* Tier 3 Items (Diapers And Hygiene) */
    .bp-navigation .bp-menu .sub-menu .sub-menu {
        transform: none;
        left: 0;
        border-bottom: none;
    }

    .bp-navigation .bp-menu .sub-menu .sub-menu li a {
        color: #888;
        padding: 10px 20px 10px 60px;
        /* Double Indent */
        font-size: 13px;
    }

    /* Flip chevron up when open */
    .bp-navigation .bp-menu li.mobile-open>a::after {
        transform: rotate(180deg);
    }

}