/**
 * Site-wide header chrome (sticky + blur bar) — same look as home mobile/desktop.
 * Loaded on every page via header.php ($bhCoreCss).
 * Drawer/burger details live in mob-menu.css.
 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 auto;
    border-bottom: none;
    background: transparent;
    isolation: isolate;
}

.header::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    background: linear-gradient(180deg, rgba(21, 34, 56, 0.96) 0%, rgba(15, 24, 40, 0.94) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.header::after {
    content: "";
    position: absolute;
    z-index: 1;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.header__block_1,
.header__block_2,
.header__block_3 {
    position: relative;
    z-index: 1;
}

@media (max-width: 1023px) {
    .header {
        padding: 16px 20px 14px;
    }

    .dashboard__signup,
    .dashboard__signup_new {
        min-width: 0;
        width: 30px;
        max-width: 30px;
        padding: 0;
    }
}

@media (min-width: 1024px) {
    .header {
        padding: 22px 50px 20px;
    }
}

@media (min-width: 1024px) and (max-width: 1632px) {
    .header {
        padding: 22px 15px 20px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        gap: 0 10px;
    }

    /* Rigid calc() widths from main.css crush the bar — flex instead */
    .header__block_1 {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: auto;
        max-width: 160px;
    }

    .header__block_2 {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        padding: 0 8px !important;
    }

    .header__block_3 {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: auto !important;
        max-width: none !important;
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
        gap: 6px 10px;
    }

    .menuMain__items {
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
    }

    .menuMain__item {
        padding: 0 6px;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }

    .menuMain__item a,
    .menuMain__item a:visited {
        white-space: nowrap;
        font-size: 1.55rem;
    }

    /* Keep lang + currency in one row (main.css stacks them ≤1230px) */
    .sort_2 {
        -webkit-box-orient: horizontal !important;
        -ms-flex-flow: row nowrap !important;
        flex-flow: row nowrap !important;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        margin: 0 4px 0 0;
        padding: 0;
        gap: 2px;
    }

    .sort_2__select {
        margin: 0 2px;
    }

    .sort_2__select .field {
        width: auto;
        min-width: 0;
        padding: 8px 22px 8px 8px;
        height: 34px;
        font-size: 1.35rem;
    }

    .sort_2__select .field_currency::after {
        right: 6px;
    }

    .dashboard {
        width: auto !important;
        max-width: none !important;
        gap: 8px;
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
    }

    /* Free from main.css 53px box; match icon-button height so it doesn't look tucked under Sign up */
    .dashboard__login {
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        height: 50px;
        padding: 0 4px;
        white-space: nowrap;
        display: -webkit-inline-box;
        display: -ms-inline-flexbox;
        display: inline-flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        font-size: 1.6rem;
        line-height: 1.2;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }

    /*
     * main.css hides Sign up label ≤1632px but leaves min-width:138px —
     * empty orange pill next to "Log in". Force icon-only circle.
     */
    .dashboard__signup,
    .dashboard__signup_new {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        min-width: 0 !important;
        width: 50px !important;
        max-width: 50px !important;
        height: 50px;
        padding: 0 !important;
    }

    .dashboard__signup span,
    .dashboard__signup_new span {
        display: none;
    }

    .dashboard__cart {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }
}

/* Tighter laptop widths: still one row, slightly smaller type */
@media (min-width: 1024px) and (max-width: 1230px) {
    .header {
        padding: 18px 12px 16px;
        gap: 0 6px;
    }

    .header__block_1 {
        max-width: 130px;
    }

    .menuMain__item {
        padding: 0 4px;
    }

    .menuMain__item a,
    .menuMain__item a:visited {
        font-size: 1.4rem;
    }

    .sort_2__select .field {
        padding: 6px 18px 6px 6px;
        height: 32px;
        font-size: 1.25rem;
    }

    .dashboard {
        gap: 6px;
    }

    .dashboard__login {
        height: 44px;
        font-size: 1.5rem;
        padding: 0 2px;
    }

    .dashboard__signup,
    .dashboard__signup_new,
    .dashboard__cart {
        width: 44px !important;
        height: 44px;
        min-width: 0 !important;
        max-width: 44px !important;
        padding: 0 !important;
    }

    .dashboard__signup:before,
    .dashboard__signup_new:before {
        left: 7px;
    }
}
