/* Nagłówek sklepu: logo + konto/koszyk, pod spodem przypięty pasek kategorii */
.bh {
    --bh-text: #1e1e1e;
    --bh-muted: #6b6b6b;
    --bh-line: #ececec;
    --bh-accent: #CD0000;
    --bh-top-h: 54px;
    --bh-nav-h: 40px;
    position: sticky;
    top: calc(-1 * var(--bh-top-h)); /* górny wiersz odjeżdża, pasek menu zostaje */
    z-index: 998; /* pod ekranem ładowania (#preloader: 999), nad treścią strony */
    background: #fff;
    font-family: 'Gilroy', sans-serif;
    margin-bottom: 16px;
    transition: box-shadow .2s ease;
}

.bh.is-stuck {
    box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
}

.bh *,
.bh *::before,
.bh *::after {
    letter-spacing: normal;
}

.bh ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bh a {
    text-decoration: none;
}

.bh a:focus-visible,
.bh button:focus-visible {
    outline: 2px solid var(--bh-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Bootstrap 3 dodaje do .container pseudo-elementy clearfix, które psują układ flex */
.bh .container::before,
.bh .container::after {
    display: none !important;
}

/* ---------- Górny wiersz ---------- */
.bh-top-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--bh-top-h);
}

.bh-logo {
    display: block;
    flex: none;
}

.bh-logo img {
    display: block;
    height: 34px;
    width: auto;
    border-radius: 0;
}

.bh-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.bh .bh-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--bh-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

/* Ikona zawsze w kolorze tekstu */
.bh-link .fa {
    font-size: 16px;
    color: currentColor;
}

.bh .bh-link:hover {
    background: #f5f5f5;
    color: var(--bh-text);
}

.bh .bh-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--bh-text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .15s ease;
}

.bh .bh-cart:hover {
    background: var(--bh-accent);
    color: #fff;
}

.bh-cart .fa {
    font-size: 16px;
}

.bh-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--bh-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.bh .bh-cart:hover .bh-cart-badge {
    background: #fff;
    color: var(--bh-accent);
}

/* ---------- Pasek kategorii ---------- */
.bh-nav-wrap {
    border-top: 1px solid var(--bh-line);
    border-bottom: 1px solid var(--bh-line);
    background: #fff;
}

.bh-nav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--bh-nav-h);
}

.bh-nav {
    flex: 1;
    min-width: 0;
}

.bh-nav:focus {
    outline: none;
}

.bh-menu {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    height: var(--bh-nav-h);
}

.bh-menu > li {
    display: flex;
}

.bh .bh-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: var(--bh-text);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .15s ease;
}

.bh .bh-menu > li > a::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--bh-accent);
    transform: scaleX(0);
    transition: transform .2s ease;
}

.bh .bh-menu > li > a:hover,
.bh .bh-menu > li.active > a {
    color: var(--bh-accent);
}

.bh .bh-menu > li > a:hover::after,
.bh .bh-menu > li.active > a::after {
    transform: scaleX(1);
}

/* Małe logo i koszyk pojawiają się w pasku dopiero po przewinięciu */
.bh-mini-logo,
.bh-mini-cart {
    display: none;
    flex: none;
    align-items: center;
}

.bh-mini-logo img {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 0;
}

.bh .bh-mini-cart {
    position: relative;
    gap: 6px;
    color: var(--bh-text);
    font-size: 18px;
}

.bh .bh-mini-cart:hover {
    color: var(--bh-accent);
}

.bh.is-stuck .bh-mini-logo,
.bh.is-stuck .bh-mini-cart {
    display: flex;
}

.bh-drawer-head,
.bh-drawer-links,
.bh-burger,
.bh-backdrop {
    display: none;
}

/* Na mniejszych laptopach zmniejszamy odstępy, żeby wszystkie kategorie zmieściły się w jednym wierszu */
@media (max-width: 1199px) {
    .bh .bh-menu > li > a {
        font-size: 12.5px;
        letter-spacing: .02em;
        padding: 0 2px;
    }

    .bh .bh-link {
        padding: 8px 8px;
    }
}

/* ---------- Tablet i telefon ---------- */
@media (max-width: 991px) {
    .bh {
        --bh-top-h: 56px;
        top: 0;
        box-shadow: 0 1px 0 var(--bh-line);
        margin-bottom: 12px;
    }

    .bh-top-inner {
        gap: 12px;
    }

    .bh-logo {
        margin: 0 auto;
    }

    .bh-logo img {
        height: 32px;
    }

    .bh-actions {
        margin-left: 0;
    }

    .bh-hide-mobile,
    .bh-cart-label {
        display: none !important;
    }

    .bh .bh-cart {
        margin: 0;
        padding: 0;
        width: 44px;
        height: 44px;
        justify-content: center;
        background: transparent;
        color: var(--bh-text);
    }

    .bh .bh-cart:hover {
        background: #f5f5f5;
        color: var(--bh-text);
    }

    .bh-cart .fa {
        font-size: 21px;
    }

    .bh-cart .bh-cart-badge {
        position: absolute;
        top: 3px;
        right: 0;
        min-width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .bh-burger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 11px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
    }

    .bh-burger span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: var(--bh-text);
    }

    .bh-burger:hover {
        background: #f5f5f5;
    }

    /* Pasek menu zamienia się w wysuwany panel */
    .bh-nav-wrap {
        border: 0;
    }

    .bh-nav-inner {
        height: 0;
        padding: 0;
    }

    .bh.is-stuck .bh-mini-logo,
    .bh.is-stuck .bh-mini-cart,
    .bh-mini-logo,
    .bh-mini-cart {
        display: none;
    }

    .bh-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        width: min(340px, 86vw);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        box-shadow: 8px 0 30px rgba(0, 0, 0, .18);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .25s ease, visibility 0s linear .25s;
    }

    .bh.is-open .bh-nav {
        transform: none;
        visibility: visible;
        transition: transform .25s ease;
    }

    .bh-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: block;
        background: rgba(0, 0, 0, .45);
        opacity: 0;
        transition: opacity .25s ease;
    }

    .bh-backdrop[hidden] {
        display: none;
    }

    .bh.is-open .bh-backdrop {
        opacity: 1;
    }

    .bh-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 12px 14px 22px;
        border-bottom: 1px solid var(--bh-line);
        color: var(--bh-muted);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .12em !important;
        text-transform: uppercase;
    }

    .bh-close {
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--bh-text);
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
    }

    .bh-close:hover {
        background: #f5f5f5;
    }

    .bh-menu {
        display: block;
        height: auto;
        padding: 8px 0;
    }

    .bh .bh-menu > li > a {
        display: flex;
        flex: 1;
        padding: 13px 22px;
        font-size: 15px;
        letter-spacing: .03em;
    }

    .bh .bh-menu > li > a::after {
        left: 0;
        right: auto;
        top: 10px;
        bottom: 10px;
        width: 3px;
        height: auto;
        border-radius: 0 3px 3px 0;
        transform: scaleY(0);
    }

    .bh .bh-menu > li > a:hover::after,
    .bh .bh-menu > li.active > a::after {
        transform: scaleY(1);
    }

    .bh .bh-menu > li.active > a {
        background: #fafafa;
    }

    .bh-drawer-links {
        display: block;
        margin-top: auto !important;
        padding: 10px 0 18px !important;
        border-top: 1px solid var(--bh-line);
    }

    .bh .bh-drawer-links a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 22px;
        color: var(--bh-text);
        font-size: 15px;
        font-weight: 500;
    }

    .bh-drawer-links .fa {
        width: 18px;
        text-align: center;
        color: currentColor;
    }

    .bh .bh-drawer-links a:hover {
        color: var(--bh-accent);
    }
}

body.bh-locked {
    overflow: hidden;
}

/* Kotwica #kontakt nie chowa się pod przypiętym nagłówkiem */
#kontakt {
    scroll-margin-top: 70px;
}
