/* =========================================================
   🌐 ГЛОБАЛЬНЫЕ СТИЛИ
   ========================================================= */

/* Здесь могут быть переменные и базовые настройки */


/* =========================================================
   🔍 СЕКЦИЯ ФИЛЬТРОВ
   ========================================================= */

.catalog__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 45px;
    padding: 15px 20px;
    background: #faf9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-group {
    min-width: 220px;
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 6px;
}

.filter-input,
.filter-select {
    border: 1px solid #d5d5d5;
    padding: 11px 14px;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    transition: 0.25s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #0f2c92;
    box-shadow: 0 0 6px rgba(15, 44, 146, 0.3);
}


/* =========================================================
   ⚙️ КНОПКИ ФИЛЬТРОВ
   ========================================================= */

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

.btn-filter,
.btn-reset {
    width: 55px;
    height: 46px;
    background: #0836a7;
    border: none;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-filter:hover,
.btn-reset:hover {
    background: #0b4dd1;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-filter svg,
.btn-reset svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}


/* =========================================================
   🖼️ СЕТКА ТОВАРОВ
   ========================================================= */

.products-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 2.3rem;
    align-items: stretch; /* все карточки растягиваются равномерно */
}


/* =========================================================
   📦 КАРТОЧКА ТОВАРА
   ========================================================= */

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;   /* ВАЖНО: для абсолютных бейджей */
    height: 100%;         /* тянем на всю высоту ячейки */
    transition: .3s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   🏷️ БЕЙДЖИ (new, sale, hit)
   ========================================================= */

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;          /* поверх контента */
    display: flex;
    gap: 8px;
    pointer-events: none; /* чтобы клик всегда шёл по ссылке товара */
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.badge-new { background: #3a86ff; }
.badge-hit { background: #f4a261; }
.badge-sale { background: #d62828; }


/* =========================================================
   🖼️ ИЗОБРАЖЕНИЕ (фиксированная высота ~250px)
   ========================================================= */

.product-card__image {
    width: 100%;
    height: 250px;        /* как договорились: B = 250px */
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.product-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: 0.3s;
}

.product-card__image img:hover {
    transform: scale(1.04);
}


/* =========================================================
   📝 ТЕКСТ
   ========================================================= */

.product-card__info {
    padding: 1rem 1.2rem;
    text-align: center;
    flex-grow: 1;
text-align: justify;
    display: flex;
    flex-direction: column;
}

.product-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .45rem;
    color: #0f2c92;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__short {
    font-size: 0.92rem;
    color: #666;
    margin: .7rem 0;

    min-height: 120px;    /* C = 120px, одинаковый блок описания */
    max-height: 120px;
    overflow: hidden;
}

.product-card__btn {
    width: 100%;
    margin-top: auto;     /* прижимаем кнопку к низу карточки */
}


/* =========================================================
   💲 ЦЕНЫ
   ========================================================= */

.product-card__price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2a9d8f;
    text-align: center;
    margin-bottom: 12px;
}

.product-card__oldprice {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}


/* =========================================================
   📱 МОБИЛЬНАЯ АДАПТАЦИЯ
   ========================================================= */

@media (max-width: 600px) {
    .catalog__filters {
        padding: 12px;
        gap: 15px;
    }

    .filter-group {
        min-width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.4rem;
    }
}

@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   📄 ПАГИНАЦИЯ
   ========================================================= */

.pagination-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 40px 0 10px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    margin: 0;
}

.page-item {
    list-style: none;
}

.page-link {
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ddd;
    border-radius: 6px;

    background: #f6f6f6;
    color: #333;
    font-size: 16px;
    text-decoration: none;

    transition: 0.25s ease;
}

.page-link:hover {
    background: #00a4ff;
    color: #fff;
    border-color: #00a4ff;
}

.page-item.active .page-link {
    background: #00a4ff;
    border-color: #00a4ff;
    color: #fff;
}

.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}
