/**
 * Product Card Styles
 * Повторно використовувані стилі для карток товарів (слайдер + категорії)
 * 
 * @package MyFood
 * @since 1.0
 */

/* ==========================================================================
   PRODUCT CARD BASE
   ========================================================================== */

.product-card {
    background-color: #ffffff;
    border-radius: 35px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   IMAGE
   ========================================================================== */

.product-card__image-wrapper {
    position: relative;
    width: 100%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.product-card__image-container {
    width: 100%;
    height: auto;
    border-radius: 25px;
    background-color: #d4e8f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 210 / 170;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.product-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ebebeb;
    aspect-ratio: 210 / 170;
}

/* ==========================================================================
   CONTENT
   ========================================================================== */

.product-card__content {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__title {
    color: #3a3d4e;
    font-size: 18px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 600;
    margin: 0 0 10px;
}

.product-card__description {
    color: #3a3d4e;
    font-size: 14px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 400;
    margin: 0 0 15px;
}

/* ==========================================================================
   SIZES, PRICES & ADDONS
   ========================================================================== */

.product-card__sizes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.product-card__size-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Size info row */
.product-card__size-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.product-card__size-label {
    color: #3a3d4e;
    font-size: 14px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 500;
    flex: 1;
}

.product-card__price {
    color: #98b646;
    font-size: 24px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 500;
    flex-shrink: 0;
}

/* Addons */
.product-card__addons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 15px;
}

.product-card__addon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.product-card__addon-name {
    color: #3a3d4e;
    font-size: 13px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 400;
    flex: 1;
}

.product-card__addon-price {
    color: #98b646;
    font-size: 13px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 500;
    flex-shrink: 0;
}

/* ==========================================================================
   ORDER BUTTONS (GLOVO, Bolt, LOKO)
   ========================================================================== */

.product-card__order-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.product-card__order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    padding: 0 20px;
    border-radius: 20px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.product-card__order-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.product-card__order-btn:active {
    transform: translateY(0);
    opacity: 0.85;
}

/* GLOVO - яскравий оранжевий (як на скріншоті) */
.product-card__order-btn--glovo {
    background-color: #FFC042;
    color: #017963;
}

/* Bolt Food - яскравий зелений (як на скріншоті) */
.product-card__order-btn--bolt {
    background-color: #32BB78;
}

/* LOKO - яскравий червоний (як на скріншоті) */
.product-card__order-btn--loko {
    background-color: #FB395F;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet Large: <= 1199px */
@media screen and (max-width: 1199px) {
    .product-card__image-container {
        width: 100%;
        height: auto;
    }
    
    .product-card__title {
        font-size: 17px;
    }
    
    .product-card__description {
        font-size: 13px;
    }
    
    .product-card__price {
        font-size: 22px;
    }
}

/* Tablet: <= 959px */
@media screen and (max-width: 959px) {
    .product-card__image-container {
        width: 100%;
        height: auto;
    }
    
    .product-card__title {
        font-size: 18px;
    }
    
    .product-card__description {
        font-size: 14px;
    }
}

/* Mobile Large: <= 639px */
@media screen and (max-width: 639px) {
    .product-card__image-wrapper {
        padding: 15px;
    }
    
    .product-card__image-container {
        width: 100%;
        height: auto;
    }
    
    .product-card__content {
        padding: 0 15px 15px;
    }
    
    .product-card__price {
        font-size: 20px;
    }
    
    .product-card__addon-name,
    .product-card__addon-price {
        font-size: 12px;
    }
}

/* Mobile: <= 479px */
@media screen and (max-width: 479px) {
    .product-card {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .product-card__image-wrapper {
        padding: 15px;
    }
    
    .product-card__image-container {
        width: 100%;
        height: auto;
    }
    
    .product-card__content {
        padding: 0 20px 20px;
    }
    
    .product-card__title {
        font-size: 17px;
        text-align: center;
    }
    
    .product-card__description {
        font-size: 14px;
        text-align: center;
    }
    
    .product-card__size-label {
        font-size: 13px;
    }
    
    .product-card__price {
        font-size: 20px;
    }
    
    .product-card__addon-name,
    .product-card__addon-price {
        font-size: 11px;
    }
    
    .product-card__order-btn {
        height: 36px;
        font-size: 14px;
        padding: 0 15px;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* CSS Containment для ізоляції layout/paint (Core Web Vitals) */
.product-card {
    contain: layout style paint;
}

/* GPU Acceleration тільки при hover (економія ресурсів) */
.product-card:hover {
    will-change: transform;
}

/* Content Visibility для off-screen елементів */
@supports (content-visibility: auto) {
    .swiper-slide:not(.swiper-slide-visible) .product-card {
        content-visibility: auto;
        contain-intrinsic-size: 250px 445px; /* Примірні розміри для резервування простору */
    }
}

