/* Базовые настройки */
.ih-categories-section {
    background-color: #ffffff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
}

.ih-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Трек для карточек. Центрирует элементы, если их мало */
.ih-categories-track {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; 
    gap: 15px;
    width: 100%;
}

/* Сама карточка */
.ih-cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 100%;
    flex: 0 1 150px; /* Ограничиваем базовый размер */
    max-width: 150px;
    padding: 25px 10px 20px;
    animation: ih-fade-up 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
    animation-delay: calc(var(--anim-order) * 0.08s);
    box-sizing: border-box;
}

/* Серый фон карточки (подложка) */
.ih-cat-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f7;
    border-radius: 24px;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Контейнер для плюсика или картинки */
.ih-cat-img-wrap {
    position: relative;
    z-index: 2;
    height: 100px; 
    display: flex;
    align-items: center; 
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
}

/* СТИЛИ ПЛЮСИКА (Заглушки) */
.ih-cat-plus {
    font-size: 70px;
    font-weight: 200;
    line-height: 1;
    color: #d2d2d7;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Изображение категории */
.ih-cat-img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Текст категории */
.ih-cat-title {
    position: relative;
    z-index: 2;
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    text-align: center;
    transition: color 0.3s ease;
}

/* ======= ЭФФЕКТЫ ПРИ НАВЕДЕНИИ (HOVER) ======= */
.ih-cat-card:hover .ih-cat-bg {
    background-color: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.03);
}

.ih-cat-card:hover .ih-cat-plus {
    transform: scale(1.3) translateY(-8px);
    color: #e3001b; 
    text-shadow: 0px 10px 15px rgba(227, 0, 27, 0.2);
}

.ih-cat-card:hover .ih-cat-img {
    transform: scale(1.15) translateY(-6px);
}

.ih-cat-card:hover .ih-cat-title {
    color: #e3001b; 
}

/* Анимация появления */
@keyframes ih-fade-up {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ======= АДАПТИВНОСТЬ ======= */
@media (max-width: 1024px) {
    .ih-categories-track {
        gap: 20px;
    }
    .ih-cat-card { flex: 0 1 calc(25% - 20px); max-width: none; } 
}

@media (max-width: 768px) {

    .ih-categories-track {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding-bottom: 20px; 
        scrollbar-width: none; 
    }
    
    .ih-categories-track::-webkit-scrollbar { display: none; }

    .ih-cat-card {
        flex: 0 0 130px; 
        scroll-snap-align: center;
        max-width: none;
        animation-delay: 0s; 
        opacity: 1;
        transform: translateY(0);
    }

    .ih-cat-bg {
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }
}