﻿/* فونت‌های مینیمال و کاربرپسند */

.section-container {
    direction: rtl;
}

.section-title {
    text-align: right;
    font-size: 15px;
    margin-right: 20px;
    color: ghostwhite;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* عنوان اصلی صفحه */
.main-title {
    text-align: center;
    font-size: 20px;
    margin: 90px 0;
    color: #120d70;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* کانتینر اصلی برای اسکرول */
.product-carousel-container {
    width: 100%;
    overflow-x: auto; /* فعال کردن اسکرول افقی */
    white-space: nowrap; /* جلوگیری از رفتن آیتم‌ها به خط بعد */
    padding: 20px 0;
    -webkit-overflow-scrolling: touch; /* اسکرول نرم‌تر در iOS */
     /*scrollbar-width: auto;*/ /* -- این خط را اضافه کنید یا خط قبلی را حذف کنید اگر می‌خواهید نوار اسکرول دیده شود */
    /* -ms-overflow-style: auto; -- این خط را اضافه کنید یا خط قبلی را حذف کنید */
    margin-top: 5px; /* فاصله 70px از بالای صفحه برای اولین کارت (یا کانتینر) */
}

/* مخفی کردن نوار اسکرول در Webkit (Chrome, Safari) - این بخش را حذف یا کامنت کنید */
/*
.product-carousel-container::-webkit-scrollbar {
    display: none;
}
*/

/* چیدمان کارت‌های محصول */
.product-carousel {
    display: inline-block; /* اطمینان از اینکه آیتم‌ها در یک خط قرار می‌گیرند */
}

/* هر کارت محصول */
.product-card {
    display: inline-block; /* نمایش کنار هم */
    width: 280px; /* عرض ثابت کارت‌ها */
    margin: 0 15px; /* فاصله بین کارت‌ها */
    background: radial-gradient(circle at 70% 30%, #c6cccf, #f7faf9 60%);
    border-radius: 12px; /* گوشه‌های گرد نرم */
    border: 1px solid black ;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* سایه ملایم */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* انیمیشن نرم */
    vertical-align: top; /* هم‌ترازی بالا */
}

/* فاصله منفی برای آخرین کارت (ممکن است نیاز به تنظیم داشته باشد) */
.product-carousel-container:last-of-type { /* فرض بر این است که این کانتینر، آخرین المان اصلی است */
    margin-bottom: 20px; /* یا از margin-bottom در خود کارت آخر استفاده کنید */
}

.product-card:last-child {
    /* اگر می‌خواهید این فاصله فقط روی آخرین کارت اعمال شود */
    /* margin-bottom: 20px; -- این به دلیل display: inline-block ممکن است درست کار نکند */
}


.product-card:hover {
    transform: translateY(-7px); /* جلوه در هاور */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 1);
}

/* لینک کل کارت */
.product-link {
    text-decoration: none;
    color: inherit; /* ارث‌بری رنگ از والد */
    display: block; /* پوشش کل کارت */
    padding: 20px;
}

/* محدوده عکس محصول */
.product-image-wrapper {
    width: 100%;
    height: 130px; /* ارتفاع ثابت برای محدوده عکس */
    overflow: hidden; /* مخفی کردن بخش‌های اضافی عکس */
    border-radius: 30px;
    margin-bottom: 2px;
    position: relative; /* برای اطمینان از اینکه عکس درون این محدوده قرار می‌گیرد */
}

/* عکس محصول */
.product-image {
    display: block; /* اطمینان از اینکه عکس display block دارد */
    width: 100%;
    height: 100%;
    object-fit:fill; /* این مهمترین ویژگی برای نمایش کامل و برش عکس است */
    object-position: center center; /* مرکز کردن عکس در محدوده */
}

/* محدود کردن توضیحات */
.product-description-wrapper {
    flex-grow: 1; /* اجازه رشد به این بخش برای پر کردن فضای باقی‌مانده */
    overflow: hidden; /* مخفی کردن هرگونه متن اضافی */
    text-overflow: ellipsis; /* نمایش ... در صورت زیاد بودن متن (اختیاری) */
    display: -webkit-box; /* برای پشتیبانی بهتر از ellipsis در مرورگرهای مختلف */
    -webkit-line-clamp: 3; /* محدود کردن به ۳ خط */
    -webkit-box-orient: vertical;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* عنوان محصول */
.product-title {
    font-size: 15px;
    margin: 10px 0 10px 0;
    color: black;
}

/*دکمه جزییات*/
.btnDetails {
    text-align: center;
    font-size: 15px;
    margin: 0;
    padding: 5px;
    background: radial-gradient(circle at 70% 30%, #f0309d, #0f172a 60%);
    color: ghostwhite;
    border-radius: 30px;
}

/* توضیحات مختصر */
.product-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* رسپانسیو بودن */
@media (max-width: 768px) {
    .product-card {
        width: 240px; /* کمی باریک‌تر در تبلت‌ها */
        margin: 0 10px;
    }

    .product-image {
        height: 150px;
    }


    .product-carousel-container::-webkit-scrollbar {
        display: none;
    }

}

@media (max-width: 480px) {
    .product-carousel-container {
        padding: 10px 0;
        margin-top: 5px; /* تنظیم margin-top در موبایل */
    }

    .product-card {
        width: 220px; /* باریک‌تر در موبایل‌ها */
        margin: 0 8px;
    }

    .product-image {
        height: 130px;
    }

    .product-link {
        padding: 15px;
    }


    .product-carousel-container::-webkit-scrollbar {
        display: none;
    }

}

/* نمایش نوار اسکرول روی دسکتاپ */
@media (min-width: 992px) { /* نمایش روی دسکتاپ */
    .product-carousel-container {
        scrollbar-width: auto !important; /* Firefox */
        -ms-overflow-style: auto !important; /* IE and Edge */
    }

        .product-carousel-container::-webkit-scrollbar {
            display: block !important; /* Webkit */
            height: 8px; /* ضخامت نوار اسکرول */
        }

        .product-carousel-container::-webkit-scrollbar-track {
            background: #f1f1f1; /* رنگ پس‌زمینه نوار */
            border-radius: 10px;
        }

        .product-carousel-container::-webkit-scrollbar-thumb {
            background: #888; /* رنگ خود نوار */
            border-radius: 10px;
        }

            .product-carousel-container::-webkit-scrollbar-thumb:hover {
                background: #555; /* رنگ نوار در حالت هاور */
            }
}
