/* ============================================
   catalog-tree.css — Пуленепробиваемая версия
   ============================================ */

.catalog-page {
    padding: 8px 0 64px;
    color: #0f172a; /* Явный темный цвет текста для всей секции */
}

/* Анимация появления */
.catalog-page [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.catalog-page [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Шапка */
.catalog-header {
    max-width: 720px;
    margin: 0 auto 40px;
    text-align: center;
}
.catalog-header__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #0f172a; /* Темный заголовок */
}
.catalog-header__subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #475569; /* Серый подзаголовок */
}

/* Сетка */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Карточка категории */
.catalog-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0; /* Явная светлая граница */
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.catalog-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 12px 24px -8px rgba(38, 69, 147, 0.12);
    transform: translateY(-3px);
}

/* Верхняя часть карточки (ссылка) */
.catalog-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    text-decoration: none;
    color: #0f172a !important; /* !important перебивает глобальные белые ссылки */
    transition: background 0.2s ease;
}
.catalog-card__header:hover {
    background: #f8fafc;
}

/* ИКОНКА (Самое важное для видимости) */
.catalog-card__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff; /* Светло-синий фон */
    color: #264593;      /* Явный синий цвет иконки */
    transition: background 0.2s ease, color 0.2s ease;
}
.catalog-card__header:hover .catalog-card__icon {
    background: #264593;
    color: #ffffff;
}

/* 🔥 КРИТИЧЕСКИ ВАЖНО для SVG: */
.catalog-card__icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor; /* Использует цвет родителя (#264593 или #fff) */
    fill: none;           /* ЗАПРЕЩАЕМ белую заливку внутри иконки */
    stroke-width: 2;
}

.catalog-card__icon--default {
    background: #f1f5f9;
    color: #64748b;
}

/* Информация */
.catalog-card__info {
    flex: 1;
    min-width: 0;
}
.catalog-card__name {
    margin: 0 0 6px;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}
.catalog-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #eff6ff;
    color: #264593;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 99px;
}

/* Стрелка */
.catalog-card__arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.catalog-card__header:hover .catalog-card__arrow {
    color: #264593;
    transform: translateX(3px);
}

/* Тело карточки (описание) */
.catalog-card__body {
    padding: 0 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.catalog-card__body p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
}

/* Футер карточки (подкатегории) */
.catalog-card__footer {
    padding-top: 8px;
}
.catalog-card__sub-title {
    padding: 0 24px;
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

/* Ссылки на подкатегории */
.catalog-card__subs {
    display: flex;
    flex-direction: column;
}
.subcategory-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    text-decoration: none;
    color: #475569 !important; /* Перебиваем глобальные стили ссылок */
    font-size: 0.875rem;
    font-weight: 500;
    border-top: 1px solid #f1f5f9;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.subcategory-link:first-child {
    border-top: none;
}
.subcategory-link:hover {
    background: #f8fafc;
    color: #264593 !important;
    padding-left: 28px;
}
.subcategory-link__count {
    flex-shrink: 0;
    margin-left: 12px;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}
.subcategory-link:hover .subcategory-link__count {
    background: #eff6ff;
    color: #264593;
}

/* Адаптивность */
@media (max-width: 768px) {
    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .catalog-header {
        margin-bottom: 24px;
        text-align: left;
    }
}