/* RTL (Right-to-Left) Support for Arabic Language */

/* ============================================
   GLOBAL RTL SETTINGS
   ============================================ */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* ============================================
   TYPOGRAPHY & TEXT ALIGNMENT
   ============================================ */

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] p,
[dir="rtl"] li,
[dir="rtl"] span,
[dir="rtl"] div {
  text-align: right;
}

[dir="rtl"] .text-center,
[dir="rtl"] [class*="center"] {
  text-align: center !important;
}

/* ============================================
   NAVBAR & NAVIGATION
   ============================================ */

[dir="rtl"] .navbar-wrap {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-dropdown-menu {
  text-align: right;
}

[dir="rtl"] .nav-dropdown-toggle {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-contact-link::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .nav-chevron {
  margin-left: 0;
  margin-right: 2px;
}

/* Legacy class support */
[dir="rtl"] .button-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .w-dropdown-list {
  right: 0;
  left: auto;
  text-align: right;
}

[dir="rtl"] .w-dropdown-toggle {
  flex-direction: row-reverse;
}

/* ============================================
   HERO SECTION
   ============================================ */

[dir="rtl"] .hero-wrap {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-left {
  text-align: right;
}

[dir="rtl"] .hero-title {
  text-align: right;
}

[dir="rtl"] .hero-headline h1 {
  text-align: right;
}

[dir="rtl"] .hero-trust-badges {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

[dir="rtl"] .trust-badge {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-numbers {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-number {
  text-align: right;
}

[dir="rtl"] .main-button-white,
[dir="rtl"] .button-outline,
[dir="rtl"] .hero-secondary-btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-cta-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .button-icon {
  transform: scaleX(-1);
}

/* ============================================
   BENEFITS SECTION
   ============================================ */

[dir="rtl"] .benefit-wrap {
  direction: rtl;
}

[dir="rtl"] .benefit-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .benefit-icon {
  margin-right: 0;
  margin-left: 20px;
}

[dir="rtl"] .benefit-text {
  text-align: right;
}

[dir="rtl"] .benefit-stats {
  flex-direction: row-reverse;
}

[dir="rtl"] .benefit-stat {
  align-items: flex-end;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

[dir="rtl"] .services-header {
  text-align: right;
}

[dir="rtl"] .service-card {
  text-align: right;
}

[dir="rtl"] .service-text {
  text-align: right;
}

[dir="rtl"] .service-read-more {
  flex-direction: row-reverse;
}

[dir="rtl"] .service-read-more svg {
  transform: scaleX(-1);
}

[dir="rtl"] .grid {
  direction: rtl;
}

/* ============================================
   GALLERY SECTION
   ============================================ */

[dir="rtl"] .gallery-wrap {
  direction: rtl;
}

[dir="rtl"] .gallery-title {
  text-align: right;
}

[dir="rtl"] .gallery-header {
  text-align: right;
}

[dir="rtl"] .gallery-subheading {
  text-align: right;
}

[dir="rtl"] .gallery-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .gallery-filters {
  flex-direction: row-reverse;
}

[dir="rtl"] .gallery-overlay {
  text-align: right;
}

/* ============================================
   LABORATORY SECTION
   ============================================ */

[dir="rtl"] .lab-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .lab-header-text {
  text-align: right;
}

[dir="rtl"] .lab-header-desc {
  text-align: right;
}

[dir="rtl"] .lab-capabilities {
  flex-direction: row-reverse;
}

[dir="rtl"] .lab-cap-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .lab-mosaic-reverse {
  direction: ltr;
}

[dir="rtl"] .lab-mosaic:not(.lab-mosaic-reverse) {
  direction: rtl;
}

[dir="rtl"] .lab-mosaic:not(.lab-mosaic-reverse) > * {
  direction: ltr;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */

[dir="rtl"] .testimonial-heading {
  text-align: right;
}

[dir="rtl"] .testimonial-track {
  flex-direction: row-reverse;
}

[dir="rtl"] .testi-quote {
  text-align: right;
}

[dir="rtl"] .testi-author {
  flex-direction: row-reverse;
}

[dir="rtl"] .testi-author-info {
  text-align: right;
}

[dir="rtl"] .testi-arrow-prev svg,
[dir="rtl"] .testi-arrow-next svg {
  transform: scaleX(-1);
}

[dir="rtl"] .testi-controls {
  flex-direction: row-reverse;
}

/* ============================================
   OUR WORK SECTION
   ============================================ */

[dir="rtl"] .ow-header {
  text-align: right;
}

[dir="rtl"] .ow-step {
  text-align: right;
}

[dir="rtl"] .ow-step-number {
  right: auto;
  left: 24px;
}

[dir="rtl"] .ow-timeline {
  direction: rtl;
}

/* ============================================
   FAQ SECTION
   ============================================ */

[dir="rtl"] .faq-layout {
  flex-direction: row-reverse;
}

[dir="rtl"] .faq-heading {
  text-align: right;
}

[dir="rtl"] .faq-subtitle {
  text-align: right;
}

[dir="rtl"] .faq-question {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .faq-question:hover {
  padding-left: 0;
  padding-right: 4px;
}

[dir="rtl"] .faq-answer {
  text-align: right;
}

[dir="rtl"] .faq-answer .paragraph {
  padding-left: 0;
  padding-right: 40px;
}

[dir="rtl"] .faq-cta-btn {
  flex-direction: row-reverse;
}

/* ============================================
   CTA SECTION
   ============================================ */

[dir="rtl"] .cta-wrap {
  direction: rtl;
}

[dir="rtl"] .cta-content {
  text-align: right;
}

[dir="rtl"] .cta-description {
  text-align: right;
}

[dir="rtl"] .cta-stats {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-actions {
  align-items: flex-end;
}

[dir="rtl"] .cta-contact-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-whatsapp-link,
[dir="rtl"] .cta-phone-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .services-view-all-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .services-view-all-link svg {
  transform: scaleX(-1);
}

/* ============================================
   FOOTER
   ============================================ */

[dir="rtl"] .footer-grid {
  direction: rtl;
}

[dir="rtl"] .footer-about {
  text-align: right;
}

[dir="rtl"] .footer-desc {
  text-align: right;
}

[dir="rtl"] .footer-locations {
  align-items: flex-end;
}

[dir="rtl"] .location-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-col {
  text-align: right;
}

[dir="rtl"] .footer-heading {
  text-align: right;
}

[dir="rtl"] .footer-heading::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .footer-links {
  text-align: right;
}

[dir="rtl"] .footer-links a:hover {
  transform: translateX(-5px);
}

[dir="rtl"] .footer-contact-list {
  align-items: flex-end;
}

[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-social {
  text-align: right;
}

[dir="rtl"] .social-icons {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .footer-bottom-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-bottom-links {
  flex-direction: row-reverse;
}

/* ============================================
   LOGO CAROUSEL
   ============================================ */

[dir="rtl"] .scroll-left {
  animation: marquee-right-rtl 40s linear infinite;
}

[dir="rtl"] .scroll-right {
  animation: marquee-left-rtl 40s linear infinite;
}

@keyframes marquee-left-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

@keyframes marquee-right-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

[dir="rtl"] .w-inline-block {
  direction: rtl;
}

[dir="rtl"] .skip-link {
  right: -100%;
  left: auto;
}

[dir="rtl"] .skip-link:focus {
  right: 50%;
  left: auto;
  transform: translateX(50%);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

[dir="rtl"] .back-to-top {
  right: auto;
  left: 30px;
}

[dir="rtl"] .back-to-top-footer {
  flex-direction: row-reverse;
}

/* ============================================
   CHAT WIDGET
   ============================================ */

[dir="rtl"] .chat-widget {
  right: auto;
  left: 20px;
}

[dir="rtl"] .whatsapp-widget {
  right: auto;
  left: 20px;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
  text-align: right;
}

/* ============================================
   MARGINS & PADDINGS FLIP
   ============================================ */

/* Generic margin/padding flips */
[dir="rtl"] .ml-auto {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .mr-auto {
  margin-right: 0;
  margin-left: auto;
}

/* ============================================
   LISTS
   ============================================ */

[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-right: 20px;
  padding-left: 0;
}

[dir="rtl"] li {
  text-align: right;
}

/* ============================================
   MOBILE MENU
   ============================================ */

[dir="rtl"] .w-nav-overlay {
  right: 0;
  left: auto;
}

[dir="rtl"] .menu-button {
  left: 0;
  right: auto;
}

[dir="rtl"] .menu-icon-line {
  transform-origin: center center;
}

/* ============================================
   LANGUAGE TOGGLE SPECIFIC
   ============================================ */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid #2d6a4f;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.lang-toggle:hover {
  background: rgba(45, 106, 79, 0.08);
}

.lang-toggle .lang-en {
  color: #2d6a4f;
  font-weight: 600;
}

.lang-toggle .lang-ar {
  color: #999;
  font-family: 'Noto Sans Arabic', 'Arial', sans-serif;
}

.lang-toggle .separator {
  color: #ccc;
  margin: 0 2px;
}

[dir="rtl"] .lang-toggle .lang-en {
  color: #999;
  font-weight: 500;
}

[dir="rtl"] .lang-toggle .lang-ar {
  color: #2d6a4f;
  font-weight: 600;
}

/* ============================================
   RESPONSIVE RTL ADJUSTMENTS
   ============================================ */

@media (max-width: 991px) {
  [dir="rtl"] .navbar-wrap {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .nav-menu {
    right: 0;
    left: auto;
    text-align: right;
  }

  [dir="rtl"] .w-nav-menu {
    right: 0;
    left: auto;
  }
}

@media (max-width: 768px) {
  [dir="rtl"] .hero-wrap {
    flex-direction: column;
  }

  [dir="rtl"] .hero-trust-badges {
    justify-content: center;
  }

  [dir="rtl"] .hero-numbers {
    justify-content: center;
  }

  [dir="rtl"] .footer-grid {
    grid-template-columns: 1fr;
  }

  [dir="rtl"] .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  [dir="rtl"] .back-to-top {
    left: 20px;
    right: auto;
  }
}

@media (max-width: 480px) {
  [dir="rtl"] .trust-badge {
    font-size: 11px;
    padding: 5px 10px;
  }

  [dir="rtl"] .lang-toggle {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ============================================
   ARABIC FONT SUPPORT
   ============================================ */

[dir="rtl"] {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Arabic', 'Arial', sans-serif;
}

/* ============================================
   ANIMATION DIRECTION FLIP
   ============================================ */

[dir="rtl"] .fade-in-left {
  animation-name: fade-in-right;
}

[dir="rtl"] .fade-in-right {
  animation-name: fade-in-left;
}

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* About Page - New Sections RTL */
[dir="rtl"] .approach-step,
[dir="rtl"] .approach-header {
  text-align: right;
}

[dir="rtl"] .cert-card {
  text-align: center;
}

[dir="rtl"] .about-lab-feature {
  flex-direction: row-reverse;
}

[dir="rtl"] .about-lab-content {
  text-align: right;
}

[dir="rtl"] .about-trust-label {
  direction: rtl;
}

/* About Page - Enhanced Sections RTL */
[dir="rtl"] .about-hero-cta-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .about-secondary-btn {
  flex-direction: row-reverse;
}

/* Timeline RTL */
[dir="rtl"] .timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

[dir="rtl"] .timeline-item:nth-child(even) {
  flex-direction: row;
}

[dir="rtl"] .timeline-item:nth-child(odd) .timeline-content {
  text-align: left;
  margin-right: 0;
  margin-left: 5%;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
  text-align: right;
  margin-left: 0;
  margin-right: 5%;
}

[dir="rtl"] .timeline-header {
  text-align: right;
}

/* Industries RTL */
[dir="rtl"] .industries-header {
  text-align: right;
}

[dir="rtl"] .industry-card {
  text-align: center;
}

/* Testimonials RTL */
[dir="rtl"] .testimonials-header {
  text-align: right;
}

[dir="rtl"] .testimonial-quote {
  text-align: right;
}

[dir="rtl"] .testimonial-author {
  flex-direction: row-reverse;
}

[dir="rtl"] .testimonial-author-name,
[dir="rtl"] .testimonial-author-role {
  text-align: right;
}

/* Team Teaser RTL */
[dir="rtl"] .team-teaser-header {
  text-align: right;
}

[dir="rtl"] .team-stats-row {
  flex-direction: row-reverse;
}

/* CTA Enhanced RTL */
[dir="rtl"] .cta-contact-info {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-contact-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-buttons-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .cta-secondary-btn {
  flex-direction: row-reverse;
}

/* Lab Stats RTL */
[dir="rtl"] .lab-stats-row {
  direction: rtl;
}

/* Responsive RTL adjustments */
@media (max-width: 992px) {
  [dir="rtl"] .timeline-item,
  [dir="rtl"] .timeline-item:nth-child(odd),
  [dir="rtl"] .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: 0;
    padding-right: 50px;
  }

  [dir="rtl"] .timeline-content,
  [dir="rtl"] .timeline-item:nth-child(odd) .timeline-content,
  [dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
    text-align: right;
    margin: 0;
  }

  [dir="rtl"] .timeline-line {
    left: auto;
    right: 20px;
  }

  [dir="rtl"] .timeline-dot {
    left: auto;
    right: 20px;
  }
}
