.bw-custom-header {
    position: relative;
    z-index: 100;
    width: 100%;
    background: #efefef;
    border-bottom: none;
    /* Ensure hardware acceleration for smooth transforms if needed later */
    will-change: transform;
}

/* 
 * STICKY HEADER STATES
 * Simplification: 
 * - .bw-sticky-header : The base class when header becomes "sticky" (fixed)
 * - .bw-header-hidden : State when scrolling DOWN (hides header)
 * - .bw-header-visible: State when scrolling UP (shows header)
 */

.bw-custom-header.bw-sticky-header {
    position: fixed;
    top: var(--bw-header-top-offset, 0px);
    left: 0;
    right: 0;
    z-index: 9998;

    /* Core transition for the slide effect */
    transition: transform 0.3s ease-in-out, background-color 0.3s ease;

    /* Initial state: visible (translateY 0) */
    transform: translateY(0);

    /* Visuals for sticky state */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hidden State: Slide Up */
.bw-custom-header.bw-sticky-header.bw-header-hidden {
    transform: translateY(-100%);
    pointer-events: none;
    /* Prevent clicks when hidden */
}

/* Visible State: Slide Down (Redundant if default is 0, but good for specificity) */
.bw-custom-header.bw-sticky-header.bw-header-visible {
    transform: translateY(0);
    pointer-events: auto;
}

/* Body Padding Compensation */
body.bw-sticky-header-active:not(.elementor-editor-active) {
    padding-top: var(--bw-header-body-padding, 0px);
}

/* LEGACY / HELPER CLASSES (Keep minimal set required for layout) */

.bw-custom-header__inner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 18px 28px;
    box-sizing: border-box;
}

.bw-custom-header__desktop {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    min-height: 54px;
}

.bw-custom-header__desktop-logo,
.bw-custom-header__desktop-right {
    flex: 0 0 auto;
}

.bw-custom-header__desktop-panel {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: 100%;
    box-sizing: border-box;
}

.bw-custom-header__desktop-center {
    min-width: 0;
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
}

.bw-custom-header__desktop-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

.bw-custom-header__desktop-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

/* Blur Effect Logic (Simplified) */
.bw-custom-header__desktop-panel.is-blur-enabled {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px) !important;
    background-color: transparent !important;
    padding: 10px;
    margin: 0;
    border-radius: 12px;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

@supports not (backdrop-filter: blur(20px)) {
    .bw-custom-header__desktop-panel.is-blur-enabled {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
}

.bw-custom-header__desktop-menu {
    min-width: 0;
}

.bw-custom-header__logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-decoration: none;
    line-height: 1;
}

.bw-custom-header__logo-image {
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.bw-custom-header__logo-fallback {
    display: inline-flex;
    width: 54px;
    height: 54px;
}

.bw-custom-header__logo-fallback svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bw-custom-header__mobile {
    display: none;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 54px;
    width: 100%;
    position: relative;
}

.bw-custom-header__mobile-left {
    justify-self: start;
    position: relative;
    z-index: 2;
}

.bw-custom-header__mobile-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.bw-custom-header__mobile-right {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.bw-custom-header .bw-header-search,
.bw-custom-header .bw-header-navshop,
.bw-custom-header .bw-header-navigation {
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
}

.bw-custom-header .bw-header-navshop .bw-navshop {
    width: max-content;
}

.bw-custom-header .bw-navigation__desktop .bw-navigation__list {
    gap: 24px;
}

.bw-custom-header .bw-navigation__link {
    color: #000000;
    white-space: nowrap;
}

.bw-custom-header .bw-navigation__link:hover,
.bw-custom-header .bw-navigation__link:focus-visible {
    color: #4a4a4a;
}

.bw-custom-header .bw-navshop__item,
.bw-custom-header .bw-navigation__link,
.bw-custom-header .bw-search-button__label {
    font-size: 24px;
    line-height: 1;
}

.bw-custom-header .bw-navshop__item {
    color: #000000;
}

.bw-custom-header .bw-navshop__item:hover,
.bw-custom-header .bw-navshop__item:focus-visible {
    color: #4a4a4a;
}

.bw-custom-header .bw-search-button__icon,
.bw-custom-header .bw-navshop__cart-icon,
.bw-custom-header .bw-navigation__toggle-icon {
    color: currentColor;
}

.bw-custom-header .bw-navigation__toggle,
.bw-custom-header .bw-navigation__close {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.bw-custom-header .bw-search-button {
    text-decoration: none;
    color: #000000;
}

.bw-custom-header .bw-search-button__label {
    padding: 10px 24px;
    color: #000000 !important;
}

.bw-custom-header .bw-search-button:hover,
.bw-custom-header .bw-search-button:focus,
.bw-custom-header .bw-search-button:focus-visible,
.bw-custom-header .bw-search-button:hover .bw-search-button__label,
.bw-custom-header .bw-search-button:focus .bw-search-button__label,
.bw-custom-header .bw-search-button:focus-visible .bw-search-button__label,
.bw-custom-header .bw-search-button:hover .bw-search-button__icon,
.bw-custom-header .bw-search-button:focus .bw-search-button__icon,
.bw-custom-header .bw-search-button:focus-visible .bw-search-button__icon {
    color: #000000 !important;
}

.bw-custom-header .bw-navshop__item+.bw-navshop__item {
    margin-left: 24px;
}

.bw-custom-header .bw-navigation__mobile-overlay {
    z-index: 99999;
}

@media (max-width: 1024px) {

    .bw-custom-header,
    .bw-custom-header.bw-sticky-header {
        background-color: #ffffff !important;
    }
}

@media (max-width: 767px) {
    .bw-custom-header__inner {
        padding: 14px 18px;
    }

    .bw-custom-header__mobile-right {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .bw-custom-header,
    .bw-custom-header.bw-sticky-header {
        transition: none !important;
    }
}