/* ==========================================================================
   1. ОБЩИЕ НАСТРОЙКИ ВЫПАДАЮЩЕГО МЕНЮ
   ========================================================================== */
.header-menu__dropdown {
    position: fixed;
    left: 0;
    width: 100vw;
    background: #fff;
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
    display: none;
    z-index: 99999;
    border-top: 1px solid #eaeaea;
    max-height: 85vh; /* Ограничение высоты всего меню */
    overflow-y: auto;  /* Общий скролл меню вверх-вниз */
}

.header-menu__dropdown.active {
    display: block;
    animation: menuFadeIn 0.3s ease;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стилизация скроллбара всего меню */
.header-menu__dropdown::-webkit-scrollbar {
    width: 6px;
}
.header-menu__dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.header-menu__dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.header-menu__dropdown::-webkit-scrollbar-thumb:hover {
    background: #167f2b;
}

/* ==========================================================================
   2. СТРУКТУРА СЕКЦИЙ (СТРОКА: ЛЕВО + ПРАВО)
   ========================================================================== */
.header-menu__static-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.header-menu__row-section {
    display: flex;
    width: 100%;
    /*border-bottom: 1px solid #eaeaea;*/
    box-sizing: border-box;
}

.header-menu__row-section:last-child {
    border-bottom: none;
}

/* ЛЕВАЯ КОЛОНКА (34%) */
.header-menu__sidebar {
    width: 25%;
    border-right: 1px solid #eaeaea;
    padding: 20px 0; /* Базовый вертикальный отступ */
    box-sizing: border-box;
    flex-shrink: 0;
}

/* ПРАВАЯ КОЛОНКА (66%) */
.header-menu__content {
    width: 75%;
    padding: 20px 0 20px 40px; /* Тот же вертикальный отступ */
    box-sizing: border-box;
}

/* ==========================================================================
   3. ЗАГОЛОВКИ И ВЫРАВНИВАНИЕ
   ========================================================================== */

/* Название Level 2 (Слева) */
.header-menu__section-title {
    display: block;
    padding: 10px 20px; /* Паддинг 10px задает высоту строки */
    font-size: 18px;
    line-height: 1.2;
    color: #1a1a1a;
    text-decoration: none;
    transition: 0.2s ease;
}

.header-menu__section-title:hover {
    color: #167f2b;
    background: #f0f7f1;
}

/* Название Level 3 (Справа) */
.header-menu__l3-title {
    display: flex;
    align-items: flex-start;
    padding: 10px 20px;
    margin-left: -23px;        /* Отрицательный маржин работает */

    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.2;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease, color 0.2s ease;
}

.header-menu__l3-title span {
    color: #167f2b;
    margin-right: 6px;
    font-weight: 900;
}

/* Подсветка фона L3 (через JS при наведении на L2) */
.header-menu__l3-title.highlight {
    background-color: #f0f7f1;
}

/* Изменение цвета только при наведении на саму ссылку */
.header-menu__l3-title:hover {
    color: #167f2b !important;
}

/* ==========================================================================
   4. СЕТКА И МОДЕЛИ (LEVEL 4)
   ========================================================================== */
.header-menu__sub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 колонки в ряд */
    gap: 15px 10px;
}

.header-menu__col-l3 {
    display: flex;
    flex-direction: column;
}

.header-menu__l4-list {
    display: flex;
    flex-direction: column;
    padding-left: 12px;
    gap: 6px;
}

.header-menu__l4-item {
    font-size: 4px;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    transition: 0.2s;
}

.header-menu__l4-item:hover {
    color: #167f2b;
}

/* Кнопка "Показать еще" */
.header-menu__more-btn {
    background: none;
    border: none;
    padding: 6px 0;
    color: #167f2b;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    text-align: left;
    width: fit-content;
}

/* Состояния скрытых элементов */
.header-menu__l4-item--hidden { display: none !important; }
.header-menu__l4-item--show { display: block !important; animation: fadeInL4 0.2s ease forwards; }

@keyframes fadeInL4 { from { opacity: 0; } to { opacity: 1; } }

.header-menu__l3-title.disabled { color: #bababa; cursor: default; }

/* МОБИЛКА БЕЗ ИЗМЕНЕНИЙ (сокращено) */
@media (max-width: 600px) {
    .header-menu { display: none; }
    /* Стили вашего аккордеона остаются здесь без правок */
}

@media (min-width: 601px) { .header-menu-mob { display: none !important; } }
@media (max-width: 600px) { 
    .header-menu { display: none !important; } 
    .header-menu-mob { display: block !important; }
    .header-menu__dropdown-mob { top: 60px; }
}



/* ==========================================================================
   2. МОБИЛЬНАЯ ВЕРСИЯ (ИСПРАВЛЕННАЯ ЛОГИКА)
   ========================================================================== */
.header-menu__dropdown-mob { 
    position: fixed; left: 0; width: 100%; background: #fff; z-index: 100001; display: none; max-height: 90vh; overflow-y: auto; 
}
.header-menu__dropdown-mob.active { display: block !important; }

.mob-accordion { border-bottom: 1px solid #eaeaea; }
.mob-accordion__header { 
    padding: 0 0 0 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: #fff; color: #1a1a1a; min-height: 50px; 
}

/* ИКОНКА ПЛЮСИКА */
.mob-accordion__icon { position: relative; width: 14px; height: 14px; }
.mob-accordion__icon::before, .mob-accordion__icon::after { content: ''; position: absolute; background: #167f2b; transition: 0.3s; }
.mob-accordion__icon::before { width: 100%; height: 2px; top: 6px; left: 0; }
.mob-accordion__icon::after { width: 2px; height: 100%; left: 6px; top: 0; }

/* ПОВОРОТ ТОЛЬКО ДЛЯ ТЕКУЩЕГО ОТКРЫТОГО УРОВНЯ */
.mob-accordion.open > .mob-accordion__header .mob-accordion__icon::after { transform: rotate(90deg); opacity: 0; }

/* КОНТЕНТ АККОРДЕОНА */
.mob-accordion__content { 
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: #fcfcfc; 
}
/* РАСКРЫТИЕ ТОЛЬКО ПРЯМОГО НАСЛЕДНИКА */
.mob-accordion.open > .mob-accordion__content { max-height: 2500px; }

/* УРОВНИ */
.mob-level-1 > .mob-accordion__header { background: #f9f9f9; font-size: 18px; }
.mob-level-3 > .mob-accordion__header { padding-left: 30px; font-size: 15px; background: #fff; border-bottom: 1px solid #f9f9f9; }
.mob-level-3 .mob-accordion__sub-item { padding: 10px 0 10px 65px; font-size: 14px; color: #167f2b; border-bottom: 1px solid #eee; }

.mob-link-text { flex: 1; padding: 15px 0; cursor: pointer; }
.mob-link-text.disabled { color: #bababa !important; cursor: default; }
.mob-accordion__btn { width: 60px; height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-left: 1px solid #f0f0f0; }
