/* Модуль карточек категорий */
.category-cards-module {
    margin-bottom: 80px;
}

.category-cards-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.category-cards-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-cards-container::-webkit-scrollbar {
    display: none;
}

.category-cards-container.scrollable {
    cursor: grab;
}

.category-cards-container.active {
    cursor: grabbing;
}

.category-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 220px);
    grid-template-rows: 150px 190px;
    gap: 15px;
    min-width: max-content;
    padding: 0 12px 18px;
}

.category-card {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    height: 150px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-card:hover {
    border-color: #dc3545;
}

.category-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.category-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.category-card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 20px 15px;
    text-align: center;
    justify-content: space-between;
}

.category-card-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    z-index: 2;
    position: relative;
    margin: 0 auto;
}

.category-card-icon {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card-icon img {
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
}


.category-card.large {
    grid-row: 2;
    grid-column: span 2;
    height: 190px;
}

.category-card.large .category-card-text {
    font-size: 20px;
    font-weight: 700;
}

.category-card.large .category-card-icon {
    width: 160px;
    height: 180px;
    bottom: -28px;
}

.category-card.large .category-card-icon img {
    max-width: 140px;
    max-height: 140px;
}

.line-break {
    display: none;
}


/* Адаптивность для мобильных и маленьких планшетов */
@media (max-width: 768px) {
    .category-cards-module {
        margin: 15px 0;
    }

    .category-cards-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .category-cards-wrapper {
        grid-template-columns: repeat(4, 180px);
        grid-template-rows: 140px 180px;
        gap: 12px;
        padding: 0 10px 16px;
    }

    .category-card {
        height: 140px;
    }

    .category-card-content {
        padding: 16px 12px;
    }

    .category-card-text {
        font-size: 14px;
        line-height: 1.2;
    }

    .category-card-icon {
        width: 100px;
        height: 130px;
        bottom: -20px;
    }

    .category-card-icon img {
        max-width: 90px;
        max-height: 90px;
    }

    .category-card.large {
        height: 140px;
    }

    .category-card.large .category-card-text {
        font-size: 16px;
    }

    .category-card.large .category-card-icon {
        width: 140px;
        height: 180px;
        bottom: -26px;
    }

    .category-card.large .category-card-icon img {
        max-width: 125px;
        max-height: 125px;
    }
}

/* Специальная сетка для десктопа */
@media (min-width: 992px) {
    .category-cards-container {
        overflow: visible;
        padding: 0;
    }

    .category-cards-wrapper {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: auto auto;
        gap: 20px;
        min-width: 0;
        max-width: 100%;
        padding: 0;
    }

    .category-card {
        height: 140px;
    }

    .category-card.large {
        height: 180px;
    }

    .category-card.large .category-card-text {
        font-size: 18px;
    }

    .category-card.large .category-card-icon {
        width: 150px;
        height: 190px;
        bottom: -24px;
    }

    .category-card.large .category-card-icon img {
        max-width: 135px;
    }
}
