/* ================= OVERLAY ================= */
#side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 9998;
}

#side-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ================= MENU ================= */
#side-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;

    width: 395px; /* 2 панелі */
    max-width: calc(100% - 40px);

    transform: translateX(-110%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;

    z-index: 9999;
}

#side-menu.open-second {
    width: calc(395px + 395px + 369px + 25px + 25px);
}

#side-menu.open {
    transform: translateX(0);
}

/* ================= INNER ================= */
.side-menu__inner {
    background: #fff;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;

    display: flex;
    flex-direction: column; /* залишаємо */
}

@media (max-width: 767px) {

    .side-menu__inner {
        border-radius: 0; /* тільки моб */
    }

}

.side-menu__body {
    display: flex;
    flex: 1;
}

/* ================= HEADER ================= */
.side-menu__header {
    display: flex;
    align-items: center;
    padding: 25px;
    gap: 10px;

    width: 395px;        /* ❗ ГОЛОВНЕ */
    flex-shrink: 0;      /* ❗ щоб не тягнувся */
}

.side-menu__title {
    font-size: 15px;
    font-weight: 500;
}

/* ================= DIVIDER ================= */
.side-menu__divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    width: 395px; /* тільки під перший блок */
}

.side-menu__body {
    position: relative;
}

.side-menu__body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 395px;
    right: 0;
    height: 1px;
    background: #fff; /* перекриваємо бордер справа */
    z-index: 2;
}

/* ================= BODY (2 PANELS) ================= */
.side-menu__body {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ================= PANELS ================= */
.side-menu__panel {
    width: 395px;
    flex-shrink: 0;
    height: 100%;
    background: #fff;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LEFT PANEL */
.side-menu__panel--left {
    transform: translateX(0);
}

/* RIGHT PANEL (hidden by default) */
.side-menu__panel--right {
    position: absolute;
    top: 0;
    left: 395px;
    width: 395px;
    height: 100%;
    background: #fff;

    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);

    border-left: 1px solid rgba(0,0,0,0.05);

    will-change: transform;
    backface-visibility: hidden;
}

#side-menu.open-second .side-menu__panel--right {
    width: calc(395px + 369px + 25px); /* список + банери */
}

#side-menu.open-second .side-menu__panel--right {
    transform: translateX(0);
}

/* ================= LEVEL ================= */
.side-menu__level {
    height: 100%;
    padding-top: 25px;
    overflow-y: auto;
}

.side-menu__level--1 {
    padding-top: 0;
}

/* ================= ITEM ================= */
.side-menu__item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    height: 38px;
    padding: 0 25px;

    font-size: 14px;
    font-weight: 500;
    cursor: pointer;

    margin-bottom: 10px;
    transition: 0.2s;
}

.side-menu__item:hover {
    opacity: 0.7;
}

/* ================= TEXT ================= */
.side-menu__text {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================= ARROW ================= */
.side-menu__arrow {
    margin-right: 0;
}

/* ================= PANEL RIGHT ================= */
.side-menu__panel-inner {
    height: 100%;
    display: flex;
    overflow: hidden;
    width: 100%;
}

.side-menu__panel-list {
    display: flex;
    flex-direction: column;
}

/* ================= BREADCRUMB STYLE ================= */
.side-menu__item.active-category {
    font-size: 18px;
    font-weight: 500;
}

.side-menu__item.active-category .side-menu__arrow {
    display: none;
}

.side-menu__item.active-category .side-menu__text {
    gap: 10px;
}

.side-menu__item.active-category .side-menu__text {
    align-items: center;
    line-height: 1;
}

/* ================= BACK ARROW ================= */
.side-menu__back-arrow {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* ================= SCROLL ================= */
.side-menu__level::-webkit-scrollbar,
.side-menu__panel-inner::-webkit-scrollbar {
    width: 4px;
}

.side-menu__level::-webkit-scrollbar-thumb,
.side-menu__panel-inner::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* ================= MOBILE ================= */
@media (max-width: 767px) {

    #side-menu {
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .side-menu__panel {
        width: 100%;
    }

}

.side-menu__panel--right {
    opacity: 0;
}

#side-menu.open-second .side-menu__panel--right {
    opacity: 1;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
/* ================= HOVER UNDERLINE ================= */

/* база для item */
.side-menu__item {
    position: relative;
}

/* сам текст */
.side-menu__text {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* лінія */
.side-menu__text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px; /* трохи більше, щоб не впливав */
    width: 100%;
    height: 1px;
    background: #000;

    transform: scaleX(0);
    transform-origin: left;

    transition: transform 0.3s ease;

    pointer-events: none;
}

/* hover ефект */
.side-menu__item:hover .side-menu__text::after {
    transform: scaleX(1);
}

.side-menu__item.active-category .side-menu__text::after {
    transform: scaleX(0);
}

/* ================= BREADCRUMB TOP ================= */

.side-menu__breadcrumb {
    padding: 25px 25px; /* зверху і знизу по 25 */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0; /* прибираємо зайвий відступ */
}

.side-menu__breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
}
.side-menu__level--1 .side-menu__breadcrumb + .side-menu__item {
    margin-top: 25px;
}

/* ================= RIGHT BANNERS ================= */

.side-menu__banners {

    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-menu__banner {
    position: relative;
    display: block;
    width: 100%;
}

.side-menu__banner img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    border-radius: 2px;
}

/* текст на фото */
.side-menu__banner-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;

    color: #fff;
    font-size: 16px;
    font-weight: 500;

    border-bottom: 1px solid #fff;
    padding-bottom: 3px;
}

/* ================= RIGHT PANEL GRID ================= */

.side-menu__panel-content {
    display: flex;
    gap: 25px;
    height: 100%;
    min-width: calc(395px + 369px + 25px); /* ❗ КЛЮЧОВЕ */
}

/* список категорій */
.side-menu__panel-list {
    width: 395px;
    flex-shrink: 0;
    padding-top: 90px; /* 🔥 головне */
}

/* блок банерів */
.side-menu__banners {
    width: 369px;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding-top: 25px;
    margin-right: 25px; /* ← ОСЬ ЦЕ ДОДАЙ */
}

/* банер */
.side-menu__banner img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    border-radius: 6px;
}
/* 🔥 ФІКС HEADER ТІЛЬКИ ДЛЯ ЛІВОЇ КОЛОНКИ */

.side-menu__header,
.side-menu__divider {
    width: 395px;
    flex-shrink: 0;
}

/* щоб правий блок не залазив під header */
.side-menu__body {
    display: flex;
    flex: 1;
}

/* ❗ ключ — відрізаємо header від правої частини */
.side-menu__body {
    margin-top: -1px; /* прибирає візуальний зсув */
}

/* ================= SMOOTH SWITCH LEVEL 2 ================= */

#side-menu-children {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#side-menu-children.is-changing {
    opacity: 0;
    transform: translateX(15px);
}

/* ================= EXTRA BLOCK ================= */

.side-menu__extra-divider {
    width: 395px;
    height: 1px;
    background: rgba(0,0,0,0.05);

    margin-top: 25px;
}

.side-menu__extra {
    padding-top: 25px;
}

.side-menu__extra-item {
    margin-bottom: -5px;
}

/* 🔥 тільки для тексту цих пунктів */
.side-menu__extra-item .side-menu__text {
    font-size: 13px;
    color: #484848;
}
/* 🔥 тільки для нижніх пунктів */
.side-menu__extra-item {
    height: 30px; /* було 34px */
    margin-bottom: 0; /* можна залишити 0 */
}
/* ================= LANG / CURRENCY ================= */

.side-menu__lang-currency {
    /*padding: 25px;*/
    padding: 25px 25px 0 25px;
}

.side-menu__lc-block {
    position: relative;
    margin-bottom: 12px;
}

.side-menu__lc-title {
    font-size: 11px;
    color: #7B7B7B;
    font-weight: 500;
    margin-bottom: 0;
}

.side-menu__lc-select {
    display: inline-flex;
    align-items: center;
    height: 26px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.side-menu__lc-arrow {
    margin-left: 6px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.side-menu__lc-arrow svg {
    width: 12px;
    height: 12px;
    display: block;
}

.side-menu__lc-select.open .side-menu__lc-arrow {
    transform: rotate(180deg);
}

.side-menu__lc-select::after {
    display: none !important;
}

/* dropdown */
.side-menu__lc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;

    min-width: 86px;
    max-width: 140px;

    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);

    padding: 10px 16px;

    display: none;
    flex-direction: column;
    gap: 8px;

    z-index: 100;
}

.side-menu__lc-dropdown.open {
    display: flex;
}

.side-menu__lc-dropdown a {
    font-size: 13px;
    color: #333;
    text-decoration: none;
    padding: 0;
    line-height: 1.4;
}

.side-menu__lc-dropdown a:hover {
    opacity: 0.6;
}

.side-menu__country-fixed {
    position: static;
    margin: auto 20px 25px 20px;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    #side-menu.open{
        transform: initial !important;
        height: 100% !important;
    }
    .side-menu__panel, .side-menu__header, .side-menu__divider{
        width: 100% !important;
    }

    .side-menu__country-fixed {
        position: static;              /* 🔥 прибираємо fixed */
        margin: 12px 20px 20px;        /* 🔥 ближче до валюти */
    }

}

.side-menu__panel--left {
    position: relative;
}

/* BUTTON */
.side-menu__country-btn {
    background: #F7F7F7;
    border-radius: 8px;

    padding: 8px 12px;

    cursor: pointer;
}

/* TITLE */
.side-menu__country-title {
    font-size: 11px;
    color: #7B7B7B;
    font-weight: 500;
}

/* CURRENT */
.side-menu__country-current {
    margin-top: 4px;

    display: flex;
    align-items: center;
    gap: 0px;

    font-size: 13px;
    color: #392819;
    font-weight: 500;
}

.side-menu__panel--left {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto; /* 🔥 ключ */
}

.side-menu__level--1 {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    overflow-x: hidden;
}

@media (max-width: 767px) {

    .side-menu__level--1 {
        transition: transform 0.3s ease, opacity 0.25s ease;
        will-change: transform;
    }

    .side-menu__level--1.is-changing {
        transform: translateX(20px);
        opacity: 0;
    }

}

@media (max-width: 767px) {

    .side-menu__level--1 {
        transition: transform 0.35s ease, opacity 0.25s ease;
        will-change: transform;
    }

    /* 👉 вихід вправо */
    .side-menu__level--1.is-changing-back {
        transform: translateX(40px);
        opacity: 0;
    }

    /* 👉 перед появою (зліва) */
    .side-menu__level--1.is-pre-enter {
        transform: translateX(-40px);
        opacity: 0;
    }

}

@media (max-width: 767px) {

    /* 👉 вперед (виїзд вліво) */
    .side-menu__level--1.is-changing-forward {
        transform: translateX(-40px);
        opacity: 0;
    }

    /* 👉 новий заходить справа */
    .side-menu__level--1.is-pre-enter-forward {
        transform: translateX(40px);
        opacity: 0;
    }

}
@media (max-width: 767px) {

    .side-menu__lang-currency {
        padding-bottom: 12px; /* 🔥 замість 25 */
    }

    .side-menu__country-fixed {
        position: static;
        margin: 0 20px 20px; /* 🔥 без верхнього відступу */
    }

}

@media (max-width: 767px) {

    /* прибираємо зайвий відступ у валюті */
    .side-menu__lang-currency .side-menu__lc-block:last-child {
        margin-bottom: 0;
    }

    /* контролюємо відстань */
    .side-menu__lang-currency {
        padding-bottom: 12px;
    }

    .side-menu__country-fixed {
        position: static;
        margin: 0 20px 20px;
        margin-bottom: 80px;
    }
    .side-menu__panel--left{
        overflow: initial !important;
    }

}

@media (min-width: 768px) {

    #side-menu-overlay {
        background: rgba(0,0,0,0.10); /* як у інших попапах */
        backdrop-filter: blur(7.5px);
        -webkit-backdrop-filter: blur(7.5px); /* Safari */
    }

}

@media (min-width: 768px) {

    .side-menu__panel--left {
        overflow-y: auto !important;
        overflow-x: hidden;
    }

}

/* ================= SCALE MENU ================= */

/* 1440 */
@media (max-width: 1500px) {
    #side-menu {
        transform: scale(0.9) translateX(-110%);
        transform-origin: top left;
    }

    #side-menu.open {
        transform: scale(0.9) translateX(0);
        height: calc(111% - 40px);
    }
    /*.side-menu__level{
        height: 91%;
    }*/
}

/* 1280 */
/* 1280 — РОЗТЯГУЄМО МЕНЮ */
@media (max-width: 1300px) {
    #side-menu.open {
        transform: scale(0.8) translateX(0);
        height: calc(124% - 40px);
    }
    #side-menu.open-second{
        width: calc(525px + 395px + 369px + 25px + 25px);
    }
    #side-menu.open-second .side-menu__panel--right{
        width: 100%;
    }
    /*.side-menu__banners{
        flex-shrink: initial;
    }*/
    #side-menu {
        width: 460px; /* було 395 */
        transform: scale(0.9) translateX(-110%);
        transform-origin: top left;
    }


    /* всі панелі теж */
    .side-menu__panel,
    .side-menu__header,
    .side-menu__divider {
        width: 460px;
    }

    /* права частина */
    .side-menu__panel--right {
        left: 460px;
    }

    .side-menu__panel-list {
        width: 460px;
    }

    .side-menu__panel-content {
        min-width: calc(460px + 320px + 20px);
    }
}
#side-menu,
#side-menu * {
    box-sizing: border-box;
}