/* ============================================================
   BuyDirect Header Redesign — PBI #45266
   Three-band stepped gray header:
     1. Value prop strip (#1F1F1F charcoal)
     2. Main header row (#f8f8f8 light gray)
     3. Category nav (#f2f2f2 medium gray) — styled in category-nav.css
   ============================================================ */

/* ── CLS prevention ── */
.bd-header { min-height: 130px; }

/* ── Value prop strip ── */
.bd-value-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 7px 20px;
    background: #1F1F1F;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.bd-value-strip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #bbb;
}
.bd-value-strip-item svg {
    width: 13px;
    height: 13px;
    stroke: #C4112F;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.bd-value-strip-item strong {
    color: #fff;
    font-weight: 600;
}
.bd-value-strip-dot {
    color: #444;
    font-size: 12px;
}

/* ── Main header row ── */
.bd-header-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 16px 24px;
    gap: 20px;
    background: #f8f8f8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Text logo ── */
.bd-logo {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    text-decoration: none;
}
.bd-logo:hover { text-decoration: none; }
.bd-logo-buy {
    font-size: 26px;
    font-weight: 800;
    color: #C4112F;
    font-style: italic;
    letter-spacing: -0.5px;
}
.bd-logo-direct {
    font-size: 26px;
    font-weight: 800;
    color: #262626;
    font-style: italic;
    letter-spacing: -0.5px;
}
.bd-logo-sub {
    font-size: 7.5px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-left: 3px;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* ── Search wrapper ── */
.bd-search-wrap {
    width: clamp(500px, 50vw, 740px);
}

/* ── Utility icons ── */
.bd-header-utils {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: end;
}
.bd-util-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 0;
}
.bd-util-item:hover {
    color: #C4112F;
    text-decoration: none;
}
.bd-util-item:hover svg { stroke: #C4112F; }

/* Prevent hover red from bleeding into account dropdown panel */
.bd-header-utils .dropdown:hover .dd-panel,
.bd-header-utils .dropdown:hover .dd-panel * {
    color: unset;
}
.bd-header-utils .dropdown:hover .dd-panel a {
    color: #444;
}
.bd-header-utils .dropdown:hover .dd-panel a:hover {
    color: #C4112F;
}
.bd-header-utils .dropdown:hover .dd-panel .dd-logout:hover {
    color: #c0392b;
}
.bd-util-item svg {
    width: 18px;
    height: 18px;
    stroke: #555;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.15s;
}
.bd-util-item.bd-login { color: #C4112F; }
.bd-util-item.bd-login svg { stroke: #C4112F; }

/* ── Cart badge ── */
.bd-cart-wrap { position: relative; }
.bd-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #C4112F;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Region selector ── */
.bd-region-label {
    font-size: 11px;
    color: #666;
}
.bd-region-dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}
.bd-region-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    white-space: nowrap;
}
.bd-region-btn:hover { color: #C4112F; }
.bd-region-panel {
    right: auto;
    left: 0;
    top: 100%;
    z-index: 1100;
    max-height: 400px;
    overflow-y: auto;
}
.bd-region-item.bd-region-active {
    background: #f8f8f8;
    font-weight: 600;
}
.bd-region-item .dd-icon svg {
    stroke: #999;
    fill: none;
    stroke-width: 1.5;
}
.bd-region-item.bd-region-active .dd-icon svg {
    stroke: #C4112F;
}
.bd-region-item:hover .dd-icon svg {
    stroke: #C4112F;
}

/* ── Account dropdown overrides ──
   Reuse .dd-panel, .dd-item, .dd-icon from site.css.
   These overrides position the dropdown within the flex header. */
.bd-header-utils .dropdown {
    position: relative;
}
.bd-header-utils .dropbtn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    font-weight: 500;
    height: auto;
    line-height: normal;
}
.bd-header-utils .dropbtn:hover,
.bd-header-utils .dropdown:hover .dropbtn {
    color: #C4112F;
    background-color: transparent;
}
.bd-header-utils .dropbtn:hover svg,
.bd-header-utils .dropdown:hover .dropbtn svg { stroke: #C4112F; }
.bd-header-utils .dropbtn svg {
    width: 18px;
    height: 18px;
    stroke: #555;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.15s;
}
.bd-header-utils .dropbtn .fa-caret-down {
    font-size: 10px;
    color: #999;
    margin-left: 2px;
}
.bd-header-utils .dropdown {
    padding-bottom: 10px;
    margin-bottom: -10px;
}
.bd-header-utils .dropdown-content.dd-panel {
    right: 0;
    left: auto;
    top: 100%;
    z-index: 1100;
}
/* Bootstrap mobile dropdown positioning */
.bd-header-utils .dropdown-menu.dd-panel {
    right: 0;
    left: auto;
    margin-top: 0;
    top: 100%;
    z-index: 1100;
}

/* ── Nav bar wrapper ── */
.bd-nav-wrapper {
    background: #f2f2f2;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

/* ── Mobile search row (hamburger + search bar) ── */
.bd-mobile-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 10px;
    background: #f8f8f8;
}

/* ── Responsive visibility ── */
.bd-show-mobile { display: none; }
.bd-show-desktop { display: flex; }

/* ── Mobile hamburger ── */
.bd-mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 11px;
    flex-shrink: 0;
}
.bd-mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    stroke: #262626;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ============================================================
   Mobile (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .bd-header { min-height: 115px; }

    /* Value strip — show only first item on mobile */
    .bd-value-strip {
        padding: 6px 12px;
        justify-content: center;
    }
    .bd-value-strip-item { font-size: 11px; }
    .bd-value-strip-item:last-child { display: none; }
    .bd-value-strip-dot { display: none; }

    /* Main header row wraps — switch from grid to flex on mobile */
    .bd-header-main {
        display: flex;
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 10px;
    }
    .bd-header-main .bd-mobile-menu-btn { order: 1; }
    .bd-logo { order: 2; }
    .bd-header-utils {
        order: 3;
        margin-left: auto;
        gap: 14px;
    }

    /* Responsive visibility */
    .bd-show-desktop { display: none !important; }
    .bd-show-mobile { display: flex !important; }

    /* Hide utility labels and region on mobile */
    .bd-util-label { display: none; }
    .bd-util-item.bd-region { display: none !important; }

    /* 44px minimum tap targets on mobile */
    .bd-util-item {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 8px;
    }
    .bd-header-utils .dropbtn {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 8px;
    }
    .bd-cart-badge {
        top: 2px;
        right: 0;
    }

    /* Account dropdown — full label hidden, icon only */
    .bd-header-utils .dropbtn .bd-util-label { display: none; }
}

@media (max-width: 480px) {
    .bd-value-strip-item:nth-child(5) { display: none; }
}
