/* ─── Strip Storefront's .site-header layout styles ────────────────────────── */

.site-header {
    position: static !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.bc-header {
    background-color: #f1891a;
    height: var(--header-height);
    position: relative;
    z-index: 20;
}

.bc-header__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    padding: 30px 95px;
    margin: 0 auto;
    max-width: 1440px;
}

/* ─── Logo ──────────────────────────────────────────────────────────────────── */

.bc-header__logo > img {
    width: 138px;
    height: auto;
}

/* ─── Nav ───────────────────────────────────────────────────────────────────── */

.bc-nav {
    display: flex;
    align-items: center;
    align-self: flex-end;
    gap: 16px;
}

.bc-nav__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: hsla(0, 0%, 10%, 1);
    text-decoration: none;
}

.bc-nav__cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: hsla(226, 18%, 38%, 1);
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.bc-nav__user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.bc-nav__name {
    font-weight: 500;
    font-size: 13px;
    color: hsla(0, 0%, 10%, 1);
}

.bc-nav__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsla(226, 18%, 38%, 1);
    color: white;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* ─── Desktop navbar ──────────────────────────────────────────────────────── */

/* Text links, sub-navigation and the mobile toggle are hidden by default;
   each is turned on in its own breakpoint below. */
.bc-nav__links,
.bc-subnav,
.bc-nav__toggle {
    display: none;
}

/* ─── Mobile account menu ─────────────────────────────────────────────────────
   Below 768px the sub-navigation becomes a dropdown opened by the hamburger.
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .bc-header__inner {
        padding: 30px 24px 15px;
    }

    .bc-header__logo > img {
        width: 125px;
    }

    .bc-nav__name {
        color: black;
        font-family: "DM Sans", var(--font-body);
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: 19px;
        letter-spacing: 0.16px;
    }

    .bc-nav__avatar {
        width: 32px;
        height: 32px;
        color: #FFF;
        font-family: "DM Sans", var(--font-body);
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: 19px;
        letter-spacing: 0.16px;
    }

    .bc-nav__toggle {
        display: none;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 34px;
        height: 34px;
        padding: 7px;
        border: none;
        background: none;
        cursor: pointer;
        box-sizing: border-box;
    }

    .bc-nav__toggle-bar {
        display: block;
        width: 100%;
        height: 2px;
        background: white;
        border-radius: 1px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    .bc-nav__toggle.is-open .bc-nav__toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .bc-nav__toggle.is-open .bc-nav__toggle-bar:nth-child(2) { opacity: 0; }
    .bc-nav__toggle.is-open .bc-nav__toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* Cart icon shown to the right of the user chip. */
    .bc-nav__cart {
        display: inline-flex;
        order: 1;
    }

    /* No dropdown menu on mobile — the user chip links to the account page. */
    .bc-subnav {
        display: none;
    }

    .bc-subnav.is-open {
        max-height: 520px;
    }

    .bc-subnav__inner {
        display: flex;
        flex-direction: column;
        padding: 0 20px 14px;
    }

    .bc-subnav__user {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    }

    .bc-subnav__avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: hsla(226, 18%, 38%, 1);
        color: white;
        font-weight: 600;
        font-size: 13px;
        flex-shrink: 0;
    }

    .bc-subnav__id {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .bc-subnav__name {
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.1;
    }

    .bc-subnav__role {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.8);
    }

    .bc-subnav__links {
        display: flex;
        flex-direction: column;
    }

    .bc-subnav__link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 13px 0;
        color: #fff;
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .bc-subnav__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 20px;
        height: 20px;
        padding: 1px 6px 0;
        border-radius: 10px;
        background: hsla(142, 55%, 42%, 1);
        color: white;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
    }

    .bc-subnav__cart {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 14px;
        padding: 13px;
        background: white;
        color: #000;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        text-decoration: none;
    }
}

@media (min-width: 768px) {
    .bc-header {
        height: auto;
    }

    /* Full-width gold line under the top row (content stays capped at 1440). */
    .bc-header::after {
        content: "";
        position: absolute;
        top: 81px;
        left: 0;
        right: 0;
        height: 1px;
        background: #DCC197;
    }

    .bc-header__inner {
        height: 81px;
        align-items: center;
        padding: 30px 100px 19px 100px;
    }

    .bc-nav {
        align-self: center;
    }

    .bc-nav__links {
        display: flex;
        align-items: center;
        gap: 78px;
    }

    .bc-nav__link {
        color: #FFF;
        font-family: "DM Sans", var(--font-body);
        font-size: 18px;
        font-weight: 500;
        line-height: normal;
        letter-spacing: 0.18px;
        text-decoration: none;
    }

    .bc-nav__link:hover {
        opacity: 0.85;
    }

    /* Desktop uses the sub-navigation instead of the cart icon / chip. */
    .bc-nav__cart,
    .bc-nav__user {
        display: none;
    }

    /* ─── Sub-navigation (logged-in) ─────────────────────────────────────── */

    .bc-subnav {
        display: block;
    }

    .bc-subnav__inner {
        display: flex;
        align-items: flex-start;
        gap: 40px;
        max-width: 1440px;
        margin: 0 auto;
        /* Avatar aligns at 100px (logo + title); right 100px aligns the cart icon
           with the top-row links (Logga ut). Links top-aligned, 18px below the
           gold line above. */
        padding: 18px 100px 27px 100px;
    }

    .bc-subnav__user {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
    }

    .bc-subnav__avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: hsla(226, 18%, 38%, 1);
        color: #FFF;
        font-family: "DM Sans", var(--font-body);
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: 19px;
        letter-spacing: 0.16px;
        flex-shrink: 0;
    }

    .bc-subnav__id {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .bc-subnav__name {
        color: black;
        font-family: "DM Sans", var(--font-body);
        font-size: 18px;
        font-style: normal;
        font-weight: 500;
        line-height: 19px;
        letter-spacing: 0.18px;
    }

    .bc-subnav__role {
        color: black;
        font-family: "DM Sans", var(--font-body);
        font-size: 12px;
        font-style: normal;
        font-weight: 500;
        line-height: 18px;
        letter-spacing: 1.8px;
        text-transform: uppercase;
    }

    .bc-subnav__links {
        display: flex;
        align-items: center;
        gap: 40px;
        margin-left: auto;
    }

    /* Sortiment / Logga ut live in the top row on desktop. */
    .bc-subnav__link.bc-subnav__mobile-only {
        display: none;
    }

    .bc-subnav__link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: hsla(0, 0%, 12%, 1);
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
    }

    .bc-subnav__link:hover {
        opacity: 0.8;
    }

    .bc-subnav__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 20px;
        height: 20px;
        padding: 1px 6px 0;
        border-radius: 10px;
        background: hsla(142, 55%, 42%, 1);
        color: white;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
    }

    /* Cart icon, aligned with the top-row links (subnav padding-right = 95px). */
    .bc-subnav__cart {
        position: relative;
        display: inline-flex;
        align-items: center;
        color: hsla(0, 0%, 12%, 1);
        text-decoration: none;
    }

    .bc-subnav__cart:hover {
        opacity: 0.8;
    }

    .bc-subnav__cart-count {
        position: absolute;
        top: -6px;
        right: -8px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: hsla(142, 55%, 42%, 1);
        color: white;
        font-size: 11px;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
        box-sizing: border-box;
    }
}
