/* RTL overrides for the site
   - Applied when `<html dir="rtl">` is present
   - This file contains safe, targeted overrides to flip layout-directional rules
*/

html[dir="rtl"] {
  direction: rtl;
}

html[dir="rtl"] body {
  text-align: right;
}

/* Header / Logo / Buttons */
html[dir="rtl"] .header .header-container {
  padding: 5px 30px 5px 25px; /* swap left/right from original */
}

html[dir="rtl"] .header .logo img {
  margin-left: 8px;
  margin-right: 0;
}

html[dir="rtl"] .header .logo h1 {
  text-align: right;
}

html[dir="rtl"] .header .btn-getstarted {
  margin-right: 30px;
  margin-left: 0;
}

/* Navbar: reverse ordering and flip dropdown positions */
html[dir="rtl"] .navmenu ul {
  flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-nav-toggle {
  margin-left: 10px;
  margin-right: 0;
}

html[dir="rtl"] .navmenu .dropdown ul {
  left: auto !important;
  right: 14px !important;
}

html[dir="rtl"] .navmenu .dropdown .dropdown ul {
  left: auto !important;
  right: -90% !important;
}

html[dir="rtl"] .navmenu .dropdown .dropdown:hover>ul {
  left: auto !important;
  right: -100% !important;
}

/* Swap offsets for elements positioned to the right */
html[dir="rtl"] .hero .stats-card {
  right: auto !important;
  left: 0 !important;
}

html[dir="rtl"] .hero .stats-card .stats-arrow {
  right: auto !important;
  left: 1.5rem !important;
}

html[dir="rtl"] .services .service-card .card-action {
  right: auto !important;
  left: 0 !important;
}

/* Scroll top button */
html[dir="rtl"] .scroll-top {
  right: auto !important;
  left: 15px !important;
}

/* Steps timeline on mobile */
@media (max-width: 991px) {
  html[dir="rtl"] .steps .steps-wrapper::before {
    left: auto !important;
    right: 25px !important;
  }
}

/* Utility fixes for Bootstrap margin-end/start used in markup */
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .me-xl-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Text alignment helpers */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }

/* Small components direction fixes */
html[dir="rtl"] .about .about-image .experience-badge {
  right: auto !important;
  left: -30px !important;
}

html[dir="rtl"] .testimonial-intro .swiper-nav-buttons button { order: 0; }

/* Any remaining right-positioned overlays */
html[dir="rtl"] .portfolio .portfolio-entry .entry-overlay { direction: rtl; }

/* Keep widget icons visually consistent */
html[dir="rtl"] .navmenu a i,
html[dir="rtl"] .navmenu a:focus i {
  margin-left: 0 !important;
  margin-right: 5px !important;
}

/* Add more overrides below if you find specific misplacements after testing the site visually */
