/* ============================================
   MENU WRAP - Megamenu (две колонки по 30%)
   ============================================ */

/* Мобильный переключатель (скрыт на десктопе) */
.main-menu-mobile-toggle {
    display: none;
}

/* Megamenu контейнер */
.main-menu {
    position: relative;
    z-index: 100;
}

/* Две колонки: основное меню + подменю */
.main-menu__columns {
    margin: 0 auto;
    display: flex;
    overflow: hidden;
    overflow: hidden;
    max-width: 1590px;
}

/* Левая колонка - основное меню */
.main-menu__column {
    width: 100%;
    max-width: 400px;
    max-height: 500px;
    overflow-y: scroll;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: #363636 #b5b5b5;;
}

.main-menu__column:last-child {
    border-right: none;
}

/* Правая колонка - подменю (скрыта по умолчанию) */
.main-menu__submenu-column {
    width: 100%;
    max-width: 500px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    flex-shrink: 0;
    padding: 15px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 10px 10px 0;
    display: none;
}

/* Правая колонка видима */
.main-menu__submenu-column_visible {
    display: block;
}

.main-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-menu__item {
    position: relative;
}

.main-menu__item:hover {
    background-color: #E9EDF6;
}

.main-menu__item:last-child {
    border-bottom: none;
}

.main-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.main-menu__link_active {
    background-color: #E9EDF6;
}

/* Скрываем мобильный аккордеон на десктопе */
.main-menu__submenu {
    display: none;
}

/* Стрелочка для пунктов с подпунктами */
.main-menu__item_has-children .main-menu__link::after {
    content: '›';
    font-size: 26px;
    color: #999;
    transition: transform 0.2s ease;
    position: absolute;
    right: 10px;
    top: 6px;
}

.main-menu__item:hover .main-menu__link::after {
    color: #007bff;
}

.main-menu__link_active .main-menu__link::after {
    color: #007bff;
}

.main-menu__item_has-children:hover .main-menu__link::after,
.main-menu__item_open .main-menu__link::after {
    transform: rotate(90deg);
}

/* Правая колонка - подменю */
.main-menu__submenu {
    width: 30%;
    max-height: 500px;
    overflow-y: auto;
    background: #fafafa;
}

.main-menu__sublist {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}


.main-menu__subitem:last-child {
    border-bottom: none;
}

.main-menu__sublink {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
    font-size: 14px;
}

.main-menu__sublink:hover,
.main-menu__sublink_active {
    background: #fff;
    color: #0066cc;
}

/* Скрытие правой колонки, если нет подпунктов */
.main-menu__submenu_empty {
    display: none;
}

.catalog-menu-gamb a {
    font-size: 18px;
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 1200px) {

    .main-menu__column,
    .main-menu__submenu-column {
        max-width: 50%;
    }

}

@media (max-width: 1200px) {
    .main-menu__columns {
        margin: 0 0px;
    }
}

@media (max-width: 768px) {
    .main-menu-mobile-toggle {
        display: flex;
        padding: 14px 16px;
        background: #f5f5f5;
        cursor: pointer;
        justify-content: space-between;
        align-items: center;
        font-weight: 500;
        border-radius: 4px;
    }

    .main-menu__column {
        max-width: 100%;
    }

    .main-menu__submenu-column {
        padding: 0px;
        display: none;
    }

    .main-menu__item {
        position: relative;
        border-bottom: 1px solid #f5f5f5;
    }

    .catalog-menu-gamb {
        background-color: white;
    }

    .main-menu__columns {
        margin: 0;
        display: flex;
        overflow-x: hidden;
        max-width: 100%;

    }

    .main-menu__item_open>.main-menu__link::after {
        transform: rotate(270deg) !important;
    }

    .main-menu__list li {
        background: white;
    }
    .main-menu__list li {
        display: block;
        padding: 0px 0px 10px 0;
        font-size: 12px;
    }
    .main-menu__columns {
        overflow-x: hidden;
    }

    .header_serch {
        max-width: 100%;
        width: 100%;
        position: relative;
    }

    .main-menu__submenu {
        display: block;
    }

    .main-menu-mobile-toggle__icon {
        width: 20px;
        height: 14px;
        position: relative;
    }

    .main-menu-mobile-toggle__icon::before,
    .main-menu-mobile-toggle__icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background: #333;
        transition: all 0.3s ease;
    }

    .main-menu-mobile-toggle__icon::before {
        top: 0;
    }

    .main-menu-mobile-toggle__icon::after {
        bottom: 0;
    }

    .main-menu-mobile-toggle.active .main-menu-mobile-toggle__icon::before {
        transform: rotate(45deg);
        top: 6px;
    }

    .main-menu-mobile-toggle.active .main-menu-mobile-toggle__icon::after {
        transform: rotate(-45deg);
        bottom: 6px;
    }

    .main-menu__column {
        width: 100%;
        max-height: none;
        border-right: none;
    }

    .main-menu__item {
        border-bottom: 1px solid #eee;
    }

    .main-menu__link {
        padding: 16px;
    }

    .main-menu__item_has-children .main-menu__link::after {
        transform: rotate(90deg);
    }

    .main-menu__item_open>.main-menu__link::after {
        transform: rotate(270deg);
    }

    /* Аккордеон для подпунктов */
    .main-menu__submenu {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: #f9f9f9;
        transition: max-height 0.3s ease;
    }

    .main-menu__item_open>.main-menu__submenu {
        max-height: 500px;
    }

    .main-menu__sublist {
        padding: 0;
    }

    .main-menu__sublink {
        padding: 14px 24px 14px 32px;
    }

    .catalog-menu-gamb a {
        font-size: 14px;
    }
}