/* FINAL RTL fixes for Arabic pages */

html[lang="ar"] body {
  direction: rtl;
}

html[lang="ar"] body .header-container {
  direction: rtl !important;
}

html[lang="ar"] body .header-right {
  direction: ltr !important;
}

html[lang="ar"] body .products-horizontal-menu {
  direction: rtl !important;
  left: auto !important;
  right: 0 !important;
  transform: none !important;
}

html[lang="ar"] body .product-submenu {
  text-align: right !important;
  right: 0 !important;
  left: auto !important;
}

/* Home video + fairs: fair on right, video on left, with real gap */
html[lang="ar"] body .video-and-fair {
  direction: rtl !important;
  grid-template-columns: 390px minmax(0, 940px) !important;
  gap: 58px !important;
}

html[lang="ar"] body .fair-slideshow {
  margin-left: 0 !important;
  margin-right: 24px !important;
  justify-self: end !important;
}

html[lang="ar"] body .home-video-panel {
  margin-left: 0 !important;
  margin-right: -24px !important;
  justify-self: start !important;
}

/* Arabic home product slideshow: image right, text left */
html[lang="ar"] body .products-section .product-slide-image-frame {
  left: auto !important;
  right: 130px !important;
}

html[lang="ar"] body .products-section .slide .text {
  left: 130px !important;
  right: auto !important;
  direction: rtl !important;
}

html[lang="ar"] body .products-section .product-slider-arrow.prev {
  left: auto !important;
  right: 30px !important;
}

html[lang="ar"] body .products-section .product-slider-arrow.next {
  right: auto !important;
  left: 30px !important;
}

/* Arabic product pages */
html[lang="ar"] body .products-shell {
  direction: rtl !important;
}

html[lang="ar"] body .products-sidebar,
html[lang="ar"] body .products-main,
html[lang="ar"] body .product-detail-info,
html[lang="ar"] body .product-list-content {
  text-align: right !important;
}

html[lang="ar"] body .products-breadcrumb {
  direction: rtl !important;
}

@media (max-width: 1250px) {
  html[lang="ar"] body .products-section .product-slide-image-frame {
    right: 95px !important;
  }

  html[lang="ar"] body .products-section .slide .text {
    left: 95px !important;
  }
}

@media (max-width: 980px) {
  html[lang="ar"] body .video-and-fair {
    grid-template-columns: 1fr !important;
    gap: 26px !important;
  }

  html[lang="ar"] body .fair-slideshow,
  html[lang="ar"] body .home-video-panel {
    margin: 0 auto !important;
    justify-self: center !important;
  }
}

@media (max-width: 900px) {
  html[lang="ar"] body .products-section .product-slide-image-frame,
  html[lang="ar"] body .products-section .slide .text {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }

  html[lang="ar"] body .products-section .product-slider-arrow.prev {
    right: 8px !important;
  }

  html[lang="ar"] body .products-section .product-slider-arrow.next {
    left: 8px !important;
  }
}
