/* products.css - النسخة المحسنة مع إصلاح الصور */

/* Variables - استخدام ألوان VIZZER */
:root {
    --primary-color: #dc3545; /* الأحمر */
    --primary-light: rgba(220, 53, 69, 0.1);
    --secondary-color: #000000; /* الأسود */
    --accent-color: #D4AF37; /* الذهبي */
    --light-bg: #f8f9fa;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* تحسين الصور - الجزء الأهم */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px; /* ارتفاع ثابت */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* الحاوية الداخلية للصورة */
.product-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* الصورة نفسها */
.product-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* هذا هو الحل السحري */
    transition: transform 0.5s ease;
    border-radius: 8px;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* تأثير عند التمرير */
.product-card:hover .product-img {
    transform: scale(1.05);
}

/* معالجة الصور التالفة */
.product-img[src*="default"] {
    padding: 30px;
}

.product-img:before {
    content: "No Image";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.9rem;
}

/* Quick View Overlay - تحسين */
.quick-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-image-wrapper:hover .quick-view-overlay {
    opacity: 1;
}

.quick-view-text {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.quick-view-text:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Flavor Badge - تحسين */
.flavor-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.flavor-badge .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid var(--accent-color);
}

/* Product Card General Styles */
.product-card {
    transition: var(--transition);
    border-radius: 12px !important;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary-light);
}

/* Product Info */
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem !important;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Footer */
.product-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* زر إضافة السلة */
.add-to-cart-btn {
    background: var(--primary-color);
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-to-cart-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Hero Section تحسين */
.products-hero {
    background: linear-gradient(135deg, var(--secondary-color), #1a252f);
    color: white;
    padding: 60px 0;
    margin-top: 80px;
}

.hero-flavor-badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Responsive Design - تحسين */
@media (max-width: 768px) {
    .product-image-wrapper {
        height: 180px;
        padding: 15px;
    }
    
    .product-img {
        max-height: 150px;
    }
    
    .products-hero {
        text-align: center;
        padding: 40px 0;
    }
    
    .product-title {
        font-size: 0.95rem;
        min-height: 35px;
    }
    
    .price {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .product-image-wrapper {
        height: 150px;
        padding: 10px;
    }
    
    .product-img {
        max-height: 130px;
    }
    
    .product-title {
        font-size: 0.9rem;
        min-height: 32px;
    }
    
    .add-to-cart-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .flavor-badge .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* Animation for cart add */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.add-to-cart-btn.added {
    animation: pulse 0.5s ease;
    background: #28a745 !important;
}

/* Loading state */
.product-image-wrapper.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* إضافات لـ products.css */

/* Offer Banner */
.offer-banner {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Hero Section */
.hero-cta {
    margin-top: 2rem;
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc3545;
}

.stat-label {
    font-size: 0.85rem;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.filter-btn.active {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Product Card Enhancements */
.category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.product-rating {
    font-size: 0.85rem;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.newsletter-form .form-control {
    border: none;
    padding: 0.75rem 1rem;
}

.newsletter-form .btn {
    padding: 0.75rem 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-cta .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
}

/* Animation for product cards */
.product-item {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}