/* ============================================
   PRODUCT CARDS - Сучасний дизайн
   Акцентний колір: #cadbcd (м'ятний)
   ============================================ */

.product-item {
    padding: 10px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;

    /* ДОДАНО: Встановлюємо мін. висоту та flex-контейнер */
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

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

/* ============================================
   1. БЛОК ЗОБРАЖЕННЯ
   ============================================ */
.product__item__pic {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 4px 15px rgba(202, 219, 205, 0.2);
    transition: all 0.4s ease;
    margin-bottom: 15px;
}

.product__item__pic:hover {
    box-shadow: 0 8px 30px rgba(202, 219, 205, 0.4);
}

.product__item__pic img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product__item__pic:hover img {
    transform: scale(1.08);
}

/* Карусель/Слайдер */
.carousel {
    position: relative;
    width: 100%;
}

.slider-image {
    display: none;
    width: 100%;
}

.slider-image.active {
    display: block;
}

/* ============================================
   2. БЕЙДЖІ
   ============================================ */
.prod-badge {
    position: relative;
}

.badge-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.good_badge {
    display: inline-block;
    background: linear-gradient(135deg, #cadbcd 0%, #a8c4ab 100%);
    color: #2d4a2f;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(202, 219, 205, 0.5);
    backdrop-filter: blur(10px);
}

/* ============================================
   3. КОНТРОЛЕРИ (КОЛЬОРИ/РОЗМІРИ)
   ============================================ */
.thumbnail-container {
    min-height: 40px;
    margin-bottom: 12px;
    padding: 0 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Кольорові мініатюри */
.color-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-thumbnail:hover {
    border-color: #cadbcd;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(202, 219, 205, 0.4);
}

.color-thumbnail.active-thumbnail {
    border-color: #cadbcd;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(202, 219, 205, 0.3);
}

.color-thumbnail.active-thumbnail::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2d4a2f;
    font-size: 14px;
    font-weight: bold;
}

/* Розмірові кнопки */
.size-thumb {
    min-width: 40px;
    height: 32px;
    padding: 0 12px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-thumb:hover {
    border-color: #cadbcd;
    background: #cadbcd;
    color: #2d4a2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(202, 219, 205, 0.3);
}

/* ============================================
   4. ТЕКСТОВИЙ БЛОК
   ============================================ */

/* ДОДАНО: Нове правило для посилання, що обгортає текст */
.product-item > a {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Змушує блок посилання рости */
}

.product__item__text {
    text-align: center;
    padding: 15px 10px;

    /* ДОДАНО: Робимо текстовий блок гнучким, щоб кнопка прибилась до низу */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product__item__text h2 {
    font-size: 16px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.3s ease;

    /* ВИДАЛЕНО: Обмеження тексту */
    /*
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    */
}

.product:hover .product__item__text h2 {
    color: #5a7a5d;
}

.product_price {
    font-size: 22px;
    font-weight: 700;
    color: #2d4a2f;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* ============================================
   5. КНОПКА КУПИТИ
   ============================================ */
.btn-buy {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #cadbcd 0%, #b5cdb8 100%);
    color: #2d4a2f;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(202, 219, 205, 0.3);
    position: relative;
    overflow: hidden;

    /* ДОДАНО: Магія, що притискає кнопку до низу */
    margin-top: auto;
}

.btn-buy::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-buy:hover::before {
    width: 300px;
    height: 300px;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(202, 219, 205, 0.5);
    background: linear-gradient(135deg, #b5cdb8 0%, #a8c4ab 100%);
}

.btn-buy:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(202, 219, 205, 0.4);
}

/* ============================================
   6. АДАПТИВНІСТЬ
   ============================================ */
@media (max-width: 768px) {
    .product-item {
        margin-bottom: 20px;
        /* ЗМІНЕНО: Прибираємо фіксовану висоту на моб. пристроях */
        min-height: auto;
    }

    .product__item__pic {
        border-radius: 15px;
    }

    .product__item__text h2 {
        font-size: 14px;
        /* ВИДАЛЕНО: min-height: 40px; */
        /* ДОДАНО: Повертаємо обмеження на моб. пристроях, якщо потрібно */
        /*
        min-height: 40px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        */
    }

    .product_price {
        font-size: 20px;
    }

    .btn-buy {
        padding: 10px 16px;
        font-size: 14px;
        /* ЗМІНЕНО: Прибираємо притискання до низу на моб. пристроях */
        margin-top: 0;
    }

    .good_badge {
        font-size: 11px;
        padding: 6px 12px;
    }

    .color-thumbnail {
        width: 28px;
        height: 28px;
    }

    .size-thumb {
        min-width: 36px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .product__item__pic {
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .badge-overlay {
        top: 10px;
        left: 10px;
    }

    .thumbnail-container {
        min-height: 35px;
        gap: 6px;
    }

    .product__item__text {
        padding: 10px 5px;
    }
}

/* ============================================
   7. ДОДАТКОВІ ЕФЕКТИ
   ============================================ */

/* Плавна поява карток */
.product-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Затримка для ефекту каскаду */
.product:nth-child(1) { animation-delay: 0.1s; }
.product:nth-child(2) { animation-delay: 0.2s; }
.product:nth-child(3) { animation-delay: 0.3s; }
.product:nth-child(4) { animation-delay: 0.4s; }
.product:nth-child(n+5) { animation-delay: 0.5s; }

/* Посилання без підкреслення */
.product-item a {
    text-decoration: none;
    color: inherit;
}

.product-item a:hover {
    text-decoration: none;
}
