/* ========================================================================
   grid-item.css — Карточка товара в сетке (эко-минимализм Greenway)
   ======================================================================== */

/* ---------- 1. КАРТОЧКА (monolit) ---------- */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* растягиваем на всю высоту ячейки */
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* ---------- 2. ИЗОБРАЖЕНИЕ (квадрат + зум) ---------- */
.product-image-container {
    position: relative;
    aspect-ratio: 1 / 1; /* жёсткий квадрат */
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* картинка вписывается без искажений */
    transition: transform 0.35s ease;
}

.product-card:hover .product-image {
    transform: scale(1.04); /* лёгкий зум при ховере */
}

/* ---------- 3. СТИКЕРЫ И БЕЙДЖИ ---------- */
.product-stickers {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.product-sticker {
    display: inline-block;
    padding: 2px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 40px;
    background: #2e7d32;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
    white-space: nowrap;
}

/* Цветовые варианты стикеров (можно переопределить) */
.product-sticker-new {
    background: #16a34a;
}
.product-sticker-hit {
    background: #dc2626;
}
.product-sticker-sale {
    background: #f59e0b;
}
.product-sticker-popular {
    background: #3b82f6;
}
.product-sticker-limited {
    background: #8b5cf6;
}

/* Бейдж скидки (процент) – справа вверху */
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 12px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
    z-index: 2;
    line-height: 1.6;
}

/* ---------- 4. КОНТЕНТНАЯ ЧАСТЬ ---------- */
.product-content {
    padding: 1rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* занимает оставшееся пространство */
}

.product-code {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    letter-spacing: 0.3px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.3rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem; /* резервируем место для 2 строк */
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: #2e7d32;
}

/* ---------- 5. РЕЙТИНГ ---------- */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem 0 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 1px;
    color: #f59e0b;
    font-size: 0.8rem;
}

.rating-stars .fa-star-half-alt,
.rating-stars .fa-star {
    color: #f59e0b;
}

.rating-stars .fa-star-half-alt:not(.filled) {
    color: #d1d5db;
}

.rating-text {
    font-size: 0.8rem;
    color: #64748b;
}

.rating-text .count {
    color: #94a3b8;
}

/* ---------- 6. КРАТКОЕ ОПИСАНИЕ ---------- */
.product-description-short {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
    margin: 0.3rem 0 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4rem; /* резервируем место */
}

/* ---------- 7. ЦЕНА ---------- */
.product-price {
    margin-top: auto; /* прижимаем цену к низу карточки */
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.6rem;
}

.old-price {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.current-price.discounted {
    color: #dc2626;
}

.discount-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.6rem;
    border-radius: 40px;
    margin-left: auto;
}

/* ---------- 8. КНОПКА «ПОДРОБНЕЕ» ---------- */
.product-actions {
    margin-top: 0.75rem;
}

.btn-modern-flat {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2e7d32;
    background: transparent;
    border: 2px solid #2e7d32;
    border-radius: 60px; /* капсула */
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.btn-modern-flat:hover {
    background: #2e7d32;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
    transform: translateY(-1px);
}

/* ---------- 9. АДАПТИВ ---------- */
@media (max-width: 576px) {
    .product-title {
        font-size: 0.95rem;
        min-height: 2.6rem;
    }

    .product-description-short {
        font-size: 0.8rem;
        min-height: 2.2rem;
    }

    .current-price {
        font-size: 1.1rem;
    }

    .product-content {
        padding: 0.75rem;
    }
}