/* ==== بداية كود CSS لصفحة عرض المنتجات (تحديث 8.0 - الصورة مربعة بالكامل والزوايا دائرية) ==== */

.mchp-product-showcase-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1300px;
    margin: 20px auto;
    padding: 15px;
    box-sizing: border-box;
}

.mchp-product-item {
    background-color: #333333;
    border-radius: 10px;
    margin-bottom: 35px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    position: relative;
    overflow: hidden;
}

/* --- قسم الصور (إصلاح المربع والزوايا) --- */
.mchp-product-image-wrap {
    /* Grid لتركيب الصور */
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
    
    /* جعل الحاوية مربعة تماماً */
    width: 100%;
    height: auto;      /* الارتفاع يتحدد تلقائياً بناءً على العرض */
    aspect-ratio: 1 / 1; /* إجبار الشكل على أن يكون مربعاً 1:1 */
    
    overflow: hidden;
    position: relative;
    
    /* إضافة مساحة صغيرة جداً داخلية لضمان عدم قص الزوايا */
    padding: 5px; 
}

.mchp-product-image-wrap img {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    
    display: block;
    width: 100%;
    height: 100%;
    
    /* contain: تضمن ظهور المنتج كاملاً داخل المربع دون قص */
    object-fit: contain; 
    
    /* زوايا دائرية للصورة (ستظهر الآن من جميع الجهات) */
    border-radius: 15px; 
    
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.mchp-product-image-wrap img.active {
    opacity: 1;
    z-index: 2;
}

/* --- النصوص والخطوط --- */
.mchp-product-details-wrap h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 2.4em;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
}

.mchp-product-description {
    font-size: 1.25em;
    line-height: 1.9;
    color: #c5d1de;
}

/* --- السعر --- */
.mchp-product-price {
    position: absolute;
    width: 280px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background-color: #333333;
    color: #ffd200 !important;
    font-size: 1.8em;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
    border: 1px solid #ffd200;
}

.mchp-product-price span, 
.mchp-product-price bdi, 
.mchp-product-price .woocommerce-Price-currencySymbol {
    color: #ffd200 !important;
}

/* --- الزر --- */
.mchp-product-button {
    display: inline-block;
    background-color: #ffd200;
    color: #232f3e;
    padding: 15px 45px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 800;
    transition: 0.2s;
    font-size: 1.1em;
}
.mchp-product-button:hover {
    background-color: #ffe045;
}

/* --- تنسيق سطح المكتب (Desktop Styles) --- */
@media (min-width: 769px) {
    .mchp-product-item {
        align-items: center;
        display: flex;
        justify-content: space-between;
    }
    
    .mchp-product-image-wrap {
        flex: 0 0 50%;
        max-width: 50%;
        /* إلغاء أي هوامش جانبية قد تؤثر على المربع */
        margin: 0; 
    }

    .mchp-product-details-wrap {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 10%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: right;
    }
    
    .mchp-product-item:nth-child(odd) .mchp-product-image-wrap { order: 0; }
    .mchp-product-item:nth-child(odd) .mchp-product-details-wrap { order: 1; }
    
    .mchp-product-item:nth-child(even) .mchp-product-image-wrap { order: 1; }
    .mchp-product-item:nth-child(even) .mchp-product-details-wrap { order: 0; }

    /* Price Ribbon */
    .mchp-product-item:nth-child(odd) .mchp-product-price {
        top: 140px; left: -45px; transform: rotate(-45deg); transform-origin: 0 0;
    }
    .mchp-product-item:nth-child(even) .mchp-product-price {
        top: 140px; right: -45px; transform: rotate(45deg); transform-origin: 100% 0;
    }

    /* Button */
    .mchp-product-button {
        position: static !important;
        transform: none !important;
        margin: 35px auto 0 auto;
        display: block;
        width: fit-content;
        min-width: 240px;
        text-align: center;
    }
}

/* --- تنسيق الهاتف (Mobile Styles) --- */
@media (max-width: 768px) {
    .mchp-product-showcase-container {
        padding: 2px !important;
        margin: 10px auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mchp-product-item {
        flex-direction: column;
        padding: 15px 5px;
        align-items: center;
        overflow: visible !important;
    }

    /* الصورة في الهاتف: مربعة أيضاً */
    .mchp-product-image-wrap {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        height: auto;
		/* زوايا دائرية للصورة (ستظهر الآن من جميع الجهات) */
    border-radius: 3px; 
        aspect-ratio: 1 / 1; /* مربع */
        margin-bottom: 20px;
        order: 1;
    }

    /* السعر */
    .mchp-product-item:nth-child(odd) .mchp-product-price,
    .mchp-product-item:nth-child(even) .mchp-product-price,
    .mchp-product-price {
        position: static !important;
        transform: none !important;
        top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
        
        display: inline-block !important;
        width: auto !important;
        height: auto !important;
        line-height: normal !important;
        
        order: 2;
        margin: 0 auto 20px auto !important;
        padding: 10px 30px !important;
        border-radius: 50px !important;
        
        background-color: #333333;
        color: #ffd200 !important;
        border: 2px solid #ffd200;
        font-size: 1.4em;
        z-index: 100;
    }

    .mchp-product-details-wrap {
        width: 100%;
        max-width: 100%;
        padding: 0 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        order: 3;
    }

    .mchp-product-details-wrap h2 {
        margin-bottom: 15px;
        font-size: 1.6em; 
    }
    
    .mchp-product-description {
        margin-bottom: 25px;
        font-size: 1.1em; 
    }

    .mchp-product-button {
        position: static !important;
        width: 100%;
        transform: none !important;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
}

/* ==========================================
   تنسيقات قسم الحزم (Bundles)
   ========================================== */

/* الحاوية الرئيسية للحزم */
.mchp-bundles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

/* بطاقة الحزمة الواحدة */
.mchp-bundle-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

/* تأثير جميل عند مرور الماوس على البطاقة */
.mchp-bundle-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

/* تأثير تكبير بسيط للصورة عند مرور الماوس */
.mchp-bundle-card img {
    transition: transform 0.3s ease;
}
.mchp-bundle-card:hover img {
    transform: scale(1.03);
}

/* تنسيق زر "أرسل طلب للحزمة" وتأثير الماوس عليه */
.mchp-bundle-card form button {
    transition: background 0.3s ease, color 0.3s ease !important;
}
.mchp-bundle-card form button:hover {
    background: #FFD700 !important;
    color: #333 !important;
    transform: scale(1.02);
}

/* تنسيق حقل الإيميل عند الكتابة فيه */
.mchp-bundle-card form input[type="email"]:focus {
    border-color: #FFD700 !important;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* ==========================================
   توافقية الهواتف الذكية (Responsive Design)
   ========================================== */
@media (max-width: 768px) {
    .mchp-bundle-card {
        max-width: 100% !important; /* لجعل البطاقة تأخذ عرض الشاشة بالكامل في الهواتف */
        margin-bottom: 30px;
    }
}
/* ==== نهاية كود CSS ==== */