/* Header, navigation, search, mobile drawer and account dropdown */
.top-strip {
    height: 30px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, .9);
    background: linear-gradient(90deg, var(--primary-deep), var(--primary), #825fff);
    font-size: 12px;
    font-weight: 700
}

.top-strip .ss-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.top-strip__left,
.top-strip__right {
    display: flex;
    align-items: center;
    gap: 18px
}

.top-strip i {
    margin-right: 5px
}

.top-strip a:hover {
    color: #fff
}

body.drawer-open {
    overflow: hidden
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 26px rgba(45, 31, 88, .055);
    backdrop-filter: blur(16px)
}

.site-header>.ss-container {
    position: relative
}

.header-row {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 18px
}

.menu-button,
.header-icon,
.header-search-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border: 1px solid #ebe7f3;
    border-radius: 12px;
    background: #fff;
    color: #4e465d;
    font-size: 19px;
    transition: background .2s, color .2s, border-color .2s, transform .2s
}

.menu-button:hover,
.header-icon:hover,
.header-search-toggle:hover,
.header-search-toggle[aria-expanded="true"] {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #d9ceff;
    transform: translateY(-1px)
}

.brand-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0
}

.brand-logo img {
    display: block;
    width: 175px;
    height: auto;
    max-height: 53px;
    object-fit: contain
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    margin-left: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap
}

.desktop-nav::-webkit-scrollbar {
    display: none
}

.desktop-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 10px 11px;
    border-radius: 11px;
    color: #5d566b;
    font-size: 13px;
    font-weight: 800;
    transition: background .2s, color .2s
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--primary);
    background: var(--primary-soft)
}

.desktop-nav .deal-link {
    color: #df3d54;
    background: #fff0f3
}

.header-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 9px;
    margin-left: auto
}

.header-search-toggle {
    cursor: pointer
}

.header-action-wrap {
    position: relative;
    display: inline-flex;
    text-decoration: none
}

.header-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 43px;
    padding: 0 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(109, 66, 245, .16)
}

.login-button:hover {
    color: #fff
}

/* Search panel is hidden by default and opens under the entire header */
.header-search-panel[hidden] {
    display: none !important
}

.header-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1150;
    padding: 16px;
    background: #fff;
    border: 1px solid #ebe6f7;
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 20px 35px rgba(41, 29, 88, .16)
}

.header-search-panel-inner {
    display: flex;
    align-items: center;
    gap: 11px
}

.header-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0
}

.header-search {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #dcd5ef;
    border-radius: 13px;
    background: #faf9ff;
    transition: border-color .2s, box-shadow .2s
}

.header-search:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 66, 245, .09)
}

.header-search>i {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 20px
}

.header-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 14px;
    font-weight: 600
}

.header-search input::placeholder {
    color: #a29baa
}

.header-search-submit {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 800
}

.header-search-close {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border: 0;
    border-radius: 12px;
    background: #f3effb;
    color: #756c87;
    font-size: 20px
}

.header-search-results {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    display: none;
    max-height: min(55vh, 420px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-md);
    z-index: 1160
}

.header-search-wrap.is-open .header-search-results {
    display: block
}

.search-result {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1eef6
}

.search-result:last-child {
    border-bottom: 0
}

.search-result:hover {
    background: var(--primary-faint)
}

.search-result img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: #f3f0f8
}

.search-result strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px
}

.search-result small {
    color: var(--muted);
    font-size: 11px
}

.search-result__price {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    width: 330px;
    max-width: 90vw;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-md)
}

.header-action-wrap.is-open .notification-panel {
    display: block
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line)
}

.notification-head strong {
    font-size: 14px
}

.notification-head a {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800
}

.notification-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 9px;
    padding: 11px 14px;
    border-bottom: 1px solid #f2eff6
}

.notification-item:hover {
    background: var(--primary-faint)
}

.notification-symbol {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft)
}

.notification-item strong {
    display: block;
    font-size: 11px
}

.notification-item span span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4
}

/* Account actions and dropdown */
.header-user-dropdown {
    position: relative;
    min-width: 0
}

.header-user__profile-mobile {
    display: none !important
}

.header-user__profile--desktop {
    display: flex !important;
    align-items: center;
    gap: 9px;
    max-width: 210px;
    min-height: 43px;
    padding: 5px 10px 5px 6px;
    border: 1px solid #e5dfff;
    border-radius: 13px;
    background: linear-gradient(135deg, #fff, var(--primary-faint));
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: .2s ease
}

.header-user__profile--desktop:hover,
.header-user__profile--desktop[aria-expanded="true"] {
    color: var(--primary-dark);
    border-color: #d3c6ff;
    background: var(--primary-soft)
}

.header-user__avatar {
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--primary-soft)
}

.header-user__avatar-img,
.header-user-menu__avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit
}

.header-user__info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    line-height: 1.2
}

.header-user__info small {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600
}

.header-user__info strong {
    display: block;
    overflow: hidden;
    max-width: 130px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap
}

.header-user__chevron {
    flex: 0 0 auto;
    margin-left: auto;
    color: #9992a6;
    font-size: 10px;
    transition: transform .2s
}

.header-user__profile--desktop[aria-expanded="true"] .header-user__chevron {
    transform: rotate(180deg)
}

.header-user-menu {
    width: 290px;
    margin-top: 9px !important;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(45, 30, 90, .17);
    overflow: hidden
}

.header-user-menu__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px
}

.header-user-menu__avatar {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border: 2px solid #eee8ff;
    border-radius: 50%;
    background: var(--primary-soft)
}

.header-user-menu__head>div,
.header-user-menu__item>span:nth-child(2) {
    min-width: 0
}

.header-user-menu__head small {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px
}

.header-user-menu__head strong {
    display: block;
    max-width: 195px;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap
}

.header-user-menu__divider {
    height: 1px;
    margin: 4px 5px;
    background: var(--line)
}

.header-user-menu__item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 11px;
    color: var(--text);
    transition: .18s
}

.header-user-menu__item:hover {
    color: var(--primary);
    background: var(--primary-faint)
}

.header-user-menu__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 15px
}

.header-user-menu__item strong {
    display: block;
    color: inherit;
    font-size: 12px;
    font-weight: 800
}

.header-user-menu__item small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px
}

.header-user-menu__item .menu-arrow {
    color: #b0aab8;
    font-size: 10px
}

.header-user-menu__logout {
    color: #d73c54
}

.header-user-menu__logout .header-user-menu__icon {
    color: #d73c54;
    background: #fff0f3
}

.header-user-menu__logout:hover {
    color: #c72e46;
    background: #fff4f6
}

/* Drawer styles stay with the header because menuButton opens the drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    opacity: 0;
    visibility: hidden;
    background: rgba(17, 11, 31, .52);
    transition: .22s
}

.drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible
}

.menu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    width: min(86vw, 330px);
    overflow-y: auto;
    padding: 18px;
    background: #fff;
    box-shadow: 25px 0 60px rgba(33, 22, 66, .2);
    transform: translateX(-105%);
    transition: transform .26s
}

.menu-drawer.is-open {
    transform: translateX(0)
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px
}

.drawer-head img {
    width: 145px
}

.drawer-close {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft)
}

.drawer-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark))
}

.drawer-profile-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--primary);
    background: #fff
}

.drawer-profile strong {
    display: block;
    font-size: 12px
}

.drawer-profile small {
    color: rgba(255, 255, 255, .75);
    font-size: 10px
}

.drawer-label {
    margin: 19px 8px 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 10px;
    color: #5e5968;
    font-size: 12px;
    font-weight: 700
}

.drawer-link:hover {
    color: var(--primary);
    background: var(--primary-faint)
}

.drawer-link>i:first-child {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-soft)
}

.drawer-link .bi-chevron-right {
    margin-left: auto;
    font-size: 10px
}

.drawer-logout-link {
    margin-top: 6px;
    color: #cf3b50;
    background: #fff5f7
}

.drawer-logout-link>i:first-child {
    color: #d94158;
    background: #ffe9ed
}

.drawer-logout-link:hover {
    color: #fff;
    background: var(--danger)
}

.drawer-logout-link:hover>i:first-child {
    color: var(--danger);
    background: #fff
}

/* Responsive header */
@media(max-width:1250px) {
    .header-row {
        gap: 10px
    }

    .brand-logo img {
        width: 148px
    }

    .desktop-nav {
        gap: 1px;
        margin-left: 2px
    }

    .desktop-nav a {
        padding: 9px 8px;
        font-size: 11px
    }

    .header-actions {
        gap: 6px
    }

    .header-user__profile--desktop {
        max-width: 160px
    }

    .header-user__info strong {
        max-width: 83px
    }
}

@media(max-width:1050px) {
    .desktop-nav {
        display: none
    }

    .header-row {
        min-height: 66px;
        gap: 10px
    }

    .brand-logo img {
        width: 180px
    }

    .header-actions {
        margin-left: auto
    }
}

@media(max-width:900px) {
    .top-strip {
        display: none
    }

    .header-row {
            max-height: 50px;
    padding: 7px 0;
    gap: 8px;
    min-height: 50px;
    }

    .menu-button,
    .header-icon,
    .header-search-toggle {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        border-radius: 11px;
        font-size: 18px
    }

    .header-user__profile--desktop {
        display: none !important
    }

    .header-user__profile-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 39px;
        height: 39px;
        min-width: 39px;
        padding: 0;
        margin: 0;
        border: 1px solid #e6dfff;
        border-radius: 50%;
        background: #fff
    }

    .header-user__avatar-mobile {
        display: block;
        width: 35px;
        height: 35px;
        overflow: hidden;
        border-radius: 50%;
        background: var(--primary-soft)
    }

    .header-user__avatar-mobile img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%
    }

    .header-user-menu {
        right: 0 !important;
        left: auto !important;
        max-width: min(90vw, 290px)
    }

    .header-search-panel {
        padding: 12px
    }

    .header-search {
        height: 46px
    }
}

@media(max-width:600px) {
    .site-header>.ss-container {
        width: min(calc(100% - 18px), var(--container))
    }

    .header-row {
        gap: 5px
    }

    .brand-logo {
        flex: 0 1 auto
    }

    .brand-logo img {
        width: clamp(108px, 30vw, 160px);
        max-width: 100%
    }

    .header-actions {
        gap: 4px
    }

    .menu-button,
    .header-icon,
    .header-search-toggle {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 16px;
        border-radius: 10px
    }

    .header-user__profile-mobile {
        width: 36px;
        height: 36px;
        min-width: 36px
    }

    .header-user__avatar-mobile {
        width: 32px;
        height: 32px
    }

    .login-button {
        min-height: 36px;
        padding: 0 9px;
        font-size: 11px;
        border-radius: 10px
    }

    .login-button span {
        display: none
    }

    .header-search-panel {
        left: -9px;
        right: -9px;
        padding: 10px;
        border-radius: 0 0 14px 14px
    }

    .header-search-panel-inner {
        gap: 7px
    }

    .header-search {
        height: 44px;
        padding: 0 10px;
        gap: 8px
    }

    .header-search input {
        font-size: 12px
    }

    .header-search-submit {
        padding: 0 10px;
        font-size: 11px
    }

    .header-search-close {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
        font-size: 17px
    }

    .search-result {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 7px;
        padding: 8px
    }

    .search-result img {
        width: 38px;
        height: 38px
    }

    .search-result__price {
        font-size: 11px
    }
}

@media(max-width:380px) {
    .brand-logo img {
        width: clamp(147px, 28vw, 120px)
    }

    .header-actions {
        gap: 3px
    }

    .menu-button,
    .header-icon,
    .header-search-toggle,
    .header-user__profile-mobile {
        width: 33px;
        height: 33px;
        min-width: 33px;
        flex-basis: 33px
    }

    .header-user__avatar-mobile {
        width: 29px;
        height: 29px
    }

    .login-button {
        min-height: 33px;
        padding: 0 8px
    }
}