/* ===== СЕКЦИЯ КАТЕГОРИЙ НА ГЛАВНОЙ ===== */

.index-categories-simple {
    padding: 90px 0 1px;
    width: 100%;
}
.index-categories {
    flex-direction: row;
    width: clamp(350px, calc(100% - 2*var(--g,16px)), 1415px);
    margin-inline: auto;
    padding: 1px; /* убрали отступы */
    box-sizing: border-box;
    /* border-bottom: 1px solid #d0d0d0; */
}

.index-categories__container {
    /* max-width: 1415px; */
    /* margin: 0 auto; */
    /* padding: 0 11px; */
    margin-bottom: 25px;
}

.index-categories__title {
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    padding-left: 35px;
    margin: 0 0 32px;
    background: linear-gradient(180deg, #fac207 0%, #e0ae07 45%, #d0a208 100%);
    color: #434343;
    border-radius: 3px;
    background-image: url("/assets/img/je-che-line.svg");
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 100%;
    background-origin: border-box;
    background-clip: border-box;
}

/* ===== СЕТКА КАРТОЧЕК ===== */
/* 1 / 2 / 4 / 6 в ряд, размер 120–250px */

.index-categories__grid {
    display: grid;
    justify-content: center; /* карточки центрируются, не растягиваются на всю ширину */
    gap: 12px;
    grid-template-columns: repeat(6, minmax(120px, 250px));
    margin-top: 25px;
}


@media (max-width: 1340px) {
    .index-categories__grid {
        grid-template-columns: repeat(6, minmax(120px, 400px));
    }
}


@media (max-width: 1100px) {
    .index-categories__grid {
        grid-template-columns: repeat(4, minmax(150px, 400px));
        padding: 2px;
    }
}


@media (max-width: 900px) {
    .index-categories__grid {
        grid-template-columns: repeat(3, minmax(150px, 300px));
        padding: 6px;
    }
    .index-categories {
        flex-direction: row;
        width: clamp(350px, calc(100% - 2*var(--g,4px)), 1415px);
        margin-inline: auto;
        padding: 1px; /* убрали отступы */
        box-sizing: border-box;
    }
}


@media (max-width: 600px) {
    .index-categories__grid {
        grid-template-columns: repeat(2, minmax(120px, 400px));
    }
    .index-categories {
        flex-direction: row;
        width: clamp(300px, calc(100% - 2*var(--g,4px)), 1415px);
        margin-inline: auto;
        padding: 1px; /* убрали отступы */
        box-sizing: border-box;
    }
}
@media (max-width: 500px) {
    .index-categories__title {
        font-size: 16px;
    }


}

/* ===== КАРТОЧКА КАТЕГОРИИ ===== */

.index-category-card {
    position: relative !important;
    display: block;
    width: 100%;
    /* max-width: 250px; */

    /* внешний вид самой карточки */
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e3e3e3;
    background-color: #ffffff;

    /* картинка: снизу-справа, чтобы текст сверху не лез на неё */
    background-position: right bottom !important;
    background-repeat: no-repeat !important;
    background-size: auto 80% !important;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
    transform-origin: center center;
    transition:
            transform 0.22s ease,
            box-shadow 0.22s ease,
            border-color 0.22s ease,
            background-color 0.22s ease;
    cursor: pointer;
}

/* Делает карточку строго квадратной */
.index-category-card::before {
    content: "";
    display: block;
    padding-top: 100%; /* высота = ширина */
}

/* Внутренний блок с текстом, слева сверху */

.index-category-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    padding: 8px 10px;
    /* background: rgba(255, 255, 255, 0.92); */
    box-sizing: border-box;
    max-width: 100%;              /* не шире 80% карточки */
    border-bottom-right-radius: 12px;
}

/* Название категории – можно переносить на несколько строк */

.index-category-card__name {
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    margin: 0 0 4px;
    white-space: normal;          /* разрешаем перенос строк */
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Количество товаров */

.index-category-card__count {
    font-size: 13px;
    color: #525252;
}

/* Если нет категорий */

.index-categories__empty {
    grid-column: 1 / -1;
    font-size: 15px;
    text-align: center;
}

/* Ссылка внутри карточки занимает весь квадрат */
.index-category-card__link {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Ховер для карточки категорий */
.index-category-card:hover {

    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    border-color: #ffc20e;
    background-color: #ffffff;
}
.cat-cats-finish {
    width: 100%;
    min-height: 10px;
    margin: 0 0 32px;
    background-image: url("/assets/img/je-che-line2.svg");
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 100%;
    background-origin: border-box;
    background-clip: border-box;
}