/* --- تعديلات عامة للخلفية والخطوط --- */

/* خلفية الصفحة باللون الكريمي من الباليت */
body {
    background-color: #f3f0ea !important;
    color: #4a5d43 !important; /* لون النص الأساسي */
}

.s-block.s-block--best-offers.container {
    padding-bottom: 4rem !important;
}

.mm-spn li:after {
    display: none !important;
}

i.hidden.text-base.sicon-shopping-bag {
    display: inline;
    margin-left: 10px;
    color: #4a5d43 !important; /* أيقونة الحقيبة */
}

/* --- تعديلات كرت المنتج (Product Card) --- */

custom-salla-product-card.s-product-card-entry,
salla-products-list .s-products-list-wrapper .s-product-card-entry,
salla-products-list .s-products-slider-slider .s-product-card-entry,
salla-products-slider .s-products-list-wrapper .s-product-card-entry,
salla-products-slider .s-products-slider-slider .s-product-card-entry {
    /* لون الإطار الزيتوني الفاتح */
    border: 1px solid #7f8c6f !important;
    border-radius: 7px !important;
    padding: 10px !important;
    /* خلفية الكرت بيضاء لعمل تباين مع خلفية الموقع الكريمية */
    background: #f3f0ea !important;
    /* ظل خفيف مائل للأخضر بدلاً من الأسود */
    box-shadow: 0 4px 12px rgba(74, 93, 67, 0.08) !important;
    transition: all 0.3s ease-in-out !important;
    position: relative !important;
}

/* حالة المرور بالماوس (Hover) على المنتج */
custom-salla-product-card.s-product-card-entry:hover,
salla-products-list .s-products-list-wrapper .s-product-card-entry:hover,
salla-products-list .s-products-slider-slider .s-product-card-entry:hover,
salla-products-slider .s-products-list-wrapper .s-product-card-entry:hover,
salla-products-slider .s-products-slider-slider .s-product-card-entry:hover {
    /* الإطار يصبح باللون الزيتي الغامق */
    border-color: #4a5d43 !important;
    /* الظل يصبح أقوى وأكثر عمقاً */
    box-shadow: 0 12px 24px rgba(74, 93, 67, 0.25) !important;
    transform: translateY(-5px) !important;
}

/* --- العناوين والنصوص --- */

.ronaq-store-footer h3 {
    font-weight: 800 !important;
    color: #4a5d43 !important;
}

.container .s-menu-footer-item,
.container .s-contacts-item,
.container .s-contacts-item span,
.container p {
    color: #4a5d43 !important; /* توحيد لون النصوص للزيتي الغامق */
}

/* القوائم الفرعية - Hover بلون الوردي الترابي */
.sub-menu ul li a span:hover {
    color: #c6a3a1 !important;
}

/* القوائم في الموبايل */
.main-nav-container .mobile-menu .main-menu .sub-menu {
    background-color: #f3f0ea !important; /* خلفية القائمة كريمي */
}
.main-nav-container .mobile-menu .main-menu .sub-menu li > a {
    color: #4a5d43 !important;
}

.s-products-list-wrapper {
    margin-top: 10px;
}

.s-product-card-content-footer * {
    border: unset !important;
}

/* الصور داخل الكروت */
.s-product-card-image img {
    height: 200px;
    object-fit: cover; /* لضمان عدم مط الصور */
}

/* عناوين المنتجات */
.s-product-card-content-title * {
    color: #4a5d43 !important;
}

/* الروابط العلوية Hover */
.main-nav-container .mobile-menu .main-menu li.root-level > a span {
    transition: color 0.3s ease;
    color: #4a5d43;
}

.main-nav-container .mobile-menu .main-menu li.root-level > a span:hover {
    color: #c6a3a1 !important; /* Hover وردي */
}

/* رابط العروض (Offers Link) */
a.offers-link * {
    --tw-text-opacity: 1 !important;
    /* تغيير الأحمر السابق إلى الوردي الغامق من الباليت ليكون متناسقاً */
    color: #c6a3a1 !important; 
}

.s-product-card-image {
    background: #fff !important;
}

/* --- Media Queries (الشاشات الكبيرة) --- */
@media (min-width: 1024px) {
    #mainnav .nav-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        position: relative;
    }
    /* ... (بقية تنسيق الناف بار كما هو، فقط تأكد من الألوان) ... */
    
    .sub-menu {
        width: auto !important;
        min-width: 280px;
        max-width: 100%;
        padding-inline: 16px;
        white-space: nowrap;
        max-height: 50vh;
        overflow-y: auto;
        background-color: #ffffff !important; /* خلفية القائمة المنسدلة */
        border: 1px solid #7f8c6f !important;
    }
    
    .s-block--best-offers .swiper-wrapper.s-slider-swiper-wrapper {
        margin-top: 10px;
    }

    .s-product-card-entry {
        overflow: hidden;
    }

    /* زر الإضافة للسلة (يظهر عند الهوفر) */
    .s-product-card-content-footer * {
        color: #fff !important;
    }

    .s-product-card-content-footer {
        transition: all 0.4s ease-out;
        transform: translateX(-100%);
        opacity: 0;
        /* الخلفية الأساسية للزر هي الزيتي الغامق */
        background-color: #4a5d43 !important; 
    }

    custom-salla-product-card:hover .s-product-card-content-footer {
        transform: translateX(0);
        opacity: 1;
        box-shadow: 0 4px 12px rgba(74, 93, 67, 0.25);
        border-color: #4a5d43;
        background-color: #4a5d43 !important;
    }

    custom-salla-product-card:hover .s-product-card-content-footer salla-button {
        transform: scale(1.02);
        transition: transform 0.3s ease;
    }

    .s-product-card-content-footer .s-button-text span {
        display: inline-block;
        transition: transform 0.3s ease;
    }

    custom-salla-product-card:hover .s-product-card-content-footer .s-button-text span {
        transform: translateX(5px);
    }
    
    /* تأثير اللمعة على الزر */
    .s-product-card-content-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.7s ease;
    }

    custom-salla-product-card:hover .s-product-card-content-footer::before {
        left: 100%;
    }   
}

/* --- Media Queries (الموبايل) --- */
@media (max-width: 767px) {
    .main-menu {
        display: flex !important;
        flex-direction: column !important;
        background-color: #f3f0ea !important; /* خلفية القائمة للموبايل */
    }

    salla-products-list .s-products-list-wrapper .s-product-card-entry .s-product-card-image,
    salla-products-list .s-products-slider-slider .s-product-card-entry .s-product-card-image,
    salla-products-slider .s-products-list-wrapper .s-product-card-entry .s-product-card-image,
    salla-products-slider .s-products-slider-slider .s-product-card-entry .s-product-card-image {
        max-height: 130px !important;
    }

    .s-product-card-image img {
        height: 130px;
    }
        
    .s-product-card-content-footer {
        border: 2px solid #4a5d43; /* إطار الزر في الموبايل */
        width: 100%;
        height: 2.6rem;
        border-radius: 7px;
        background-color: #4a5d43 !important; /* خلفية الزر */
    }

    .mm-spn li a, .mm-spn li > span {
        color: #4a5d43;
    }
}

/* تأكيد أخير على أزرار الفوتر للكروت */
.s-product-card-content-footer * {
    color: #fff !important; /* النص داخل الزر أبيض */
}

.s-product-card-content-footer {
    background-color: #4a5d43 !important; /* الزيتي الغامق */
    width: 100%;
    height: 2.6rem;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: none;
}

/* --- ترتيب القائمة (كما هو في الكود الأصلي) --- */
.main-menu.mm-spn--open {
    display: flex !important;
} 
.main-menu li a {
    display: flex !important;
}
.main-menu li:nth-child(4) { order: 1 !important; }
.main-menu.mm-spn--open > li:nth-child(1) { order: 1 !important; }
.main-menu.mm-spn--open li:nth-child(2) { order: 2 !important; }
.main-menu.mm-spn--open li:nth-child(8) { order: 3 !important; }
.main-menu.mm-spn--open li:nth-child(10) { order: 4 !important; }
.main-menu.mm-spn--open li:nth-child(14) { order: 5 !important; }
.main-menu.mm-spn--open li:nth-child(6) { order: 6 !important; }
.main-menu.mm-spn--open li:nth-child(12) { order: 7 !important; }
.main-menu.mm-spn--open li:nth-child(16) { order: 8 !important; }
.main-menu.mm-spn--open li:nth-child(18) { order: 9 !important; }
.main-menu.mm-spn--open li:nth-child(20) { order: 10 !important; }

@media(max-width: 1024px) {
    .main-menu.mm-spn--open > li:nth-child(1) { order: -1 !important; }
    .main-menu.mm-spn--open > li:nth-child(3) { order: -2 !important; }
}