/* Контейнер для списка товаров */
.container-products {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Адаптивные отступы для контейнера */
@media (max-width: 768px) {
    .container-products {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container-products {
        padding: 0 10px;
    }
}

.favorite-heart-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 12px;
    margin: -8px -8px 0 0;
    border-radius: 6px;
}

.favorite-heart-btn:hover {
    transform: scale(1.1);
}

.favorite-heart-btn svg {
    width: 24px;
    height: 24px;
    stroke: #666;
    stroke-width: 2;
    fill: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.favorite-heart-btn.active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.favorite-heart-btn:hover svg {
    stroke: #e74c3c;
}

.delivery-info {
    font-size: 0.95em;
    font-weight: 600;
    color: #ffffff;
    margin-top: 8px;
    background: #1976d2;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    border: 1px solid #1565c0;
    gap: 8px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    white-space: nowrap;
}

.delivery-icon {
    width: 22px;
    height: 22px;
    fill: #ffffff;
    flex-shrink: 0;
}

.product-card__price {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 18px;
    color: #d32f2f;
    font-weight: 700;
    margin: 0 0 2px 0;
    text-align: left;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
}

/* ИСПРАВЛЯЕМ ВЫРАВНИВАНИЕ КАРТОЧЕК */
.product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* БАЗОВЫЕ СТИЛИ ДЛЯ 5 КАРТОЧЕК */
.product-card {
    width: calc(20% - 16px);
    box-sizing: border-box;
    background: #fff;
    padding: 0;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    flex-grow: 0;
    flex-shrink: 0;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card__image-container {
    position: relative; 
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1), 
                0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.product-card__name {
    font-size: 14px;
    font-weight: 500; /* Было 500, делаем чуть жирнее */
    color: #666666;   /* Было #555, делаем светлее */
    line-height: 1.3;
    word-wrap: break-word;
    text-align: left;
  text-shadow: 0.3px 0 0 currentColor;
    margin: 3px 0 2px 0;
    padding: 0;
    /* Ограничение на 2 строки */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em;
    height: 2.6em;
}
.product-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__link:hover .product-card__name {
    color: #007bff;
}

/* Стили для рейтинга под названием товара */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 8px 0;
    padding: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.2;
}

.rating-stars {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-stars svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.rating-value {
    font-weight: 600;
    color: #333;
}

.reviews-count {
    font-size: 12px;
    color: #666;
}

/* АДАПТАЦИЯ ДЛЯ РАЗНЫХ РАЗМЕРОВ ЭКРАНОВ */
/* От 1201px до 1400px - 4 карточки */
@media (max-width: 1400px) {
    .product-card {
        width: calc(25% - 15px);
    }
}

/* От 993px до 1200px - 3 карточки */
@media (max-width: 1200px) {
    .product-card {
        width: calc(33.333% - 13.33px);
    }
}

/* От 769px до 992px - 2 карточки */
@media (max-width: 992px) {
    .product-card {
        width: calc(50% - 10px);
    }
}

/* От 577px до 768px - 2 карточки */
@media (max-width: 768px) {
    .product-card {
        width: calc(50% - 10px);
    }
    
    .favorite-heart-btn {
        padding: 10px;
        margin: -6px -6px 0 0;
    }
    
    .favorite-heart-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .delivery-info {
        font-size: 0.85em;
        padding: 6px 10px;
        gap: 6px;
        min-height: 36px;
    }
    
    .delivery-icon {
        width: 18px;
        height: 18px;
    }
    
    .product-rating {
        font-size: 12px;
        gap: 4px;
        margin: 3px 0 6px 0;
    }
    
    .rating-stars svg {
        width: 13px;
        height: 13px;
    }
    
    .reviews-count {
        font-size: 11px;
    }
}

/* МАЛЕНЬКИЕ СМАРТФОНЫ - 2 карточки */
@media (max-width: 480px) {
    .product-card {
        width: calc(50% - 6px);
    }
    
    .product-list {
        gap: 12px;
    }
    
    .favorite-heart-btn {
        padding: 8px;
        margin: -4px -4px 0 0;
    }
    
    .favorite-heart-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .delivery-info {
        font-size: 0.8em;
        padding: 5px 8px;
        gap: 5px;
        min-height: 34px;
    }
    
    .delivery-icon {
        width: 16px;
        height: 16px;
    }
    
    .product-rating {
        font-size: 11px;
        gap: 3px;
        margin: 2px 0 5px 0;
    }
    
    .rating-stars svg {
        width: 12px;
        height: 12px;
    }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ СМАРТФОНЫ - 2 карточки */
@media (max-width: 360px) {
    .product-card {
        width: calc(50% - 5px);
    }
    
    .product-list {
        gap: 10px;
    }
}

/* Большие мониторы */
@media (min-width: 1920px) {
    .delivery-info {
        font-size: 1.1em;
        min-height: 48px;
    }
    
    .delivery-icon {
        width: 24px;
        height: 24px;
    }
}

.old-price {
    text-decoration: line-through;
    color: #888;
    margin-right: 5px;
}

.new-price {
    font-weight: bold;
    color: #d32f2f;
}

.discount-badge {
    background-color: #d32f2f;
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-left: 5px;
}