﻿/* خلفية الصفحة */
body {
    background: linear-gradient(to right, #f5f5f5, #e8f4fb);
    font-family: "Arial", sans-serif;
    margin: 0;
    padding: 0;
}

/* شبكة العرض */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* شبكة تناسب جميع الأجهزة */
    gap: 20px;
    padding: 20px;
    justify-content: center;
}

/* تصميم البطاقات */
.modern-grid-item {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 250px; /* تثبيت عرض البطاقة */
    height: 400px; /* تثبيت ارتفاع البطاقة */
    margin: auto;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

    .modern-grid-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }

/* صورة المنتج */
.product-image {
    width: 100%;
    height: 220px; /* ارتفاع ثابت للصورة */
    overflow: hidden;
    border-bottom: 1px solid #ddd;
}

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* لضمان احتواء الصورة في المنطقة */
    }

/ /* تفاصيل المنتج */
.product-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 120px; /* تخصيص المساحة للنص */
}

/* اسم المنتج */
.product-name {
    margin: 10px 0 5px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    text-transform: capitalize;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* لإخفاء النص الزائد */
    text-overflow: ellipsis; /* إضافة نقاط في النهاية عند النص الزائد */
    display: -webkit-box; /* استخدام box للنص */
    -webkit-line-clamp: 2; /* السماح بسطرين فقط */
    -webkit-box-orient: vertical; /* جعل الاتجاه عموديًا */
    word-wrap: break-word; /* السماح بقطع الكلمات الطويلة إذا لزم الأمر */
    line-height: 1.2; /* تحسين المسافات بين السطور */
}

/* سعر المنتج */
.product-price {
    font-size: 1.3rem;
    color: #e91e63; /* لون بارز للسعر */
    font-weight: bold;
    margin-bottom: 10px; /* مسافة صغيرة في الأسفل */
    text-align: center;
}

/* تحسين العرض على الهواتف */
@media (max-width: 768px) {
    .modern-grid {
        grid-template-columns: repeat(2, 1fr); /* بطاقتان في كل صف */
        gap: 15px;
    }

    .modern-grid-item {
        width: 100%; /* جعل العرض مرناً ليتناسب مع الشبكة */
        height: 300px; /* تقليل ارتفاع البطاقة */
    }

    .product-image {
        height: 180px; /* تقليل ارتفاع الصورة */
    }

    .product-name {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.1rem; /* حجم مناسب للهواتف */
    }
}

/* تحسين العرض على الشاشات الكبيرة */
@media (min-width: 1200px) {
    .modern-grid {
        gap: 30px;
    }

    .modern-grid-item {
        height: 420px;
    }

    .product-image {
        height: 250px;
    }

    .product-name {
        font-size: 1.5rem;
    }
}

/* تنسيق الحاوية */
.lottary-container {
    position: relative;
    width: 100%; /* عرض الحاوية كامل الشاشة */
    max-width: 600px; /* أقصى عرض للحاوية */
    margin: 0 auto; /* توسيط الحاوية */
    overflow: hidden; /* لإخفاء الزوائد */
    border: 2px solid #FF6F00; /* إطار برتقالي */
    border-radius: 10px; /* زوايا مستديرة */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* ظل خفيف */
}

/* تنسيق الصورة */
.lottary-image {
    display: block;
    width: 100%; /* عرض الصورة يتناسب مع عرض الحاوية */
    height: auto; /* الحفاظ على نسبة الأبعاد */
    object-fit: cover; /* عرض كامل للصورة داخل الحاوية */
    border-radius: 10px; /* زوايا مستديرة للصورة متوافقة مع الحاوية */
}

/* إضافة استجابة للشاشات الصغيرة */
@media (max-width: 576px) {
    .lottary-container {
        max-width: 90%; /* تقليل عرض الحاوية على الشاشات الصغيرة */
    }
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 16px;
    gap: 5px;
}

    .product-price .old-price {
        text-decoration: line-through;
        color: gray;
        font-size: 14px;
    }

    .product-price .new-price {
        color: red;
        font-weight: bold;
        font-size: 16px;
    }

    .product-price .arrow {
        color: green;
        font-size: 16px;
    }

/* على الموبايل: نخفي السهم ونرتب السعر عمودي */
@media (max-width: 768px) {
    .product-price .arrow {
        display: none;
    }

    .product-price {
        flex-direction: column;
    }
}
