/* Карточки товаров (редизайн) */

.product-card {
    position: relative;
    width: 100%;
    border: 1px solid var(--border-soft, #e5e7eb);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    border-radius: 16px;
    padding: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    height: 100%;
    cursor: pointer;
}

.product-card[data-product-url] {
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    border-color: #cdd6e4;
}

.product-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    background: var(--surface, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-soft, #e5e7eb);
}

.product-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__img {
    transform: scale(1.04);
}

/* Метки */
.product-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #ef4444;
    border-radius: 8px;
    padding: 5px 11px;
    font-weight: 600;
    font-size: 12px;
    color: var(--white);
    z-index: 2;
    letter-spacing: 0.02em;
}

.product-card__content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

/* Мелкая подпись категории над названием */
.product-card__category {
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.2;
}

.product-card__name {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 45px;
    margin: 0;
}

/* Характеристики / чипы */
.product-card__info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.product-card__info-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--chip-bg, #f1f5f9);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12.5px;
    line-height: 1.2;
}

.product-card__info-label {
    color: var(--muted, #64748b);
    font-weight: 400;
}

.product-card__info-value {
    color: var(--chip-text, #475569);
    font-weight: 600;
}

.product-card__info-item--manufacturer {
    background: var(--brand-blue-soft, #eff4ff);
}

.product-card__info-item--manufacturer .product-card__info-value {
    color: var(--brand-blue, #2563eb);
    font-weight: 600;
}

/* Цена */
.product-card__price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft, #e5e7eb);
}

.product-card__price-label {
    font-weight: 500;
    font-size: 12px;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-card__price-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.product-card__price strong {
    font-weight: 700;
    font-size: 22px;
    color: #0f172a;
    line-height: 1.1;
}

.product-card__price .old-price {
    font-weight: 500;
    font-size: 16px;
    color: #94a3b8;
    text-decoration: line-through;
}

/* Низ карточки: цена слева, кнопка справа (как в макете) */
.product-card__footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.product-card__price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.product-card__price-box strong {
    font-weight: 700;
    font-size: 20px;
    color: #0f172a;
    line-height: 1.1;
}

.product-card__price-box .old-price {
    font-weight: 500;
    font-size: 15px;
    color: #94a3b8;
    text-decoration: line-through;
}

.product-card__on-request {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted, #64748b);
}

/* В футере кнопка компактная, а не на всю ширину */
.product-card__footer .product-card__add {
    width: auto;
    margin-top: 0;
    padding: 10px 16px;
    font-size: 14px;
    flex-shrink: 0;
}

/* Кнопка запроса / в корзину */
.product-card__add {
    margin-top: 4px;
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    padding: 12px;
    height: auto;
    min-width: 0;
    border-radius: 12px;
    background: var(--brand-blue, #2563eb);
    color: #fff;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
    text-decoration: none;
}

.product-card__add,
.product-card__add * {
    pointer-events: auto;
}

.product-card__add:hover {
    background: var(--brand-blue-dark, #1d4ed8);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.product-card__add:active {
    transform: translateY(0);
}

/* Сетка списка товаров */
.products__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Адаптивность */
@media screen and (max-width: 1200px) {
    .products__list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .products__list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .product-card__image-wrapper {
        height: 190px;
    }

    .product-card__name {
        font-size: 15px;
        min-height: 42px;
    }

    .product-card__price strong {
        font-size: 19px;
    }
}

@media screen and (max-width: 480px) {
    .products__list {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-card__content {
        padding: 14px;
        gap: 10px;
    }
}

/* Страница поиска */
.search-results .products__list {
    margin-top: 20px;
}

/* Swiper */
.swiper-slide .product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.swiper-slide .product-card__content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Метки хит / новинка */
.product-card--hit::before {
    content: "Хит";
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--accent-orange, #f97316);
    border-radius: 8px;
    padding: 5px 11px;
    font-weight: 600;
    font-size: 12px;
    color: var(--white);
    z-index: 2;
    letter-spacing: 0.02em;
}

.product-card--new::after {
    content: "Новинка";
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--success-green, #16a34a);
    border-radius: 8px;
    padding: 5px 11px;
    font-weight: 600;
    font-size: 12px;
    color: var(--white);
    z-index: 2;
    letter-spacing: 0.02em;
}

/* Если карточка и хит, и новинка — сдвигаем новинку ниже */
.product-card--hit.product-card--new::after {
    top: 46px;
}
