.rtl {
	direction:ltr;
}

.site-header:lang(ar) {
	direction:rtl!important;
}

p:lang(ar) {
	direction:rtl!important;
}

h1:lang(ar) {
	direction:rtl!important;
}

h2:lang(ar) {
	direction:rtl!important;
}

h3:lang(ar) {
	direction:rtl!important;
}

h4:lang(ar) {
	direction:rtl!important;
}

span:lang(ar) {
	direction:rtl!important;
}

#footer_box:lang(ar) {
	direction:rtl!important;
} 
/* 🔧 إصلاح المحاذاة في النسخة العربية - قالب Warehouse Cargo Pro */

/* ضبط الاتجاه العام للصفحة */
html[lang="ar"], body[lang="ar"] {
  direction: rtl !important;
  text-align: right !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

/* إصلاح الحاويات الرئيسية */
.container,
.container-fluid,
.site-content,
.wrapper,
.main-content {
  margin: 0 auto !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* تصحيح المسافات الناتجة عن bootstrap في RTL */
html[lang="ar"] .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
html[lang="ar"] [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* تصحيح محاذاة الـ Elementor */
html[lang="ar"] .elementor-section,
html[lang="ar"] .elementor-container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ✅ للموبايل */
@media (max-width: 768px) {
  html[lang="ar"], body[lang="ar"] {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
  html[lang="ar"] .elementor-section,
  html[lang="ar"] .container,
  html[lang="ar"] .container-fluid {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
}
@media (max-width: 768px) {

  /* إصلاح أي سلايدر أو صور ممتدة */
  .owl-carousel,
  .slider,
  .wp-block-image,
  .wp-block-cover {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .wp-block-image img,
  .wp-block-cover img {
    width: 100% !important;
    height: auto !important;
  }
}
/* إصلاح الهوامش فقط في الصفحات الداخلية */
body:not(.home) {
  overflow-x: hidden !important;
}

/* الصور داخل المقالات أو الصفحات الداخلية */
body:not(.home) img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

/* الكتل داخل المحتوى */
body:not(.home) .wp-block-cover,
body:not(.home) .wp-block-image,
body:not(.home) .container,
body:not(.home) .row {
  max-width: 100% !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
}

/* تصحيح إضافي على الموبايل */
@media (max-width: 768px) {
  body:not(.home) .wp-block-cover,
  body:not(.home) .wp-block-image,
  body:not(.home) .container,
  body:not(.home) .row {
    padding: 0 !important;
  }
}
/* ==========================
🌟 النسخة المطوّرة للثيم العربي (RTL آمن + قابل للتوسيع)
========================== */

/* 1️⃣ RTL للصفحة */
html[lang="ar"], body[lang="ar"] {
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 2️⃣ الحاويات الكبيرة فقط لتجنب overflow */
html[lang="ar"] .container,
html[lang="ar"] .wrapper,
html[lang="ar"] .main-content,
html[lang="ar"] .site-content {
    box-sizing: border-box;
}

/* 3️⃣ العناوين والفقرات */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p {
    margin: 0.5em 0;
    padding: 0;
}

/* 4️⃣ الصور والفيديوهات عامة (لا تؤثر على Carousels) */
html[lang="ar"] img,
html[lang="ar"] video,
html[lang="ar"] iframe {
    display: block;
    height: auto;
}

/* 5️⃣ استثناء كامل لأي Carousel أو سيكشن ديناميكي */
:root {
    --carousel-selectors: ".solutions-section, #testimonials-section, .carousel-container, .solar-section"; /* أضف أي سيكشن جديد هنا */
}

html[lang="ar"] :is(var(--carousel-selectors)) *,
html[lang="ar"] :is(var(--carousel-selectors)) {
    margin: inherit !important;
    padding: inherit !important;
    max-width: inherit !important;
    overflow: inherit !important;
}

/* الصور داخل Carousels تبقى بأبعادها الأصلية */
html[lang="ar"] :is(var(--carousel-selectors)) img {
    width: auto !important;
    max-width: none !important;
}

/* 6️⃣ إعدادات للشاشات الصغيرة والمتوسطة */
@media (max-width: 1024px) {
    html[lang="ar"] .container,
    html[lang="ar"] .wrapper,
    html[lang="ar"] .main-content {
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 768px) {
    html[lang="ar"] .container,
    html[lang="ar"] .wrapper,
    html[lang="ar"] .main-content {
        padding-left: 3px;
        padding-right: 3px;
    }
}
/* RTL للصفحة */
html[lang="ar"], body[lang="ar"] {
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
}

/* الحاويات الكبيرة فقط */
html[lang="ar"] .container,
html[lang="ar"] .wrapper,
html[lang="ar"] .main-content,
html[lang="ar"] .site-content {
    box-sizing: border-box;
}

/* العناوين والفقرات */
html[lang="ar"] h1, h2, h3, h4, h5, h6, p {
    margin: 0.5em 0;
    padding: 0;
}

/* الصور والفيديوهات عامة */
html[lang="ar"] img, html[lang="ar"] video, html[lang="ar"] iframe {
    display: block;
    height: auto;
}
html[lang="ar"], body[lang="ar"] {
    direction: rtl;
    text-align: right;
}

.container, .wrapper, .main-content {
    box-sizing: border-box;
}

h1,h2,h3,h4,h5,h6,p {
    margin: 0.5em 0;
    padding: 0;
}

img, video, iframe {
    display: block;
    height: auto;
    max-width: 100%;
}
/* إصلاح الإزاحة على الموبايل للصفحة العربية بدون تعطيل الكاروسيل */
@media (max-width: 991px) {
  html[dir="rtl"], html[dir="rtl"] body {
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* سكشنات عامة */
  html[dir="rtl"] section,
  html[dir="rtl"] .container,
  html[dir="rtl"] .container-fluid,
  html[dir="rtl"] .row {
    margin: 0 auto !important;
    padding: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important; /* فقط للعناصر العادية */
  }

  /* نترك الكاروسيل خارج أي overflow أو تعديل */
  html[dir="rtl"] .owl-carousel,
  html[dir="rtl"] .owl-stage-outer,
  html[dir="rtl"] .owl-stage,
  html[dir="rtl"] .slick-slider,
  html[dir="rtl"] .slick-list,
  html[dir="rtl"] .slick-track,
  html[dir="rtl"] .swiper,
  html[dir="rtl"] .swiper-wrapper {
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  /* النصوص من اليمين لليسار */
  html[dir="rtl"] h1,
  html[dir="rtl"] h2,
  html[dir="rtl"] h3,
  html[dir="rtl"] h4,
  html[dir="rtl"] h5,
  html[dir="rtl"] h6,
  html[dir="rtl"] p,
  html[dir="rtl"] a,
  html[dir="rtl"] li {
    text-align: right !important;
    direction: rtl !important;
  }
}
/* ======= FIX RTL MOBILE SHIFT (target mobile only) ======= */
@media (max-width: 991px) {
  /* امنع التمرير الأفقي العام */
  html[dir="rtl"], html[dir="rtl"] body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* عيّن box-sizing وراجع كل العناصر لتجنب تجاوز العرض */
  html[dir="rtl"] *,
  html[dir="rtl"] *::before,
  html[dir="rtl"] *::after {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* عناصر الحاوية الأساسية — إرجاع العرض الكامل وإزالة أي margin خارجي */
  html[dir="rtl"] .site,
  html[dir="rtl"] .site-main,
  html[dir="rtl"] .site-content,
  html[dir="rtl"] .content-area,
  html[dir="rtl"] .container,
  html[dir="rtl"] .container-fluid,
  html[dir="rtl"] .row,
  html[dir="rtl"] section,
  html[dir="rtl"] .wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* صور وميديا — لا تتجاوز عرض الحاوية */
  html[dir="rtl"] img,
  html[dir="rtl"] iframe,
  html[dir="rtl"] video,
  html[dir="rtl"] .wp-block-image img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* إبطال أي margins سلبية قد تسبب تجاوز العرض */
  html[dir="rtl"] [class*="-offset"],
  html[dir="rtl"] [class*="offset-"],
  html[dir="rtl"] [style*="margin-left"],
  html[dir="rtl"] [style*="margin-right"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* إذا في عناصر تستخدم transform/translateX تسبب الزحزحة — نحددهما فقط */
  html[dir="rtl"] [style*="translate("],
  html[dir="rtl"] [style*="translate3d("],
  html[dir="rtl"] [style*="transform: translate"] {
    transform: none !important;
    left: auto !important;
    right: auto !important;
  }

  /* لكن لا نلمس عناصر الكاروسيل الأساسية — نسمح لها بالتحرك */
  html[dir="rtl"] .owl-carousel,
  html[dir="rtl"] .owl-stage,
  html[dir="rtl"] .owl-stage-outer,
  html[dir="rtl"] .slick-slider,
  html[dir="rtl"] .slick-list,
  html[dir="rtl"] .slick-track,
  html[dir="rtl"] .swiper-wrapper,
  html[dir="rtl"] .swiper-slide {
    overflow: visible !important;
    transform: translate3d(0,0,0) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
  }

  /* إعادة ضبط اتجاه النصوص */
  html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
  html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
  html[dir="rtl"] p, html[dir="rtl"] li, html[dir="rtl"] a {
    text-align: right !important;
    direction: rtl !important;
  }
}

/* Safety fallback: إذا كان في تجاوز عرض مفاجئ (العنصر أطول من viewport) */
html[dir="rtl"] * {
  min-width: 0 !important;
}
/* تحسين الهوامش للنصوص بالعربي على الموبايل */
@media (max-width: 991px) {
  html[dir="rtl"] h1,
  html[dir="rtl"] h2,
  html[dir="rtl"] h3,
  html[dir="rtl"] h4,
  html[dir="rtl"] h5,
  html[dir="rtl"] h6,
  html[dir="rtl"] p,
  html[dir="rtl"] li,
  html[dir="rtl"] a {
    text-align: right !important;
    direction: rtl !important;
    padding-right: 15px !important;
    padding-left: 10px !important;
  }

  /* إذا كان في سكشن كامل للنصوص */
  html[dir="rtl"] section,
  html[dir="rtl"] .content-area,
  html[dir="rtl"] .entry-content {
    padding-right: 15px !important;
    padding-left: 10px !important;
  }
}
/* إصلاح محاذاة النص داخل قسم حلولنا في الكاروسيل */
@media (max-width: 991px) {
  html[dir="rtl"] .owl-carousel .item,
  html[dir="rtl"] .solutions-carousel .item,
  html[dir="rtl"] .owl-item {
    text-align: right !important;
    direction: rtl !important;
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  /* لضبط النص داخل الصندوق الأبيض */
  html[dir="rtl"] .solutions-box,
  html[dir="rtl"] .solution-item,
  html[dir="rtl"] .service-box {
    padding-right: 15px !important;
    padding-left: 15px !important;
  }
}
/* إزالة أي هامش أو فراغ أسفل الصفحة بالعربية على الموبايل */
@media (max-width: 991px) {
  html[dir="rtl"] body,
  html[dir="rtl"] html,
  html[dir="rtl"] #page,
  html[dir="rtl"] .site,
  html[dir="rtl"] .site-content,
  html[dir="rtl"] .content-area,
  html[dir="rtl"] .page-content,
  html[dir="rtl"] footer,
  html[dir="rtl"] .site-footer {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* في حال فيه div بعد الفوتر */
  html[dir="rtl"] body > div:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* أحيانًا في margin من الcontainer العام */
  html[dir="rtl"] .container {
    margin-bottom: 0 !important;
  }
}
/* إزالة الهامش الناتج عن iframe Jetpack في أسفل الصفحة */
html[dir="rtl"] iframe.jetpack-notes-cookie-check {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* تأكيد أنه ما يترك أي فراغ تحته */
html[dir="rtl"] body {
  overflow-x: hidden !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
/* إزالة أي فراغ بعد الفوتر في النسخة العربية على الموبايل */
@media (max-width: 991px) {
  html[dir="rtl"] footer + * {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
  }

  html[dir="rtl"] body > iframe,
  html[dir="rtl"] body > div:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
  }

  html[dir="rtl"] body,
  html[dir="rtl"] html {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
  }
}
/* إزالة الهامش الناتج عن iframe إعلانات Google في أسفل الصفحة */
@media (max-width: 991px) {
  html[dir="rtl"] iframe[id*="google_"],
  html[dir="rtl"] iframe[src*="googleads.g.doubleclick.net"],
  html[dir="rtl"] iframe[name="google_esf"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
  }

  /* تأكيد أن ما يترك أي فراغ تحته */
  html[dir="rtl"] body,
  html[dir="rtl"] html {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
  }
}
