/* Улучшенные стили для карточек товаров */

.product-card {
    position: relative;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    cursor: pointer; /* Курсор pointer для кликабельных карточек */
}

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

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.product-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

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

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

.product-card__badge {
    position: absolute;
    top: 16px;
    left: 0;
    background: linear-gradient(135deg, #eb3838 0%, #d32f2f 100%);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(235, 56, 56, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.product-card__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 50px;
    margin: 0;
}

.product-card__info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.product-card__info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.product-card__info-label {
    color: #666;
    font-weight: 300;
}

.product-card__info-value {
    color: var(--black);
    font-weight: 600;
}

.product-card__info-item--manufacturer .product-card__info-value {
    color: #0066cc;
    font-weight: 600;
}

.product-card__price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.product-card__price-label {
    font-weight: 500;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.product-card__price strong {
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    line-height: 1;
}

.product-card__price .old-price {
    font-weight: 500;
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    position: relative;
}

.product-card__add {
    margin-top: 16px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10; /* Кнопка должна быть выше карточки для обработки клика */
}

/* Предотвращаем переход на детальный просмотр при клике на кнопку */
.product-card__add,
.product-card__add * {
    pointer-events: auto;
}

.product-card__add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.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: 220px;
    }
    
    .product-card__name {
        font-size: 16px;
        min-height: 44px;
    }
    
    .product-card__price strong {
        font-size: 20px;
    }
}

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

/* Специальные стили для страницы поиска */
.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: 16px;
    right: 0;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Стили для карточек с новинкой */
.product-card--new::after {
    content: "Новинка";
    position: absolute;
    top: 16px;
    right: 0;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

