/* Глобальная настройка box-sizing */
body.no-scroll {
    overflow: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Модальное окно каталога */
/* Обертка модального окна */
.catalog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.catalog-modal.open {
    opacity: 1;
    visibility: visible;
}

/* Оверлей */


.catalog-modal.open .catalog-modal-overlay {
    opacity: 1;
}

/* Контент модального окна */




.catalog-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

}
.catalog-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    /* Начальное состояние: уменьшено и прозрачно */
    transform: translate(-85%, -45%) scale(0.1);
    width: min(1400px, 95vw);
    max-height: calc(100vh - var(--header-height, 0px) - 40px);
    min-height: 300px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Улучшенная многослойная тень с глубиной и мягкостью */
    box-shadow:
        0 25px 80px -15px rgba(0, 0, 0, 0.413),
        0 12px 30px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.12);
        opacity: 1;
    /* Плавная анимация с мягким "отскоком" */
    transition:
        opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Активное состояние — плавное увеличение до полного размера */
.catalog-modal.open .catalog-modal-content {
    opacity: 1;
    transform: translate(-50%, 0%) scale(1);
}

/* Шапка модального окна */
.catalog-modal-header {
    padding: 16px 24px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* border-bottom: 1px solid #eee; */
}

.catalog-modal-header h3 {
    margin: 0;
    font-size: 25px;
    font-weight: 600;
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    line-height: 1;
}
.btn-close:hover {
    color: #000;
}
/* Тело модального окна */
.catalog-modal-body {
    display: flex;
    /* Убираем min-height, чтобы не мешало адаптивности */
    flex-grow: 1; /* ← Позволяет растягиваться на доступное пространство */
    overflow: hidden; /* ← Чтобы прокрутка была только внутри */
}

/* Боковое меню */
.catalog-sidebar {
    width: 350px;
    background: #f8f9fa;
    padding: 0 6px;
    border-right: 1px solid #eee;
    overflow-y: auto; 
    flex-shrink: 0;

}

.catalog-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.catalog-sidebar li {
    margin-right: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 0px 16px;
    cursor: pointer;
    color: #333;
    position: relative;
}

.catalog-sidebar li:hover,
.catalog-sidebar li.active {
    background: #e9ecef;
    color: rgb(211, 37, 52);
}
.catalog-sidebar li:focus {
    outline: none;
}
/* Иконки в сайдбаре */
.catalog-sidebar li .category-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 4px;
    vertical-align: middle;
    object-fit: cover;
    filter: grayscale(100%) brightness(60%);
}
.catalog-sidebar li:hover .category-icon,
.catalog-sidebar li.active .category-icon {
    filter: none;
}
/* Основной контент каталога */
.catalog-content {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    overflow-y: auto; /* ← Прокрутка внутри основного контента */
    background: #f8f9fa;
    flex-grow: 1; /* ← Позволяет растягиваться */
    min-width: 0;
    height: auto;
}
.catalog-content:hover {
    box-shadow: 0 8px 24px rgba(211, 211, 211, 0.08);
}
.category-group {
    width: 300px !important;
    margin-right: 15px;
    margin-bottom: 15px;
    border: 1px solid rgb(230, 230, 230);
}
/* Группа подкатегорий — теперь это карточка */
.catalog-content .category-group {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    width: 25%;
    min-height: 295px;
    height: max-content;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* ← распределяем контент по вертикали */
    box-sizing: border-box;

}
.catalog-content .category-group:last-child {
    margin-right: 0;
}
/* Заголовок группы */
.catalog-content .category-group h4 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.category-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
    flex-grow: 1;
}
.category-group a {
    color: rgb(76, 76, 76);
}
.category-group a:hover {
    color: rgb(211, 37, 52);
}
/* Ссылки внутри элементов */
.category-group .subcategory-item a.column-category {
    color: black;
    text-decoration: none;
    display: block;
    font-size: 14px;
}
.category-group .subcategory-item a.column-category:hover {
    color: inherit;
    text-decoration: none;
}
/* Дополнительные улучшения */
.section-category {
    display: flex;
}
/* Защита от случайного применения стилей к другим img */
.catalog-sidebar li img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
}
.catalog-sidebar li {
    padding: 0 !important;
}

.category-block {
    height:67px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
}

.category-group h4:hover{
        color: rgb(211, 37, 52);
}

.category-block:hover,
.category-block.active {
    background-color: #f1f1f1;
    border-color: #fd0d0d;
}
.js-open-catalog{
    z-index: 100000 !important;
}