/* RTL (Right-to-Left) CSS Overrides for Arabic */

/* Base direction */
html[dir="rtl"] {
  direction: rtl;
}

/* Header - logo bar: flip order */
html[dir="rtl"] .header__logo-bar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .header__logo {
  flex-direction: row-reverse;
}
html[dir="rtl"] .lang-selector {
  margin-right: 0;
  margin-left: auto;
}
html[dir="rtl"] .header__hamburger {
  margin-left: 0;
  margin-right: 8px;
}

/* Navigation */
html[dir="rtl"] .header__nav {
  flex-direction: row-reverse;
}
html[dir="rtl"] .header__nav-actions {
  margin-left: 0;
  margin-right: auto;
  padding-right: 16px;
}

/* Hero */
html[dir="rtl"] .hero__content-block {
  text-align: right;
}
html[dir="rtl"] .hero__actions {
  justify-content: flex-end;
}

/* Trust bar */
html[dir="rtl"] .trust-bar__item {
  text-align: right;
}

/* Grid cells - flip border from right to left */
html[dir="rtl"] .grid-cell {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 24px 40px 24px 24px;
}

/* Product cards - flip border */
html[dir="rtl"] .product-card {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 32px 40px 32px 24px;
}
html[dir="rtl"] .product-mini-card {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 20px 32px 20px 20px;
}

/* Tier left border -> right border */
html[dir="rtl"] .tier {
  border-left: none;
  border-right: 3px solid #0072BA;
}

/* Stat cards */
html[dir="rtl"] .stat-card,
html[dir="rtl"] .stat-card--prominent {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 24px 40px 24px 24px;
}

/* Process cells */
html[dir="rtl"] .process-cell {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 32px 40px 32px 24px;
}

/* Capability cells */
html[dir="rtl"] .capability {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 24px 40px 24px 24px;
}

/* Pillar cards */
html[dir="rtl"] .pillar-card {
  border-right: none;
  border-left: 1px solid #BEBEBE;
  padding: 40px 40px 40px 24px;
}

/* Sustainability compliance badge */
html[dir="rtl"] .compliance-badge {
  border-left: none;
  border-right: 4px solid #0072BA;
  flex-direction: row-reverse;
}

/* Spec rows */
html[dir="rtl"] .spec-row {
  flex-direction: row-reverse;
}
html[dir="rtl"] .spec-row span:first-child {
  text-align: right;
}

/* Link arrows */
html[dir="rtl"] .link-arrow {
  flex-direction: row-reverse;
}

/* Breadcrumb */
html[dir="rtl"] .breadcrumb-bar .container {
  direction: rtl;
  text-align: right;
}

/* Contact layout */
html[dir="rtl"] .contact__inner {
  direction: rtl;
}
html[dir="rtl"] .value-prop {
  flex-direction: row-reverse;
}
html[dir="rtl"] .contact__form {
  padding: 32px 40px 32px 32px;
}

/* Contact tabs */
html[dir="rtl"] .contact-tabs {
  flex-direction: row-reverse;
}

/* Chat */
html[dir="rtl"] .chat__message {
  flex-direction: row-reverse;
}
html[dir="rtl"] .chat__message--user {
  flex-direction: row;
}
html[dir="rtl"] .chat__bubble {
  text-align: right;
}
html[dir="rtl"] .chat__input-area {
  flex-direction: row-reverse;
}

/* Footer */
html[dir="rtl"] .footer__top {
  direction: rtl;
}
html[dir="rtl"] .footer__bottom {
  flex-direction: row-reverse;
}

/* Back to top */
html[dir="rtl"] .back-to-top {
  left: 24px;
  right: auto;
}

/* Accordion */
html[dir="rtl"] .accordion__trigger,
html[dir="rtl"] .accordion-trigger {
  flex-direction: row-reverse;
  text-align: right;
}
html[dir="rtl"] .accordion__content,
html[dir="rtl"] .accordion-content {
  padding: 0 28px 28px 0;
  text-align: right;
}

/* Language selector dropdown */
html[dir="rtl"] .lang-selector__dropdown {
  right: auto;
  left: 0;
}

/* === MOBILE RTL FIXES === */
@media (max-width: 640px) {
  html[dir="rtl"] .header__logo-bar {
    flex-direction: row-reverse;
    padding: 0 16px;
  }
  html[dir="rtl"] .header__logo {
    flex: 1;
  }
  html[dir="rtl"] .grid-cell {
    border-left: none;
    padding: 20px;
  }
  html[dir="rtl"] .product-card,
  html[dir="rtl"] .product-mini-card {
    border-left: none;
    padding: 20px;
  }
  html[dir="rtl"] .stat-card--prominent {
    border-left: none;
  }
  html[dir="rtl"] .process-cell {
    border-left: none;
  }
  html[dir="rtl"] .capability {
    border-left: none;
  }
  html[dir="rtl"] .contact__inner {
    grid-template-columns: 1fr;
  }
  html[dir="rtl"] .hero__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  html[dir="rtl"] .footer__top {
    grid-template-columns: 1fr;
  }
  html[dir="rtl"] .footer__links {
    grid-template-columns: 1fr 1fr;
  }
}
