/* --------------- Header --------------- */

.header {
    width: 100%;
    background-color: #ffffff;
    position: fixed;
    top: 0;
    z-index: 1060;
    padding-bottom: 10px;
}

/* When a side panel or sidebar is open, header goes under overlay */
.header.header--behind-overlay {
    z-index: 1040;
}

/* ---- Top Bar ---- */
.header_top-wrapper {
    background: var(--color-green-main);
    height: 32px;
    width: 100%;
}

.header_top {
    background: var(--color-green-main);
    color: #ffffff;
    font-size: 14px;
    line-height: 18px;
    font-weight: var(--font-weight-regular);
    max-width: 1450px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header_top span { white-space: nowrap; }

.header_lang a {
    border-left: 1px solid #ffffff;
    padding: 0 10px;
    color: #ffffff;
    font-weight: var(--font-weight-medium);
}
.header_lang a:first-child { border-left: none; }

/* ---- Middle Bar ---- */

.header_middle-wrapper {
    background: #ffffff;
    min-height: 46px;
    width: 100%;
    padding: 20px 0 0;
}

.header_middle {
    max-width: 1450px;
    height: 100%;
    margin: auto;
    display: flex;
    align-items: center;
}

.header_logo img { width: auto; height: 40px; }

/* ---- Catalog Button ---- */
.header-actions_button {
    background: var(--color-grey-light);
    border-radius: 8px;
    margin-left: 32px;
    padding: 12px;
    height: 100%;
    min-width: 260px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    line-height: 20px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    border: none;
}

.header-actions_button img {
    width: 14px;
    height: 14px;
}

/* ---- Header Catalog Dropdown (desktop only) ---- */
.header-catalog {
    position: static;
    margin-left: 32px;
}

.header-catalog .header-actions_button--desktop {
    margin-left: 0;
}

/* Catalog icon swap */
.catalog-icon {
    position: relative;
    display: inline-flex;
    width: 20px;
    height: 20px;
}
.catalog-icon img,
.catalog-icon_close {
    position: absolute;
    inset: 0;
    transition: opacity .25s, transform .25s;
    margin: auto;
}
.catalog-icon_close {
    opacity: 0;
    transform: rotate(-90deg);
}
.header-catalog--open .catalog-icon img {
    opacity: 0;
    transform: rotate(90deg);
}
.header-catalog--open .catalog-icon_close {
    opacity: 1;
    transform: rotate(0);
}


/* Dropdown */
.header-catalog_dropdown {
    position: fixed;
    top: 105px;
    left: 0;
    width: 100vw;
    z-index: 1000;
    padding-top: 0;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s ease, opacity .3s ease, visibility .3s;
    pointer-events: none;
}

.header-catalog--open .header-catalog_dropdown {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Backdrop */
.header-catalog_backdrop {
    display: none;
}

.header-catalog_dropdown .deskcat {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 0;
    margin: 0;
}

/* Two-panel layout: categories left, subcategories right */
.deskcat_layout {
    display: flex;
    max-width: 1450px;
    margin: 0 auto;
    height: auto;
    max-height: 60vh;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 50px;
}

.header-catalog_dropdown .deskcat_list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 0 0 350px;
    width: 500px;
    height: auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
    border-right: 1px solid #E5E7EB;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header-catalog_dropdown .deskcat_list::-webkit-scrollbar {
    display: none;
}

.header-catalog_dropdown .deskcat_item {
    position: relative;
}

.header-catalog_dropdown .deskcat_link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 5px;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header-catalog_dropdown .deskcat_link img {
    width: 20px;
    height: 20px;
    margin-right: 14px;
}

.header-catalog_dropdown .deskcat_item--active .deskcat_link,
.header-catalog_dropdown .deskcat_link:hover {
    background: #F3F4F6;
    color: var(--color-green-main);
    border-radius: 4px;
}

.header-catalog_dropdown .deskcat_link-text {
    flex: 1;
    /* white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; */
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    line-height: 22px;
}

.header-catalog_dropdown .deskcat_arrow {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #ABABAB;
    border-bottom: 1.5px solid #ABABAB;
    transform: rotate(-45deg);
    margin-left: 10px;
    transition: border-color 0.15s;
}

.header-catalog_dropdown .deskcat_item--active .deskcat_arrow,
.header-catalog_dropdown .deskcat_link:hover .deskcat_arrow {
    border-color: var(--color-green-main);
}

/* ---- Right panels: subcategories ---- */
.deskcat_panels {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow-y: auto;
    height: 100%;
}

.deskcat_panel {
    display: none;
    padding: 24px 0 24px 32px;
    gap: 24px;
}

.deskcat_panel--active {
    display: flex;
}

.deskcat_panel .deskcat_mega-inner {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px 32px;
    align-content: start;
}

.deskcat_panel .deskcat_mega-col {
    min-width: 0;
}

.deskcat_panel .deskcat_mega-title {
    display: block;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: #191919;
    margin-bottom: 8px;
    text-decoration: none;
}

.deskcat_panel a.deskcat_mega-title:hover {
    text-decoration: underline;
    color: var(--color-green-main);
}

.deskcat_panel .deskcat_mega-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deskcat_panel .deskcat_mega-list li {
    margin-bottom: 5px;
}

.deskcat_panel .deskcat_mega-list a {
    font-size: 14px;
    font-weight: var(--font-weight-regular);
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}

.deskcat_panel .deskcat_mega-list a:hover {
    color: var(--color-green-main);
}

/* Promo card inside panel */
.deskcat_panel .deskcat_mega-promo {
    border: 1px solid var(--color-grey-light);
    box-shadow: 0 2px 6px 0 var(--color-grey-light);
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    height: 400px;
    width: 250px;
}

.deskcat_panel .deskcat_mega-promo_title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    font-size: 18px;
    line-height: 22px;
}

.deskcat_panel .deskcat_mega-promo_img {
    max-width: 140px;
    margin: auto 0;
}

.deskcat_panel .deskcat_mega-promo_link {
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    line-height: 28px;
    color: var(--color-text);
    border-bottom: 1px solid grey;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.4px;
    text-decoration: none;
    margin-top: auto;
}

/* ---- Search ---- */
.header-search_form {
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
    display: flex;
    height: 100%;
    border: 1px solid #000000AD;
}

.header-search_input {
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    line-height: 1;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    padding: 0 12px;
    background: transparent;
    border: none;
    outline: none;
    border-radius: 8px 0 0 8px;
}

.header-search_input::placeholder {
    color: var(--color-text);
    opacity: 0.5;
    font-weight: var(--font-weight-regular);
    font-size: 16px;
    line-height: 24px;
}

.header-search_submit {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--color-green-main);
    border: none;
    outline: 0;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    gap: 12px;
    transition: background 0.3s;
}

.header-search_submit img  {
    width: 15px;
    height: 15px;
}

.header-search_submit span {
    color: #ffffff;
    font-weight: var(--font-weight-medium);
    font-size: 14px;
}


/* ---- Header Actions ---- */

.header-search-wrapper {
    margin: 0 20px;
    position: relative;
}

/* ---- Search Dropdown ---- */
.header-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #000000AD;
    border-radius: 8px;
    z-index: 1000;
    overflow-y: auto;
}

.search-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s;
    border-bottom: 1px solid #F0F2F3;
}

.search-dropdown__item:last-child {
    border-bottom: none;
}

.search-dropdown__item:hover {
    background: #44564330;
    color: var(--color-green-main);
}

.search-dropdown__item--active,
.search-dropdown__item--active:hover {
    background: #44564330;
    color: var(--color-green-main);
}

.search-dropdown__img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #F5F5F5;
}

.search-dropdown__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-dropdown__info {
    flex: 1;
    min-width: 0;
}

.search-dropdown__name {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-dropdown__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.search-dropdown__price-current {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--color-green-main);
}

.search-dropdown__price-old {
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.search-dropdown__all {
    display: block;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-green-main);
    text-decoration: none;
    border-top: 1px solid #E5E7EB;
    transition: background 0.15s;
}

.search-dropdown__all:hover {
    background: #44564330;
    color: var(--color-green-main);
}

.search-dropdown__empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--var-color-text);
}

.header-actions {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 22px;
}

.header-actions_item { 
    position: relative; 
    width: 20px;
    height: 20px;
}

.header-actions_counter {
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 10px;
    height: 14px;
    text-align: center;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-rose);
    border: 1px solid var(--color-rose);
    border-radius: 7px;
    min-width: 14px;
    padding: 2px;
    position: absolute;
    top: 0;
    right: -2px;
    pointer-events: none;
}

/* ---- Close / Back ---- */
.header-ico--close,
.header-nav .header-ico--back {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    position: relative;
    cursor: pointer;
}

.header-nav .header-ico--back,
.header-nav .header-ico--close {
    width: 38px;
    height: 38px;
    position: relative;
}

.header-ico--close::before,
.header-ico--close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 2px;
    background-color: #191919;
    border-radius: 1px;
}

.header-ico--close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.header-ico--close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.header-nav .header-ico--back::after {
    content: "";
    display: block;
    width: 80%;
    height: 80%;
    /* background-color: #191919; */
}

/* ---- Mobile Navigation ---- */
.header-nav,
.mobmenu_dropdown {
    display: flex;
    flex-direction: column;
    width: 500px;
    max-width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1100;
    overflow: hidden;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.mobmenu_dropdown {
    transform: translateX(100%);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
}

.header-nav { clip-path: inset(0 0 0 0); }
.header-nav_header { background: #fff; }
.header-nav.submenu-open { overflow: hidden; }

.header-nav.active,
.mobmenu_title.active ~ .mobmenu_dropdown {
    visibility: visible;
    transform: translateX(0);
    background: #fff;
}

.header-nav_list {
    flex: 1 0 0;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
}

.header-nav_list li:first-child:not(.mobmenu_item) {
    border-bottom: 1px solid #eee;
}

.mobmenu_item { margin-bottom: 16px; }

.mobmenu_icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex: 0 0 auto;
    object-fit: contain;
}

.mobmenu_title,
.mobmenu_item a {
    font-size: 18px;
    font-weight: var(--font-weight-regular);
}

.mobmenu_title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.mobmenu_title img {
    width: 16px;
    height: 16px;   
}

.mobmenu_item > a {
    display: flex;
    align-items: center;
}

.mobmenu_dropdown-header {
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding-bottom: 8px;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
}

.mobmenu_dropdown-header button { flex: 0 0 auto; }
.mobmenu_dropdown-item:not(:last-child) { margin-bottom: 16px; }

/* ---- Sidebar (cart / fav / signin) ---- */
.header-sidebar {
    display: flex;
    flex-direction: column;
    width: 480px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    position: fixed;
    top: 0;
    right: 0;
    z-index: -1;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    padding: 28px 32px;
    box-shadow: -4px 0 30px rgba(0,0,0,0.08);
    overflow-y: auto;
}

.header-sidebar.active {
    z-index: 1200;
    transform: translateX(0);
}

.header-sidebar_top {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.header-sidebar_title-text {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.header-sidebar_top .header-ico--close {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.header-sidebar_cart {
    display: flex;
    flex-direction: column;
    padding: 0 18px 30px;
}

.header-sidebar_cart-item {
    display: flex;
    border-bottom: 1px solid #D7CFCF;
    padding: 0 30px 14px 0;
    margin-bottom: 14px;
    position: relative;
}

.header-sidebar_cart-item .header-ico--close {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 0;
    right: 0;
}

.header-sidebar_cart-item-img {
    flex: 0 0 auto;
    width: 130px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F5F5F5;
    border-radius: 12px;
}

.header-sidebar_cart-item-img img { max-height: 100%; }

.header-sidebar_cart-item-info {
    padding-left: 12px;
    padding-right: 8px;
}

.header-sidebar_cart-item-title,
.header-sidebar_cart-item-price {
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    line-height: 1.2;
    display: block;
    max-width: 256px;
    margin-bottom: 16px;
}

.header-sidebar_cart-item-price s { color: #717171; display: inline-block; margin-right: 8px; }
.header-sidebar_cart-item-price s ~ * { color: #DF4033; }

.header-sidebar_cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.header-sidebar_cart-total-title,
.header-sidebar_cart-total-price {
    font-weight: var(--font-weight-medium);
    font-size: 32px;
    line-height: 1.2;
}

.header-sidebar_cart-total-price { font-size: 24px; }

/* Sidebar tabs */
.header-sidebar_tabs {
    display: flex;
    /* overflow-x: auto; */
    padding: 12px 0 0;
    gap: 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 24px;
}

.header-sidebar_tabs a {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    padding: 0 0 14px;
    margin: 0 20px 0 0;
    position: relative;
    color: var(--color-text);
    transition: color 0.2s;
}

.header-sidebar_tabs a.active { color: var(--color-green-main); }
.header-sidebar_tabs a:hover { color: var(--color-green-main); }

.header-sidebar_tabs a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-green-main);
    position: absolute;
    bottom: -1px;
    left: 0;
    transition: width 0.3s;
}

.header-sidebar_tabs a.active::after { width: 100%; }
.header-sidebar_tabs a:hover::after { width: 100%; }

.header-sidebar_tab-content {
    display: none;
    overflow-y: auto;
}

.header-sidebar_tab-content.active {
    display: flex;
    flex-direction: column;
}

.header-sidebar_form {
    padding: 0;
}

.header-sidebar_cart-list { overflow-y: auto; }

/* ---- Mobile Catalog Button ---- */
.header-actions_button--mobile {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 14px;
    margin-left: 12px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: auto;
    height: auto;
}

.header-actions_button--mobile img {
    width: 14px;
    height: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .header_top { font-size: 12px; padding: 8px 4%; }

}

@media (max-width: 1199px) {
    /* Hide the inline desktop search form on mobile */
    .header-search-wrapper { display: none !important; }
}

/* Mobile search bar form wrapper */
.mobile-search-bar_form-wrap {
    flex: 1;
    min-width: 0;
    margin: 0;
    position: relative;
    height: 46px;
    display: flex;
    align-items: center;
}
.mobile-search-bar_form-wrap .header-search_form {
    height: 46px;
}

/* Mobile search bar (replaces header middle row when active) */
.mobile-search-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0 4%;
    height: 100%;
    width: 100%;
    background: #ffffff;
}
.header.mobile-search-active .header_middle {
    display: none;
}
.header.mobile-search-active .mobile-search-bar {
    display: flex;
}
.mobile-search-bar_back {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--color-text);
}
@media (min-width: 1200px) {
    .mobile-search-bar { display: none !important; }
}

@media (max-width: 991px) {
    .mobile-search-bar_form-wrap .header-search_form {
        height: 36px;
    }
}

@media (max-width: 767px) {
    .header { padding-bottom: 6px; }
    .header_top-wrapper { height: 28px; }
    .header_top { font-size: 12px; padding: 6px 4%; }
    /* Hide middle text on small screens */
    .header_top > div:nth-child(2) { display: none; }

    .header_middle-wrapper { padding: 10px 0 0; }
    .header_middle { padding: 0 4%; flex-direction: row; justify-content: space-between; }
    .header_logo img { height: 36px; }

    .header-actions { gap: 16px; }
    .header-actions_item { width: 22px; height: 22px; }
    .header-actions_item img { width: 22px; height: 22px; }
}

@media (min-width: 768px) and (max-width: 1450px) {
    .header_middle, .header_top { padding: 0 10px; flex-direction: row; justify-content: space-between;}
}

@media (max-width: 575px) {
    .header_top { font-size: 11px; padding: 5px 3%; }
    .header_middle { padding: 0 3%; }
    .header_logo img { height: 32px; }
    .header-actions { gap: 12px; }
    .header-actions_button--mobile { 
        padding: 7px 10px; 
        font-size: 13px; 
        margin-left: 8px; 
        min-width: auto;
    }
}

@media (max-width: 400px) {
    .header_top { font-size: 10px; padding: 4px 2%; }
    .header_middle { padding: 0 2%; }
    .header-actions_button--mobile span { display: none; }
}

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

@media (min-width: 1200px) {
    .header-search_submit:hover { background: #344433; }
    .header-actions_item--search { display: none !important; }
}

@media (min-width: 1568px) {
    .header_logo img { max-height: 70px; }
    .header-ico { width: 45px; height: 45px; }
    .header-search_input { padding: 0 24px; }
}
