/* ────────────────────────────────────
   КАРТОЧКИ ТОВАРОВ (общие)
──────────────────────────────────── */

/* Сетка товаров с явным указанием количества колонок */
.products-grid {
    display: grid;
    gap: 20px;
}

/* Десктоп (1200px и больше) – 5 колонок */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ноутбуки/планшеты (992px – 1199px) – 4 колонки */
@media (min-width: 992px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Планшеты (768px – 991px) – 3 колонки */
@media (min-width: 768px) and (max-width: 991px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Мобильные (480px – 767px) – 2 колонки */
@media (min-width: 480px) and (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Малые мобильные (до 479px) – 2 колонки */
@media (max-width: 479px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Базовая карточка */
.product-card {
    background-color: var(--color-bg-white);
    border-radius: var(--border-radius-plaque);
    padding: 20px;
    text-align: center;
    transition: 0.3s;
    border: 1px solid var(--color-gray);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-5px);
}

/* Ссылка-обёртка для фото и названия */
.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.product-link:hover {
    color: inherit;
}

/* Изображение товара */
.product-image {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Заголовок товара */
.product-card h3,
.product-title {
    color: var(--color-primary);
    margin-bottom: 10px;
    font-weight: var(--font-bold);
}

/* Цена */
.product-card__price,
.product-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-extrabold);
    color: var(--color-price);
    margin-bottom: 15px;
}

.product-card__price del,
.old-price {
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    margin-left: 5px;
    text-decoration: line-through;
}

/* Кнопка "Подробнее" */
.btn--sm {
    width: 100%;
    text-align: center;
}

/* Выравнивание блока с кнопкой по нижнему краю */
.product-footer {
    margin-top: auto;
}

/* Бейджи на карточках */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: var(--font-bold);
    border-radius: 15px 0 15px 0;
    text-align: center;
    line-height: 1;
    text-transform: uppercase;
}
.badge.hit {
    background: var(--color-yellow);
    color: var(--color-text-main);
}
.badge.sale {
    background: var(--color-discount);
    color: white;
}
.badge.new {
    background: var(--color-accent);
    color: white;
}

/* Выравнивание высоты карточек товаров */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    margin-bottom: 10px;
}

.product-colors {
    min-height: 30px;
    margin-bottom: 10px;
}

.product-price {
    margin-top: 0;
    margin-bottom: 15px;
}

.product-footer {
    margin-top: auto;
}

.color-dot-link {
    display: inline-block;
    text-decoration: none;
    margin: 2px;
}
.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    background-size: cover;
    background-position: center;
    background-color: #ccc;
    border: 1px solid var(--color-gray);
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}
.color-dot-link:hover .color-dot {
    transform: scale(1.1);
    border-color: var(--color-accent);
}

.color-dot-link.current .color-dot {
    border: 2px solid var(--color-primary);
}