﻿/* ===== ОБНОВЛЕННЫЙ groceryShowcase.css ===== */

.product-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background-color: #faf7f2;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23faf7f2"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23f0e6d4" stroke-width="0.5"/></svg>');
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Возвращаем 1fr для десктопа */
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    justify-content: center; /* Центрируем всю сетку */
    justify-items: center; /* Центрируем карточки внутри ячеек */
    background-color: transparent;
    padding: 1rem;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(92, 61, 9, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #eee3d3;
    height: auto;
    min-height: 380px;
    width: 100%;
    max-width: 280px; /* Фиксированная максимальная ширина для центрирования */
}

    .product-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 25px rgba(92, 61, 9, 0.15);
    }

    .product-item::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #f0c45a, #e6b236);
    }

.product-image-container {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 8px;
    background: #fcf8f0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-item:hover .product-image {
    transform: scale(1.05);
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #5c3d09;
    font-family: 'Montserrat', sans-serif;
    width: 100%;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.4;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    width: 100%;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #b78102;
}

.product-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.QuantityInBasket {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.4rem;
    font-size: 1rem;
}

.plus-btn, .minus-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f0c45a;
    color: #5c3d09;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .plus-btn:hover, .minus-btn:hover {
        background: #e6b236;
        transform: scale(1.1);
    }

/* Стиль для сообщения "Осталось немного" */
.product-item label {
    color: #e6a236;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.3rem 0.7rem;
    background-color: #fff6e6;
    border-radius: 4px;
    text-align: center;
}

/* Стили для подсказок */
.mytooltip {
    position: relative;
    cursor: pointer;
}

    .mytooltip .mytooltiptext {
        visibility: hidden;
        min-width: 220px;
        max-width: 300px;
        background-color: rgba(90, 72, 42, 0.95);
        color: #fff;
        text-align: center;
        padding: 12px;
        border-radius: 8px;
        position: absolute;
        z-index: 100;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.3s, visibility 0.3s, transform 0.3s ease;
        transform: translateX(-50%) translateY(10px);
        backdrop-filter: blur(5px);
        font-weight: normal;
        line-height: 1.5;
        font-size: 0.9rem;
    }

    .mytooltip:hover .mytooltiptext {
        visibility: visible;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

/* Анимации */
@keyframes honeyDrip {
    0% {
        transform: translateY(-5px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.product-item {
    animation: honeyDrip 0.5s ease forwards;
}

    .product-item:nth-child(2) {
        animation-delay: 0.1s;
    }

    .product-item:nth-child(3) {
        animation-delay: 0.2s;
    }

    .product-item:nth-child(4) {
        animation-delay: 0.3s;
    }

    .product-item:nth-child(5) {
        animation-delay: 0.4s;
    }

    .product-item:nth-child(n+6) {
        animation-delay: 0.5s;
    }

/* Адаптивность - ПЕРЕПИСАНА ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 1024px) {
    .product-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    .product-item {
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding: 1rem;
    }

    .product-list {
        grid-template-columns: 1fr; /* Одна колонка на мобильных */
        gap: 1.5rem;
        max-width: 400px; /* Ограничиваем максимальную ширину */
    }

    .product-item {
        padding: 1.5rem;
        min-height: 340px;
        max-width: 100%; /* Полная ширина на мобильных */
        width: 100%;
    }

    .product-image-container {
        height: 160px;
    }

    .product-name {
        font-size: 1.1rem;
    }

    .product-price {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .product-list {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0.5rem;
    }

    .product-item {
        padding: 1.2rem;
        min-height: 320px;
    }

    .product-image-container {
        height: 150px;
    }
}

/* ДОПОЛНИТЕЛЬНЫЙ СТИЛЬ ДЛЯ ЦЕНТРИРОВАНИЯ ОДНОЙ КАРТОЧКИ */
.product-list:has(.product-item:only-child) {
    display: flex;
    justify-content: center;
}

    .product-list:has(.product-item:only-child) .product-item {
        max-width: 280px;
    }

/* Специальные стили для продуктов пчеловодства */
.honey-product .product-item::before {
    background: linear-gradient(90deg, #ffd700, #ffb700);
}

.beeswax-product .product-item::before {
    background: linear-gradient(90deg, #f5d062, #e2b23b);
}

.propolis-product .product-item::before {
    background: linear-gradient(90deg, #a38d5e, #8a743c);
}

.royal-jelly-product .product-item::before {
    background: linear-gradient(90deg, #f0e6d4, #e6d6b5);
}
