/* Секция категорий */
.categories-section {
    padding: 60px 0;
    background-color: #fff;
}

.section-title {

    margin-bottom: 40px;
    font-size: 32px;
    color: #003151;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Фиксированное количество колонок */
    gap: 20px;
}

/* Адаптивные стили для разных экранов */
@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 колонки на средних экранах */
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(1, 1fr); /* 2 колонки на планшетах */
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr; /* 1 колонка на мобильных */
    }
}

/* Карточка категории */
.category-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;

    height: 350px;
    transition: all 0.3s ease;
}

.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Фоновый градиент (всегда видимый) */
.category-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,.7), rgba(0,0,0,0));
    z-index: 2;
}

/* Дополнительное затемнение при hover */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    z-index: 4;
}

.category-title {
    margin: 0 0 10px;
    font-size: 22px;
}

.category-more {
    display: inline-block;
    padding: 8px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Hover эффекты */
.category-card:hover .category-overlay {
    opacity: 1;
}

.category-card:hover .category-content {
    transform: translateY(0);
}

.category-card:hover .category-more {
    opacity: 1;
    transform: translateY(0);
}

.category-content p {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all .3s ease;
}

/* При наведении — плавно открываем */
.category-card:hover .category-content p {
    opacity: 1;
    max-height: 200px;
}

