/* styles/catalogue-product-card.css */

.card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

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

.card__top {
    flex: 0 0 220px;
    position: relative;
    overflow: hidden;
}

.card__image {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card__image > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
    background-color: #f5f5f5;
}

.card__image:hover > img {
    transform: scale(1.05);
}

/* Бейдж скидки */
.card__label {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #dc3545;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}

/* Бейдж рейтинга */
.card__rating {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffc107;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}

.card__bottom {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
}
.card__prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Обычная цена (без скидки) */
.card__price--regular {
    font-weight: 700;
    font-size: 20px;
    color: #333333;
    text-decoration: none;
}

/* Цена со скидкой */
.card__price--discount {
    font-weight: 700;
    font-size: 20px;
    color: #f54900;
    text-decoration: none;
}

/* Старая цена (зачёркнутая) */
.card__price--old {
    font-weight: 400;
    font-size: 14px;
    color: #999999;
    text-decoration: line-through;
}

/* Единица измерения */
.card__unit {
    font-size: 12px;
    color: #666666;
    margin-left: 4px;
}

.card__title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #333333;
    text-decoration: none;
    margin-bottom: 8px;
    
    /* Многострочное обрезание */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.card__title:hover {
    color: #f54900;
}

.card__meta {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 12px;
    color: #666666;
}

.card__category,
.card__supplier {
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.card__stock {
    font-size: 12px;
    margin: 8px 0;
}

.card__stock--in {
    color: #28a745;
}

.card__stock--low {
    color: #ffc107;
}

.card__stock--out {
    color: #dc3545;
}

.card__add {
    background-color: #f54900;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    margin-top: auto;
}

.card__add:hover {
    background-color: #d43f00;
}

/* Список товаров (list view) */
.products-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.products-grid.list-view .card {
    display: flex;
    flex-direction: row;
    min-height: auto;
}

.products-grid.list-view .card__top {
    flex: 0 0 120px;
    height: 120px;
}

.products-grid.list-view .card__bottom {
    flex: 1;
}

.products-grid.list-view .card__prices {
    justify-content: flex-start;
    gap: 16px;
}

.products-grid.list-view .card__add {
    width: auto;
    max-width: 200px;
}

/* Адаптив списка */
@media (max-width: 768px) {
    .products-grid.list-view .card {
        flex-direction: column;
    }
    
    .products-grid.list-view .card__top {
        flex: 0 0 200px;
        height: 200px;
    }
    
    .products-grid.list-view .card__add {
        width: 100%;
        max-width: none;
    }
}