/*====================================*/
/*            BURGER MENU             */
/*====================================*/
/* =============================== */
/*      FIX POSITIONING ISSUES     */
/* =============================== */

.mega-menu-container.catalog.active {
    transform: translateX(0) !important;
    left: 0 !important;
}


/* Отключаем влияние родительских трансформаций */
.col-hoz,
.catalog-container,
.burger-menu,
.oc-menu.horizontal-menu {
    transform: none !important;
}

/* Гарантируем, что меню выходит за пределы родительских контейнеров */
.header-inner,
.container,
.container-inner,
.inner,
.inner-inner {
    overflow: visible !important;
}

/* Убираем любые ограничения по высоте */
.mega-menu-container.catalog,
.catalog__sidebar,
.catalog__content {
    height: calc(100vh - 109px) !important;
    max-height: none !important;
}

.fix-header .mega-menu-container.catalog,
.fix-header .catalog__sidebar,
.fix-header .catalog__content {
    height: calc(100vh - 65px) !important;
}
/* =============================== */
/*           OVERLAY                */
/* =============================== */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(19, 20, 19, 0.6);
    backdrop-filter: blur(4px);
    z-index: 8; /* ниже header */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* чтобы не блокировал клики, когда скрыт */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.header-nav {
    z-index: 9;
    position: relative;
}

/* =============================== */
/*           BURGER ICON            */
/* =============================== */
.burger-menu span {
    margin-left: 12px;
}

.burger-menu a {
    padding: 10px 16px 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 14px;
    line-height: 16px !important;
    border-radius: 20px;
    color: #131413;
    letter-spacing: 0.005em;
    transition: all 0.25s ease-in-out;
    position: relative;
    z-index: 1;
}

.btn-burger {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    height: 20px;
    width: 20px;
}

.btn-burger__line {
    height: 1px;
    width: 14px;
    display: block;
    background: #131413A3;
    position: absolute;
    bottom: 10px;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.btn-burger__line:before,
.btn-burger__line:after {
    content: "";
    height: 1px;
    width: 14px;
    display: block;
    background: #131413A3;
    position: absolute;
    left: 50%;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.btn-burger__line:before {
    top: -5px;
}

.btn-burger__line:after {
    top: 5px;
}

/* Анимация бургера в крестик */
.btn-burger.active .btn-burger__line {
    background: transparent;
}

.btn-burger.active .btn-burger__line:before {
    transform: translateX(-50%) rotate(45deg);
    top: 0;
}

.btn-burger.active .btn-burger__line:after {
    transform: translateX(-50%) rotate(-45deg);
    top: 0;
}

/* =============================== */
/*           MENU ITEMS             */
/* =============================== */
.horizontal-menu .li-top-item.has-child > a:before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: #EDE8EA;
    border-radius: 20px;
    z-index: -1;
}

.btn-burger .fa-angle-down:before,
.btn-burger .fa-angle-down:after {
    height: 1px;
    width: 14px;
    display: block;
    background: #131413A3;
    position: absolute;
    left: 50%;
    border-radius: 2px;
    transition: 0.3s ease-in-out;
    transform: translateX(-50%);
}

.btn-burger .fa-angle-down:before {
    content: "" !important;
}

.btn-burger .fa-angle-down:after {
}

/* =============================== */
/*           SIDE MENU              */
/* =============================== */
.mega-menu-container.catalog {
    display: flex !important;
    position: fixed !important;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
    left: -100% !important;
    height: calc(100vh - 100%) !important; /* Высота минус header */
    background: #fff !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
    z-index: 10000 !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 420px !important;
    overflow: visible !important;
    border: none !important;
}

.mega-menu-container.catalog * {
    box-sizing: border-box;
}

.mega-menu-container.catalog.active {
    transform: translateX(0);
    visibility: visible;
    left: 0 !important;
    top: 171px !important;
}

.fix-header .mega-menu-container.catalog.active {
    top: 90px !important;
}

/* =============================== */
/*           OVERLAY SIDEBAR        */
/* =============================== */
.catalog__close-space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(19, 20, 19, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.catalog__close-space-background.active {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

/* =============================== */
/*           SIDEBAR CONTENT        */
/* =============================== */
.catalog__sidebar,
.catalog__content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.catalog__sidebar {
    width: 100%;
    background: #f8f8f8;
}

.catalog__sidebar--list,
.catalog__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.catalog__sidebar--list {
    padding: 10px 0;
}

.catalog__list {
    padding: 10px 0;
}

.catalog__sidebar--item,
.catalog__item-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 14px 20px;
    color: #131413;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s;
}

.catalog__sidebar--item:hover,
.catalog__item-title:hover {
    background: #EDE8EA;
}

.catalog__sidebar--item.active,
.catalog__item-title.active {
    background: #EDE8EA;
    font-weight: 500;
}

.catalog__item-parent-title {
    position: relative;
    padding-right: 50px;
}

.catalog__item-toggle-nav,
.js-toggle-nav {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog__item-toggle-nav::after,
.js-toggle-nav::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #131413A3;
    border-bottom: 2px solid #131413A3;
    transform: rotate(-45deg);
    transition: transform 0.3s;
}

/* Подменю */
.catalog__list .catalog__list {
    display: none;
    background: #f9f9f9;
}

.catalog__list .catalog__list.active {
    display: block;
}

/* =============================== */
/*           CONTENT PANEL          */
/* =============================== */
.catalog__content {
    position: absolute;
    top: 0;
    left: 100%; /* справа от sidebar */
    width: 100%;
    height: 100%;
    background: #f8f8f8;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 10002;
    pointer-events: auto;
}

.catalog__content.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* Заголовок внутри контента */
.catalog__content-title {
    position: sticky;
    top: 0;
    background: #f8f8f8;
    padding: 20px 28px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #131413;
    z-index: 10;
    display: flex;
    align-items: center;
}

/* Кнопка "назад" */
.catalog__content-nav-back {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

/* =============================== */
/*           SCROLLBAR              */
/* =============================== */
.catalog__sidebar::-webkit-scrollbar,
.catalog__content::-webkit-scrollbar {
    width: 4px;
}

.catalog__sidebar::-webkit-scrollbar-track,
.catalog__content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.catalog__sidebar::-webkit-scrollbar-thumb,
.catalog__content::-webkit-scrollbar-thumb {
    background: #c1b17e;
    border-radius: 2px;
}

/* =============================== */
/*           MOBILE ADAPTATION      */
/* =============================== */
@media (max-width: 768px) {
    .mega-menu-container.catalog {
        width: 300px !important;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .mega-menu-container.catalog {
        width: 280px !important;
    }
}

/* Отключаем старые hover стили для catalog */
.horizontal-menu .li-top-item:hover .mega-menu-container.catalog {
    display: block !important;
    visibility: hidden;
}

.horizontal-menu .li-top-item:hover .mega-menu-container.catalog.active {
    visibility: visible;
}
