/* RTL-specific styles - keep minimal and rely on Bootstrap RTL for base behavior */

/* Header / nav adjustments */
[dir="rtl"] .navbar-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .Taamul-lang-switcher {
  /* keep language links on the start side in RTL */
  margin-inline-start: 0;
  margin-inline-end: auto;
}

/* Ensure logo and toggler positions are correct without forcing global direction */
[dir="rtl"] .Taamul-header .navbar-brand {
  margin-inline-start: 0; /* start side (right in RTL) */
  margin-inline-end: auto;
}

[dir="rtl"] .Taamul-header .navbar-toggler {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

/* Ensure content blocks reverse image/text order in RTL */
[dir="rtl"] .Taamul-content-block {
  flex-direction: row-reverse;
}

/* Cards and text alignment */
[dir="rtl"] .Taamul-card-body,
[dir="rtl"] .Taamul-card-title,
[dir="rtl"] .Taamul-card-text {
  text-align: right;
}

/* Footer contact items order */
[dir="rtl"] .Taamul-footer .footer-contact {
  flex-direction: row-reverse;
}

/* Contact section: reverse inline items but keep center alignment on small screens */
[dir="rtl"] .Taamul-contact-section .Taamul-contact-info-inline {
  flex-direction: row-reverse;
}

/* Carousel/Slider: only swap control positions - let Bootstrap RTL handle mirroring of icons */
[dir="rtl"] .carousel-control-prev {
  left: auto;
  right: 0;
}

[dir="rtl"] .carousel-control-next {
  right: auto;
  left: 0;
}

/* Flip carousel icons explicitly to ensure correct arrow direction in all browsers */
[dir="rtl"] .carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='rgba(0,0,0,0.5)' d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

[dir="rtl"] .carousel-control-next-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='rgba(0,0,0,0.5)' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Keep slide content centered */
[dir="rtl"] .Taamul-slide-content {
    text-align: center;
    direction: rtl; /* Ensure text direction is correct for slide content */
}

/* Responsive tweaks */
@media (max-width: 767px) {
  [dir="rtl"] .Taamul-content-block {
    flex-direction: column;
  }
  [dir="rtl"] .Taamul-contact-section .Taamul-contact-info-inline {
    flex-direction: column;
    align-items: center;
  }
  [dir="rtl"] .Taamul-footer .footer-contact {
    flex-direction: column;
  }
}
