/* ==========================================================================
   افزونه Product Showcase - فایل استایل کامل (با گالری تصاویر)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;900&display=swap');
body { font-family: "Vazirmatn", sans-serif; }

/* --- کانتینر اصلی محصولات --- */
.product-showcase-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

/* --- کارت هر محصول --- */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

/* --- گالری کوچک تصاویر در کارت --- */
.product-card-images {
    display: flex;
    flex-wrap: wrap;
    width: 40%;
    background-color: #f8f8f8;
    align-items: center;
    justify-content: center;
}
.product-card-images img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 5px;
    box-sizing: border-box;
}
.product-card-images img:first-child {
    width: 100%;
    height: auto;
    max-height: 150px;
}

/* --- بخش محتوای متن --- */
.product-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.product-content h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}
.product-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.7;
    flex-grow: 1;
}
.product-buttons {
    display: flex;
    gap: 10px;
    flex-direction: column;
}
.ps-view-details, .ps-catalog-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.ps-view-details { background: #0073aa; color: #fff; }
.ps-view-details:hover { background: #005a87; }
.ps-catalog-btn { background: #f0f0f0; color: #333; border: 1px solid #ddd; }
.ps-catalog-btn:hover { background: #e0e0e0; }

/* ==========================================================================
   مودال (پنجره پاپ‌آپ) جزئیات محصول - با گالری تصاویر
   ========================================================================== */
.ps-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    animation: fadeIn 0.5s ease-out;
}

.ps-modal-content {
    position: relative;
    background: #ffffff;
    margin: 50px auto;
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: rtl;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* هدر مودال که گالری تصاویر را در خود جای می‌دهد */
.ps-modal-header {
    width: 100%;
    min-height: 300px;
    background-color: #000;
    display: flex;
    flex-direction: column;
}

/* کانتینر اصلی گالری */
#ps-gallery-container {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* کانتینر تصویر بزرگ */
.ps-main-image-container {
    width: 100%;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#ps-modal-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* کانتینر بندانگشتی‌ها */
.ps-thumbnails-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* استایل بندانگشتی‌ها */
.ps-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* افکت بندانگشتی فعال و هاور */
.ps-thumbnail.active,
.ps-thumbnail:hover {
    opacity: 1;
    border-color: #0073aa;
    transform: scale(1.1);
}

/* دکمه بستن مودال */
.ps-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}
.ps-close:hover {
    background: rgba(255,255,255,0.9);
    color: #000;
    transform: rotate(90deg);
}

/* بدنه اصلی مودال */
.ps-modal-body {
    padding: 40px;
    overflow-y: auto;
    flex-grow: 1;
}
.ps-modal-body h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}
.ps-modal-body-content {
    font-size: 16px;
    line-height: 1.9;
    color: #555;
}
.ps-modal-body-content h1, .ps-modal-body-content h2, .ps-modal-body-content h3 {
    color: #34495e;
    margin-top: 25px;
}
.ps-modal-body-content ul, .ps-modal-body-content ol {
    padding-right: 20px;
}

/* --- انیمیشن‌ها --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(100px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* --- واکنش‌گرایی --- */
@media (max-width: 768px) {
    .product-card {
        flex-direction: column;
    }
    .product-card-images {
        width: 100%;
        max-height: 200px;
    }
    .product-card-images img:first-child {
        max-height: 200px;
    }
    .product-card-images img:not(:first-child) {
        display: none;
    }
    .ps-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    .ps-main-image-container {
        height: 250px;
    }
    .ps-modal-body {
        padding: 25px;
    }
    .ps-modal-body h2 {
        font-size: 24px;
    }
}