/* ========== RTL Overrides ========== */

[dir="rtl"] body {
  font-family: 'Cairo', sans-serif;
  text-align: right;
  --page-exit-shift: 24px;
  --page-enter-shift: -18px;
}

[dir="rtl"] .page-transition-overlay {
  --swipe-start: -106%;
  --swipe-end: 106%;
}
[dir="rtl"] .page-transition-stripes span:nth-child(1) {
  --stripe-start: 132vw;
  --stripe-end: -132vw;
}
[dir="rtl"] .page-transition-stripes span:nth-child(2) {
  --stripe-start: -132vw;
  --stripe-end: 132vw;
}
[dir="rtl"] .page-transition-stripes span:nth-child(3) {
  --stripe-start: 132vw;
  --stripe-end: -132vw;
}
[dir="rtl"] .page-transition-stripes span:nth-child(4) {
  --stripe-start: -132vw;
  --stripe-end: 132vw;
}
[dir="rtl"] .page-transition-stripes span:nth-child(5) {
  --stripe-start: 132vw;
  --stripe-end: -132vw;
}
[dir="rtl"] .page-transition-stripes span:nth-child(6) {
  --stripe-start: -132vw;
  --stripe-end: 132vw;
}
[dir="rtl"] .page-entering.page-entered .navbar,
[dir="rtl"] .page-entering.page-entered .hero,
[dir="rtl"] .page-entering.page-entered .section,
[dir="rtl"] .page-entering.page-entered main,
[dir="rtl"] .page-entering.page-entered .footer {
  transform: translateX(0);
}

/* Navbar */
[dir="rtl"] .navbar-inner { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-actions { flex-direction: row-reverse; }
[dir="rtl"] .logo-text { text-align: right; }

/* Hero */
[dir="rtl"] .hero-content { flex-direction: row; }
[dir="rtl"] .hero-text { text-align: right; }
[dir="rtl"] .hero-statement,
[dir="rtl"] .hero-sub { margin-left: auto; margin-right: 0; }
[dir="rtl"] .hero-buttons {
  direction: rtl;
  justify-content: flex-start;
  flex-direction: row;
}
[dir="rtl"] .hero-stats {
  direction: rtl;
  flex-direction: row;
}
[dir="rtl"] .hero-badge {
  direction: rtl;
  flex-direction: row;
}
[dir="rtl"] .hero-float { animation-name: heroFloatRtl; }
[dir="rtl"] .dashboard-card { direction: rtl; }
[dir="rtl"] .dash-header { flex-direction: row; }
[dir="rtl"] .dash-live { margin-inline-start: auto; margin-inline-end: 0; }

/* Services */
[dir="rtl"] .service-card { text-align: right; }
[dir="rtl"] .service-card:hover { border-left: none; border-right: 4px solid var(--teal); }

/* Cashiri */
[dir="rtl"] .cashiri-content { flex-direction: row; }
[dir="rtl"] .cashiri-text { text-align: right; }
[dir="rtl"] .feature-list { align-items: stretch; }
[dir="rtl"] .feature-item {
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
  text-align: right;
}
[dir="rtl"] .feature-item svg { margin-left: 0; margin-right: 0; }
[dir="rtl"] .tech-pills {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
[dir="rtl"] .cashiri-flow {
  direction: rtl;
  margin-right: 0;
  margin-left: auto;
}
[dir="rtl"] .cashiri-dashboard-screen,
[dir="rtl"] .cashiri-pos-screen {
  direction: rtl;
  animation-name: cashiriScreenFloatRtl;
}
[dir="rtl"] .cashiri-cart { border-left: none; border-right: 1px solid #e0e6ef; }
[dir="rtl"] .cashiri-pos-screen {
  left: auto;
  right: -24px;
}
[dir="rtl"] .product-screens-stack .cashiri-pos-screen {
  left: auto;
  right: 0;
}
[dir="rtl"] .flow-arrow::after {
  right: auto;
  left: 0;
  transform: translateY(-50%) rotate(-135deg);
}

/* App Download */
[dir="rtl"] .app-download-content { flex-direction: row; }
[dir="rtl"] .app-download-copy { text-align: right; }
[dir="rtl"] .app-download-copy > p { margin-left: auto; margin-right: 0; }
[dir="rtl"] .app-store-actions {
  direction: rtl;
  justify-content: flex-start;
}
[dir="rtl"] .app-download-note { text-align: right; }
[dir="rtl"] .app-phone-stage {
  animation-name: appPhoneFloatRtl;
}
[dir="rtl"] .app-phone { direction: ltr; }

[dir="rtl"] .pos-monitor { transform: perspective(900px) rotateY(4deg); }
[dir="rtl"] .pos-monitor:hover { transform: perspective(900px) rotateY(0deg) translateY(-4px); }
[dir="rtl"] .product-hero-copy,
[dir="rtl"] .adapt-card,
[dir="rtl"] .module-row,
[dir="rtl"] .process-step { text-align: right; }
[dir="rtl"] .module-row { grid-template-columns: 170px 1fr; }
[dir="rtl"] .product-actions { flex-direction: row-reverse; }

/* Why Us */
[dir="rtl"] .why-card { text-align: right; }
[dir="rtl"] .why-icon { margin-left: auto; margin-right: 0; }

/* Contact */
[dir="rtl"] .contact-content { flex-direction: row; }
[dir="rtl"] .contact-info { text-align: right; }
[dir="rtl"] .info-row {
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
}
[dir="rtl"] .info-row svg { margin-left: 0; margin-right: 0; }
[dir="rtl"] .contact-info .social-row { justify-content: flex-start; }
[dir="rtl"] .contact-form { text-align: right; }
[dir="rtl"] .form-input,
[dir="rtl"] .form-textarea { text-align: right; }
[dir="rtl"] .ltr-field { text-align: left; }

/* Footer */
[dir="rtl"] .footer-grid { direction: rtl; }
[dir="rtl"] .footer-col { text-align: right; }
[dir="rtl"] .footer-bottom { flex-direction: row-reverse; }
[dir="rtl"] .made-iraq { flex-direction: row-reverse; }

/* General flips */
[dir="rtl"] .section-header { text-align: center; }
[dir="rtl"] .badge { flex-direction: row-reverse; }

/* Mobile menu */
[dir="rtl"] .mobile-menu { text-align: right; }
[dir="rtl"] .hamburger { order: -1; }

@media (max-width: 1024px) {
  [dir="rtl"] .hero-content,
  [dir="rtl"] .cashiri-content,
  [dir="rtl"] .app-download-content,
  [dir="rtl"] .contact-content { flex-direction: column; }

  [dir="rtl"] .hero-text,
  [dir="rtl"] .cashiri-text,
  [dir="rtl"] .app-download-copy,
  [dir="rtl"] .contact-info,
  [dir="rtl"] .contact-form { text-align: center; }

  [dir="rtl"] .hero-buttons,
  [dir="rtl"] .hero-stats,
  [dir="rtl"] .hero-badge,
  [dir="rtl"] .app-store-actions,
  [dir="rtl"] .feature-item,
  [dir="rtl"] .tech-pills { justify-content: center; }

  [dir="rtl"] .app-download-copy > p,
  [dir="rtl"] .app-download-note { margin-left: auto; margin-right: auto; text-align: center; }

  [dir="rtl"] .feature-list { align-items: center; }
  [dir="rtl"] .cashiri-flow { margin-left: auto; margin-right: auto; }

  [dir="rtl"] .flow-arrow::after {
    left: 50%;
    transform: translate(-50%, 0) rotate(135deg);
  }

  [dir="rtl"] .product-hero-copy,
  [dir="rtl"] .adapt-card,
  [dir="rtl"] .module-row,
  [dir="rtl"] .process-step { text-align: center; }

  [dir="rtl"] .product-actions { justify-content: center; }
}

@media (max-width: 768px) {
  [dir="rtl"] .module-row { grid-template-columns: 1fr; }
}
