/* --- 1. ОСНОВНОЙ КОНТЕЙНЕР И МОДАЛЬНОЕ ОКНО --- */

.mc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow-y: auto;
}

    .mc-overlay.active {
        display: block;
    }

.mc-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 40px 20px;
    position: relative;
    background: #f8f8f8;
    border-radius: 12px;
    font-family: Arial, sans-serif;
}

.mc-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* --- 2. СЕТКА И КОЛОНКИ --- */

.mc-main-title {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    color: #000;
}

.mc-main-title a {
    color: #000;
    text-decoration: none;
}

.mc-main-title a:hover {
    text-decoration: underline;
}

.mc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.mc-column {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.mc-column-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.mc-column-title a {
        color: #000;
        text-decoration: none;
}
.mc-column-title a:hover {
    text-decoration: underline;
}

/* --- 3. ЛОГИКА АККОРДЕОНА (КАТЕГОРИИ И ПОДГРУППЫ) --- */

/* Контейнер-обертка для каждого уровня, который можно раскрыть */
.mc-category-item {
    margin-bottom: 2px;
}

/* Строка заголовка (Флекс для текста + стрелки) */
.mc-title-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

    /* Стили ссылок в заголовках */
    .mc-title-row a {
        text-decoration: none;
        color: #000;
        margin-right: 10px;
    }

        .mc-title-row a:hover {
            text-decoration: underline;
        }

/* Иконка стрелочки */
.mc-toggle-icon {
    font-size: 20px;
    color: #888;
    transition: transform 0.3s ease;
    display: inline-block;
    padding: 4px;
}

/* Скрытый по умолчанию список */
.mc-list {
    display: none;
    list-style: none;
    padding-left: 18px; /* Сдвиг вправо для каждого уровня вложенности */
    margin: 0;
}

/* ГЛАВНОЕ: Показываем только ПРЯМОЙ вложенный список при открытии */
.mc-category-item.is-open > .mc-list {
    display: block !important;
}

/* Поворачиваем только ПРЯМУЮ стрелочку */
.mc-category-item.is-open > .mc-title-row .mc-toggle-icon {
    transform: rotate(180deg);
    color: #000;
}

/* --- 4. СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ РАЗНЫХ УРОВНЕЙ --- */

/* Уровень 1 (Одежда, Аксессуары, Девочки) */
.mc-subcategory-title a,
.mc-column-subtitle a {
    font-weight: 700;
    font-size: 17px;
}

/* Уровень 2 (Одежда внутри Девочек) */
.mc-list .mc-subcategory-title a {
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

/* Финальные ссылки на товары (которые уже никуда не ведут) */
.mc-link {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: #666;
    text-decoration: none;
}

    .mc-link:hover {
        color: #000;
        text-decoration: underline;
    }

/* Для админа*/
.mc-subclass-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-edit-input {
    font-size: 14px;
    padding: 2px 5px;
    border: 1px solid #ccc;
    width: 120px;
}

.mc-admin-btns i {
    cursor: pointer;
    font-size: 16px;
    vertical-align: middle;
}

.btn-add-sub-trigger {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    padding: 5px 0;
}

.btn-add-sub-trigger:hover { color: #333; }

/* --- 5. АДАПТИВНОСТЬ --- */

@media (max-width: 1100px) {
    .mc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .mc-grid {
        grid-template-columns: 1fr;
    }

    .mc-wrapper {
        margin: 10px;
        padding: 20px 10px;
    }
}
