.main-categories {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Заголовок секции */
.main-categories__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.main-categories__title {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #71717a;
    font-weight: 600;
    white-space: nowrap;
}

.main-categories__divider {
    height: 1px;
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Сетка верхних плиток */
.main-categories__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 170px;
    /* Базовая высота одной строки */
    gap: 8px;
    margin-bottom: 8px;
}

/* Базовая карточка */
.category-card {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f7;
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
    color: #33333359;
}

/* Внутренние элементы карточки */
.category-card__icon-wrap {
    font-size: 20px;
    margin-bottom: 16px;
}

.category-card__title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    z-index: 1;
}

.category-card__count {
    font-size: 12px;
    color: #71717a;
    margin-top: auto;
    /* Прижимает к низу, если есть свободное место */
    z-index: 1;
}

/* Теги */
.category-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    width: fit-content;
    margin-top: 10px;
    z-index: 1;
}

.category-tag--hit {
    background-color: #fff;
    color: #ff5e5e;
}

.category-tag--oem {
    background-color: #fff;
    color: #4ade80;
}

.category-tag--new {
    background-color: #fff;
    color: #fbbf24;
}

.category-tag--repair {
    background-color: #fff;
    color: #ff5e5e;
}

/* --- Специфичные карточки (Расположение в Grid) --- */

/* Мехатроника (Высокая) */
.category-card--mechatronics {
    grid-column: 1 / 4;
    grid-row: 1 / 3;
}

.category-card--mechatronics .category-card__title {
    margin-top: auto;
    margin-bottom: 12px;
}

.category-card--mechatronics .category-card__count {
    margin-top: 24px;
}

.category-card__bg-text {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 85px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    letter-spacing: 2px;
}

/* Прокладки */
.category-card--gaskets {
    grid-column: 4 / 6;
}

/* Фрикционные диски */
.category-card--friction {
    grid-column: 6 / 9;
}

/* Поршни */
.category-card--pistons {
    grid-column: 9 / 11;
}

/* 45K Статистика */
.category-card--stats {
    grid-column: 11 / 13;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.category-card__stat-num {
    font-size: 46px;
    font-weight: 700;
    color: #ffb800;
    line-height: 1;
    margin-bottom: 8px;
}

.category-card__stat-desc {
    font-size: 12px;
    color: #71717a;
}

/* Фильтры (Широкая) */
.category-card--filters {
    grid-column: 4 / 11;
    flex-direction: row;
    align-items: center;
    padding: 24px;
}

.category-card--filters .category-card__icon-wrap {
    margin-bottom: 0;
    margin-right: 20px;
    font-size: 28px;
}

.category-card--filters .category-card__content {
    flex-grow: 1;
}

.category-card--filters .category-card__title {
    margin-bottom: 4px;
    font-size: 16px;
}

.category-card__subtitle {
    font-size: 12px;
    color: #71717a;
}

.category-card__dot {
    margin: 0 4px;
    color: #4a4a52;
}

/* Гидротрансформаторы */
.category-card--hydro {
    grid-column: 11 / 13;
}

/* --- Нижний ряд (Пилюли) --- */
.main-categories__bottom-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-pill {
    display: flex;
    align-items: center;
    background-color: #f5f5f7;
    border-radius: 40px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    flex: 0 1 auto;
    min-width: 130px;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.category-pill:hover {
    border-color: rgba(255, 255, 255, 0.1);
    color: #33333359;
    transform: translateY(-2px);
}

.category-pill__icon {
    margin-right: 12px;
    font-size: 16px;
}

.category-pill__content {
    display: flex;
    flex-direction: column;
}

.category-pill__title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.category-pill__count {
    font-size: 11px;
    color: #71717a;
    margin-top: 2px;
    white-space: nowrap;
}

/* Модификатор для кнопки "Весь каталог" */
.category-pill--link {
    flex: 1;
    /* Занимает все оставшееся пространство */
    justify-content: center;
    background-color: #f5f5f7;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-pill--link:hover {
}

.category-pill--link .category-pill__title {
    color: #a1a1aa;
    font-weight: 500;
}

/* Адаптив (по ТЗ фиксировано 1200, но добавил базовый для аккуратности) */
@media (max-width: 1200px) {
    .main-categories {
        overflow-x: auto;
        padding-bottom: 20px;
    }

    .main-categories__grid {
        min-width: 1160px;
    }

    .main-categories__bottom-row {
        min-width: 1160px;
    }
}