/* Arabic/RTL enhancements (scoped, non-destructive) */

html[dir="rtl"] body {
  font-family: "Cairo", "Lato", "Roboto", sans-serif;
}

html[dir="rtl"] .main,
html[dir="rtl"] .footer,
html[dir="rtl"] .hero-content,
html[dir="rtl"] .service-info,
html[dir="rtl"] .service-back-content,
html[dir="rtl"] .contact .form-card,
html[dir="rtl"] .legal-page-header,
html[dir="rtl"] .policy-section,
html[dir="rtl"] .terms-article,
html[dir="rtl"] .error-content,
html[dir="rtl"] .quick-navigation {
  text-align: right;
}

html[dir="rtl"] .hero-tag .tag-text,
html[dir="rtl"] .hero-text,
html[dir="rtl"] .section-title h2,
html[dir="rtl"] .section-title p,
html[dir="rtl"] .service-info h4,
html[dir="rtl"] .service-back-label,
html[dir="rtl"] .service-back-value,
html[dir="rtl"] .contact .form-card label,
html[dir="rtl"] .contact .form-card p,
html[dir="rtl"] .legal-page-header h1,
html[dir="rtl"] .legal-page-header h2,
html[dir="rtl"] .legal-page-header p,
html[dir="rtl"] .policy-section h2,
html[dir="rtl"] .policy-section p,
html[dir="rtl"] .policy-section li,
html[dir="rtl"] .terms-article h3,
html[dir="rtl"] .terms-article p,
html[dir="rtl"] .terms-article li,
html[dir="rtl"] .error-heading,
html[dir="rtl"] .error-text,
html[dir="rtl"] .error-path {
  letter-spacing: 0;
  line-height: 1.8;
}

html[dir="rtl"] .section-title,
html[dir="rtl"] .section-title h2,
html[dir="rtl"] .section-title p {
  text-align: center;
}

html[dir="rtl"] .hero-process .hero-content .hero-headline,
html[dir="rtl"] .hero-process .hero-content .hero-headline-primary {
  letter-spacing: 0;
  line-height: 1.2;
}

html[dir="rtl"] .hero-process .hero-content .typing-line[data-step-number] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .hero .hero-content .typing-target.is-typing::after,
html[dir="rtl"] .hero .hero-content .typing-line.is-typing::after,
html[dir="rtl"] .hero .hero-content .typing-once-target.is-typing::after {
  margin-right: 6px;
  margin-left: 0;
}

/* Keep header layout visually consistent with English */
html[dir="rtl"] .header .container {
  direction: ltr;
}

html[dir="rtl"] .header .navmenu a,
html[dir="rtl"] .header .btn-getstarted {
  direction: rtl;
}

/* Form controls */
html[dir="rtl"] .contact .form-card .php-email-form .input-group-custom .input-wrapper i {
  right: 16px;
  left: auto;
}

html[dir="rtl"] .contact .form-card .php-email-form .input-group-custom .input-wrapper input,
html[dir="rtl"] .contact .form-card .php-email-form .input-group-custom .input-wrapper select,
html[dir="rtl"] .contact .form-card .php-email-form .input-group-custom .input-wrapper textarea {
  text-align: right;
  padding-right: 44px;
  padding-left: 16px;
}

/* Keep phone/WhatsApp number readable in RTL (e.g. +9647...) */
html[dir="rtl"] .contact .form-card .php-email-form #project_phone {
  direction: ltr !important;
  unicode-bidi: plaintext;
  text-align: left !important;
}

html[dir="rtl"] .contact .form-card .php-email-form #project_phone::placeholder {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}

html[dir="rtl"] .contact .form-card .php-email-form .choice-group {
  justify-content: flex-end;
}

html[dir="rtl"] .contact .form-card .php-email-form .form-actions .project-step-actions {
  direction: rtl;
}

/* Footer */
html[dir="rtl"] .footer .footer-info,
html[dir="rtl"] .footer .footer-contact-list,
html[dir="rtl"] .footer .copyright,
html[dir="rtl"] .footer .legal-links {
  text-align: right;
}

html[dir="rtl"] .footer .footer-contact-value {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

html[dir="rtl"] .services .service-card .service-info {
  text-align: center;
}

html[dir="rtl"] .services .service-card .service-info .service-badge {
  direction: rtl;
}

html[dir="rtl"] .services .service-card .service-info h4 {
  direction: rtl;
  text-align: center;
  line-height: 1.5;
}

/* Directional icons only */
html[dir="rtl"] .hero-start-mobile i.bi-arrow-right-circle-fill,
html[dir="rtl"] .cta-button i.bi-arrow-right,
html[dir="rtl"] .btn-submit i.bi-arrow-right-circle-fill {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn-home i.bi-arrow-left {
  transform: scaleX(-1);
}

@media (max-width: 991.98px) {
  html[dir="rtl"] #hero .hero-content,
  html[dir="rtl"] #hero .hero-content .hero-tag,
  html[dir="rtl"] #hero .hero-content .hero-cta,
  html[dir="rtl"] #hero .hero-content .hero-text {
    text-align: center;
  }

  html[dir="rtl"] .hero-content,
  html[dir="rtl"] .contact .form-card,
  html[dir="rtl"] .legal-page-header,
  html[dir="rtl"] .error-content {
    text-align: right;
  }

  html[dir="rtl"] #hero .hero-process .hero-content .typing-line[data-step-number] {
    margin-inline: auto;
    width: fit-content;
    max-width: 100%;
    text-align: right;
  }
}
