/* === Контейнер карточек === */
h2 {
    text-align: center;
}
.category-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* === Карточка категории — ссылка === */
.category-card {
    width: 250px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* === Обёртка изображения — фиксированный размер 250×250 === */
.category-card__image-wrapper {
    width: 250px;
    height: 250px;
    overflow: hidden;
    position: relative;
}

/* === Изображение === */
.category-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* === Эффект при наведении на изображение === */
.category-card:hover .category-card__image {
    transform: scale(1.05);
}

/* === Заглушка, если нет изображения === */
.category-card__image--placeholder {
    background-color: #f3f4f6;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card__image--placeholder::after {
    content: "Нет изображения";
    font-size: 14px;
    color: #9ca3af;
}

/* === Текстовая часть === */
.category-card__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

/* === Название категории === */
.category-card__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* === Кнопка "Перейти" === */
.category-card__button {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
    background-color: #3b82f6;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.category-card:hover .category-card__button {
    background-color: #2563eb;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .category-cards {
        gap: 20px;
        padding: 30px 16px;
    }

    .category-card {
        width: 100%;
        max-width: 250px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .category-cards {
        justify-content: center;
    }

    .category-card {
        width: calc(50% - 12px);
    }
}

@media (min-width: 1025px) {
    .category-cards {
        justify-content: center;
    }
}
