/* Оверлей — перекрывает страницу при открытии */
.overlay-panel {
    position: fixed;
    top: -100%; /* скрыт полностью */
    left: 0;
    width: 100%;
    max-height: 80vh; /* ограничение высоты */
    background: #fff; /* фон панели */
    z-index: 9999;
    transition: top 0.4s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);

    display: flex;
    flex-direction: column;
    overflow: hidden; /* внешняя область не скроллится */
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Внутренний скролл */
.overlay-panel-content {
    overflow-y: auto;
    height: 100%;
    padding: 20px;
}

/* Активное состояние — панель выезжает вниз */
.overlay-panel.active {
    top: 0;
}

/* Оверлей */
.overlay-panel {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    z-index: 9999;
    transition: top 0.4s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Внутренний скролл */
.overlay-panel-content {
    overflow-y: auto;
    height: 100%;
    padding: 20px;
}

/* Активное состояние */
.overlay-panel.active {
    top: 0;
}

.cat-menu {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
}

.cat-root {
    width: 240px;
}

.cat-root-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cat-root-title {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
    text-decoration: none;
}

.cat-root-title:hover {
    color: var(--main-color);
}

/* списки по умолчанию свернуты */
.cat-sublist,
.cat-subsublist {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

/* раскрытое состояние */
.cat-sublist.is-open,
.cat-subsublist.is-open {
    max-height: 1000px;
}

.cat-sub {
    margin-bottom: 4px;
}

.cat-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.cat-sub-link {
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
}

.cat-sub-link:hover {
    color: var(--main-color);
}

/* главные подкаты */
.cat-sub-main > .cat-sub-header > .cat-sub-link {
    font-weight: 600;
    color: #111827;
}

.cat-subsublist {
    margin: 4px 0 4px 10px;
}

.cat-subsub-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}

.cat-subsub-link:hover {
    color: var(--main-color);
}

/* кнопка сворачивания */
.cat-toggle {
    border: none;
    background: transparent;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #111827;
}

.cat-toggle-icon {
    pointer-events: none;
}