/* Arabic product detail pages — site header/footer RTL aligned with ar/products.html */

html[dir="rtl"] body.product-detail-public {
  direction: rtl;
  text-align: right;
}

/* ---------- Site header (same rules as ar/products.html) ---------- */
html[dir="rtl"] body.product-detail-public > header.header .header-inner {
  flex-direction: row;
}

html[dir="rtl"] body.product-detail-public > header.header .nav-menu {
  flex-direction: row;
}

html[dir="rtl"] body.product-detail-public > header.header .header-actions {
  flex-direction: row;
}

html[dir="rtl"] body.product-detail-public > header.header .header-email {
  margin-left: 1rem;
  margin-right: 0;
}

html[dir="rtl"] body.product-detail-public > header.header .logo-img {
  object-position: right center;
}

/* RTL lang control: covered by components.css html[dir=rtl] rules */

html[dir="rtl"] body.product-detail-public > header.header .mobile-menu-btn {
  margin-right: 0;
  margin-left: -0.5rem;
}

@media (max-width: 1023px) {
  html[dir="rtl"] body.product-detail-public > header.header .nav-menu {
    flex-direction: column;
    text-align: right;
  }

  html[dir="rtl"] body.product-detail-public > header.header .nav-link {
    text-align: right;
  }
}

@media (max-width: 767px) {
  html[dir="rtl"] body.product-detail-public > header.header .header-inner {
    flex-direction: row !important;
    width: 100%;
    min-width: 0;
  }

  html[dir="rtl"] body.product-detail-public > header.header .header-actions {
    flex-direction: row !important;
    min-width: 0;
  }

  html[dir="rtl"] body.product-detail-public > header.header .header-actions .btn-primary {
    max-width: 100%;
  }

  html[dir="rtl"] body.product-detail-public > header.header .header-email {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* ---------- Back nav ---------- */
html[dir="rtl"] body.product-detail-public .product-detail-back-nav {
  direction: rtl;
}

html[dir="rtl"] body.product-detail-public .product-detail-back-link:hover .product-detail-back-link__icon {
  transform: translateX(2px);
}

html[dir="rtl"] body.product-detail-public .product-detail-back-nav__meta {
  align-items: flex-start;
  text-align: left;
}

@media (max-width: 639px) {
  html[dir="rtl"] body.product-detail-public .product-detail-back-nav__meta {
    align-items: flex-start;
    text-align: right;
  }
}

/* ---------- Site footer (injected) ---------- */
html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-grid {
  flex-direction: row-reverse;
}

html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-links {
  text-align: right;
}

html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-contact-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-contact-item svg {
  margin-left: 0.75rem;
  margin-right: 0;
}

html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-bottom {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-grid,
  html[dir="rtl"] body.product-detail-public > footer.site-page-footer .footer-bottom {
    flex-direction: column;
  }
}

/* Datasheet body stays LTR for technical layout */
html[dir="rtl"] body.product-detail-public .right-content {
  direction: ltr;
  text-align: left;
}
