/* --- 1. Сетка каталога --- */
.no-wrap {
    white-space: nowrap;
}

.categorii-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Строго 3 в ряд на десктопе */
    gap: 30px 30px; 
    margin: 20px 0 30px;
}

/* --- 2. Карточка товара (Общие стили) --- */
.categorii-card {
    position: relative;
    background: #fff;
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0,0,0,.12);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.3s;
    box-sizing: border-box;
}

.categorii-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* Инфо-значки (Насосы) */
.categorii-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    background: var(--nasos-img) no-repeat center/contain;
}

.categorii-card__number {
    position: absolute;
    top: 45px;
    right: 12px;
    color: #167f2b;
    font-weight: 600;
}

/* Контент: Изображение */
.categorii-card__media {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.categorii-card__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Контент: Заголовок */
.categorii-card__title {
    display: block;
    min-height: 3.2em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    color: #1a1a1a;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid #d7d7d7;
    line-height: 1.2;
}

.categorii-card__title:hover { color: #167f2b; }

/* Характеристики */
.categorii-card__char {
    margin-bottom: 0px;
    line-height: 1;
}

.categorii-card__char:last-child {
    margin-bottom: 35px;
    line-height: 1;
}

/* Футер: Кнопки и Цена */
.categorii-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #d7d7d7;
    padding-top: 12px;
    margin-top: auto;
}

.categorii-card__actions { display: flex; gap: 8px; }

.categorii-ico-compare, .categorii-ico-cart {
    display: block;
    cursor: pointer;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    width: 32px;
    height: 32px;
    transition: 0.2s;
    border: none;
    background-color: transparent;
    padding: 0;
}

.categorii-ico-compare { background-image: url(../../images/balance-gray.svg); }
.categorii-ico-compare:hover { background-image: url(../../images/balance.svg); }

.categorii-ico-cart { background-image: url(../../images/btn_basket_good-gray.png); }
.categorii-ico-cart:hover { 
    background-image: url(../../images/btn_basket_good.png);
    animation: cat-shake 0.5s infinite; 
}

.categorii-card__price-box .price-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 700;
}

/* --- 3. Пагинация и Сортировка --- */
.categorii-pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.categorii-sort {
    display: flex;
    align-items: center;
    gap: 12px;
}

.categorii-all-stations-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: auto;
    padding: 0 20px;
    border: 2px solid #167f2b;
    border-radius: 30px;
    background-color:#167f2b ;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.3s;
    cursor: pointer;
    box-sizing: border-box;
    /* ИСПРАВЛЕНИЕ: убираем внешние отступы тега <p> */
    margin: 0; 
}
/* Эффект при наведении для всех кнопок */
.categorii-all-stations-btn:hover {
    background:transparent;
    color: #167f2b;
}


.categorii-load-more-btn,
.categorii-reset-all-btn {
    margin-top: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: auto;
    padding: 0 20px;
    border: 2px solid #167f2b;
    border-radius: 30px;
    color: #167f2b;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.3s;
    cursor: pointer;
    background: transparent;
    box-sizing: border-box;
    /* ИСПРАВЛЕНИЕ: убираем внешние отступы тега <p> */
    margin: 0; 
}

/* Эффект при наведении для всех кнопок */
.categorii-load-more-btn:hover,
.categorii-reset-all-btn:hover {
    background-color: #167f2b;
    color: #fff;
}

/* По умолчанию (десктоп) */
.title-mobile {
    display: none;
}
.title-desktop {
    display: inline;
}


/* Служебное */
.f-center { display: flex; justify-content: center; width: 100%; margin-top: 0px; }
.hidden-input { display: none; }


.categorii-load-more-btn,
.categorii-reset-all-btn {
    margin-top: 50px;
    margin-bottom: 15px;

}
    .f-center-bm { margin-top: -50px; display: flex; flex-direction: column; align-items: center; width: 100%; gap: 15px; 
    }
    
    @keyframes cat-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Планшеты: от 601px до 1025px — две колонки */
@media (min-width: 601px) and (max-width: 1025px) {
    .categorii-grid {
        grid-template-columns: repeat(2, 1fr); /* Исправлено: 2 колонки */
        gap: 20px;
    }
    
    /* Если на планшетах карточка должна быть десктопной (вертикальной) */
    .categorii-card {
        flex-direction: column;
    }

}

@media (max-width: 700px) {

    .f-center-bm {  margin-top: 1000px !important; }
}

@media (max-width: 600px) {
    /* 1. Сетка в одну колонку */
    .categorii-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* 2. Контейнер карточки — убираем лишнюю высоту */
    .categorii-card {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        align-items: flex-start;
        height: auto !important; /* Убирает растягивание карточки по высоте соседа */
        min-height: auto !important;
    }


    /* 3. Название — На всю ширину сверху */
    .categorii-card__title {
        order: 1;
        width: 100%;
        display: block;
        min-height: auto;
        margin-bottom: 12px;
        padding-bottom: 8px;
        padding-right: 45px; /* Место под насосы */
        border-bottom: 1px solid #eee;
        box-sizing: border-box;
        line-height: 1.2;
    }

    /* 4. Фото слева (34%) */
    .categorii-card__mobile-side {
        display: block;
        order: 2;
        width: 25%;
        height: 90px; /* Фиксируем высоту фото, чтобы оно не растягивало карточку */
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    /* 5. Характеристики справа (66%) */
    .categorii-card__chars {
        order: 3;
        width: 75%;
        padding-left: 15px;
        margin-top: -5px;
        margin-bottom: -20px;
        margin-left: 0;
        box-sizing: border-box;
    }

    .categorii-card__char {
        margin-bottom: 0px;
        margin-top: 10px;
        line-height: 1;
    }

    /* 6. Скрываем десктопное фото */
    .categorii-card__media {
        display: none;
    }

    /* 7. Футер — прижимаем к контенту без дырок */
    .categorii-card__footer {
        order: 4;
        width: 100%;
        margin-top: 5px !important; /* Фиксированный отступ вместо auto */
        padding-top: 5px;
        border-top: 1px solid #eee;
    }

    /* 8. Иконки насосов (абсолют относительно названия) */
    .categorii-card__badge {
        position: absolute;
        top: 6px;
        right: 25px;
        width: 30px;
        height: 30px;
        z-index: 2;
    }

    .nasos-text {
        display: none;
    }

    .categorii-card__number {
        position: absolute;
        top: 10px;
        right: 12px;
        z-index: 2;
    }

    .categorii-ico-compare, .categorii-ico-cart {
        width: 25px;
        height: 25px;
        padding-right: 20px;
    }
    .title-desktop {
        display: none;
    }
    .title-mobile {
        display: inline;
        font-size: 14px; /* Можно чуть уменьшить шрифт для компактности */
        line-height: 1.2;
    }
    
    .categorii-card__title {
        min-height: auto; /* На мобильных высота теперь зависит от одной строки */
    }

    .categorii-sort {
        display: flex;
        flex-direction: column; /* Складываем элементы в колонку */
        align-items: flex-end;   /* Прижимаем всё к правому краю */
        gap: 5px;               /* Небольшой отступ между надписью и селектом */
    }

    .categorii-sort__select {
        width: auto;            /* Чтобы ширина подстраивалась под контент */
        max-width: 100%;
    }    

    /* Скрываем кнопки сравнения и корзины, если нужно еще больше компактности */
    /* .categorii-card__actions { display: none; } */
}

    .f-green {
    color:#167f2b;
    }

    .f-semibold{
    font-size: 600;
    }

