/* ==================== Product Pages Modern Theme ==================== */

/* تنظیمات کلی صفحه */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%) !important;
    color: #2d3748 !important;
    padding: 50px 20px !important;
    min-height: 100vh;
}

/* عنوان اصلی صفحه */
h1 { 
    text-align: center; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px; 
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: none;
}

/* گالری محصولات */
.gallery {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* دکمه‌های بازگشت */
.back-buttons {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.back-btn {
    padding: 12px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.products-btn { 
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
}

.home-btn { 
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #ffffff;
    border: none;
}

.back-btn:hover { 
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* کارت محصول */
.product-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.product-card:hover { 
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

/* تصویر محصول */
.product-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-image:hover { 
    transform: scale(1.08);
}

/* اورلی محصول */
.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(102, 126, 234, 0.95));
    padding: 20px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.product-card:hover .product-overlay { 
    transform: translateY(0);
}

/* عنوان و توضیحات محصول */
.product-title { 
    font-size: 1.3rem; 
    margin-bottom: 8px; 
    color: #ffffff;
    font-weight: 700;
}

.product-type { 
    font-size: 1rem; 
    color: rgba(255, 255, 255, 0.9);
}

/* فال‌بک برای تصاویر */
.product-fallback {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
    cursor: pointer;
    padding: 20px;
}

/* دکمه‌های اکشن */
.product-actions {
    display: flex;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    gap: 12px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.share-btn:hover {
    background: linear-gradient(135deg, #764ba2, #f093fb);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.favorite-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.favorite-btn:hover {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.favorite-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* مودال تصویر */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content-image {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    transform: rotate(90deg);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    body {
        padding: 80px 15px 30px !important;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .back-buttons {
        top: 60px;
        left: 15px;
        gap: 10px;
    }

    .back-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .product-image-container,
    .product-fallback {
        height: 220px;
    }

    .product-title {
        font-size: 1.1rem;
    }

    .product-type {
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .back-buttons {
        top: 55px;
        left: 10px;
    }

    .back-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .product-image-container,
    .product-fallback {
        height: 200px;
    }

    .product-actions {
        flex-direction: column;
        gap: 10px;
    }

    .action-btn {
        width: 100%;
    }

    .close-modal {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
}

/* انیمیشن‌های بارگذاری */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
