/* ============================================================
   mahwous.com | CSS النهائي الكامل الموحد
   منصة سلة | ثيم ملاك
   يشمل: CLS + جماليات + SEO + تحسين التحويل
   ============================================================ */

/* ============================================================
   1. إصلاح CLS - حجز مساحة البنر الرئيسي قبل التحميل
   ============================================================ */
.s-block--hero-slider.full-banner salla-slider,
.s-block--hero-slider.full-banner .s-slider-wrapper {
    display: block;
    min-height: 420px;
    background-color: #111;
}
@media (max-width: 767px) {
    .s-block--hero-slider.full-banner salla-slider,
    .s-block--hero-slider.full-banner .s-slider-wrapper {
        min-height: 220px;
    }
}

/* ============================================================
   2. إصلاح الفراغ الأبيض تحت البنر
   المشكلة: s-angel--divider يضيف padding زائد بعد البنر
   ============================================================ */
.s-block--hero-slider + .s-angel--divider {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.s-block--hero-slider + .s-block {
    margin-top: 0 !important;
}
.s-angel--divider.merge-bottom {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ============================================================
   3. إصلاح بطاقات الأقسام (banner-square)
   الخلفيات الشفافة PNG تظهر بلون متجانس بدلاً من الأبيض
   ============================================================ */
.banner-square .box-img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f5f0e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-square .box-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
/* الأقسام الدائرية */
.s-block--banners .banner-square .box-img {
    border-radius: 50%;
}
.s-block--banners .banner-square {
    text-align: center;
    transition: transform 0.3s ease;
}
.s-block--banners .banner-square:hover {
    transform: translateY(-4px);
}
.s-block--banners .banner-square a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* ============================================================
   4. إصلاح صور المنتجات - منع CLS وتوحيد المظهر
   ============================================================ */
.s-product-card-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f9f6f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.s-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s ease;
}
.s-product-card-entry:hover .s-product-card-image img {
    transform: scale(1.05);
}

/* ============================================================
   5. شريط الإعلانات العلوي
   ============================================================ */
.angel-ad {
    min-height: 36px;
}

/* ============================================================
   6. تحسينات جمالية لبطاقات المنتجات
   ============================================================ */
.s-product-card-entry {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border-radius: 12px !important;
    overflow: hidden;
}
.s-product-card-entry:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}
.s-product-card-entry .s-button-primary {
    border-radius: 8px !important;
    font-weight: 600;
    transition: background-color 0.25s ease, transform 0.2s ease !important;
}
.s-product-card-entry .s-button-primary:hover {
    transform: scale(1.02);
}

/* ============================================================
   7. تحسين صفحة المنتج
   ============================================================ */
salla-add-to-cart button,
.s-product-form__actions .s-button-primary {
    border-radius: 10px !important;
    padding: 14px 28px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
}
.is-sticky-product-bar {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
}

/* ============================================================
   8. تحسين الفوتر
   ============================================================ */
footer a:hover,
.s-footer a:hover {
    color: #ddb562 !important;
    transition: color 0.2s ease;
}

/* ============================================================
   9. تحسينات الجوال
   ============================================================ */
@media (max-width: 767px) {
    .s-block {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    .is-sticky-product-bar salla-add-to-cart button,
    .is-sticky-product-bar .s-button-primary {
        font-size: 0.9rem !important;
        padding: 12px 20px !important;
    }
}

/* ============================================================
   10. عداد العد التنازلي (CRO)
   ============================================================ */
.mh-countdown {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.mh-countdown__label {
    font-size: 0.88rem;
    color: #f5c842;
    font-weight: 600;
    white-space: nowrap;
}
.mh-countdown__timer {
    display: flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
}
.mh-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 48px;
}
.mh-countdown__unit span {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
    color: #fff;
}
.mh-countdown__unit small {
    font-size: 0.65rem;
    color: #aaa;
    margin-top: 3px;
}
.mh-countdown__sep {
    font-size: 1.4rem;
    font-weight: bold;
    color: #f5c842;
    margin-bottom: 10px;
}
@media (max-width: 767px) {
    .mh-countdown { justify-content: center; text-align: center; }
}

/* ============================================================
   11. الدليل الاجتماعي - عداد المشترين (CRO)
   ============================================================ */
.mh-social-proof {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin: 12px 0;
    border-right: 3px solid #ddb562;
}
.mh-social-proof__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #444;
}
.mh-social-proof__item strong { color: #222; }

/* ============================================================
   12. شارة نسبة التوفير على بطاقات المنتجات (CRO)
   ============================================================ */
.mh-save-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: #fff;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(230,57,70,0.4);
    white-space: nowrap;
    pointer-events: none;
}

/* ============================================================
   13. بنر التوفير في صفحة المنتج (CRO)
   ============================================================ */
.mh-save-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fff8e1;
    border: 1px solid #f5c842;
    color: #7a5c00;
    font-size: 0.88rem;
    padding: 8px 14px;
    border-radius: 8px;
    margin: 10px 0;
}
.mh-save-banner strong { color: #c1121f; }

/* ============================================================
   14. زر العودة للأعلى (UX)
   ============================================================ */
.mh-top-btn {
    position: fixed;
    bottom: 30px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ddb562;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    z-index: 998;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    visibility: hidden;
    line-height: 1;
}
.mh-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}
.mh-top-btn:hover {
    background-color: #c9a040;
    transform: translateY(-3px);
}
@media (max-width: 767px) {
    .mh-top-btn {
        bottom: 90px;
        left: 14px;
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
   15. منع FOUT وتحسين الأداء
   ============================================================ */
@font-face { font-display: swap; }
body { font-display: swap; }
img[loading="lazy"] { content-visibility: auto; }