/* Arabic typography and spacing are scoped so English layouts keep their proportions. */
html[lang='ar'] {
  --arabic-font: 'IBM Plex Sans Arabic', 'Source Sans 3', Arial, sans-serif;
}
html[lang='ar'] body {
  font-family: var(--arabic-font);
  line-height: 1.8;
}
html[lang='ar'] :is(h1, h2, h3, p, a, button, label, span, strong) {
  letter-spacing: 0;
}
html[lang='ar'] :is(h1, h2, h3) {
  line-height: 1.4;
  text-wrap: pretty;
}
html[lang='ar'] p,
html[lang='ar'] address {
  line-height: 1.85;
}
html[lang='ar'] :is(.company-page, .contact-page, .product-page, .solutions-page) p {
  line-height: 1.85;
}
html[lang='ar']
  :is(
    .company-page .co-hero,
    .contact-page .contact-intro,
    .product-page .product-hero,
    .solutions-intro
  )
  h1 {
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}
html[lang='ar'] :is(.company-page h2, .product-page h2, .solutions-support h2, .solutions-cta h2) {
  font-size: clamp(30px, 3.5vw, 44px);
  line-height: 1.45;
}
html[lang='ar']
  :is(
    .company-page h3,
    .product-page h3,
    .solutions-support-options h3,
    .solutions-card-content h2
  ) {
  font-size: 26px;
  line-height: 1.5;
}
html[lang='ar'] .solutions-guidance h2 {
  font-size: 30px;
  line-height: 1.5;
}
html[lang='ar'] :is(.contact-page .contact-details h2, .contact-page .enquiry-form h2) {
  font-size: 26px;
  line-height: 1.5;
}
html[lang='ar'] :is(.product-application-list li, .co-checklist li, .co-service-link strong) {
  line-height: 1.75;
}
html[lang='ar']
  :is(
    .button,
    .button-dark,
    .text-link,
    .co-text-link,
    .product-text-link,
    .product-card-link,
    .solutions-card-link,
    .solutions-services-link
  ) {
  line-height: 1.65;
}
html[lang='ar'] .site-footer h2,
html[lang='ar'] .menu-close,
html[lang='ar'] .enquiry-form :is(input, select, textarea) {
  font-family: var(--arabic-font);
}
html[lang='ar']
  :is(
    .eyebrow,
    .solutions-category-role,
    .home-system-link span,
    .co-service-link > span,
    .contact-phone-card > span
  ) {
  letter-spacing: 0;
  line-height: 1.65;
}
html[lang='ar'] .desktop-nav a {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}
html[lang='ar'] .desktop-nav a::after {
  transform-origin: right;
}
html[lang='ar'] .language-switch[lang='en'] {
  font-family: 'Source Sans 3', Arial, sans-serif;
}
html[lang='ar']
  :is(
    .home-arrow,
    .product-arrow,
    .co-arrow,
    .text-link img,
    .mobile-menu-links img,
    .home-system-link span img,
    .solutions-category-role img,
    .solutions-card-link img,
    .solutions-services-link img,
    .contact-phone-card > span img
  ) {
  scale: -1 1;
}
html[lang='ar'] :is(.footer-contact > a, .contact-details a, .contact-phone-card strong) {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
html[lang='ar'] .contact-phone-card {
  height: auto;
  min-height: 88px;
}
html[lang='ar'] .enquiry-form select {
  background-position: left 16px center;
  padding-right: 16px;
  padding-left: 48px;
}
html[lang='ar'] .enquiry-form :is(input, textarea) {
  text-align: start;
}
html[lang='ar'] .enquiry-form input[type='tel'] {
  direction: ltr;
  text-align: right;
}
html[lang='ar'] .enquiry-form label {
  font-size: 15px;
  line-height: 1.7;
  gap: 8px;
}
html[lang='ar'] .enquiry-form :is(input, select, textarea) {
  line-height: 1.5;
}
html[lang='ar'] .enquiry-form textarea {
  min-height: 160px;
}
html[lang='ar'] .contact-page .contact-form-note {
  font-size: 14px;
}
html[lang='ar'] .home-message h1 {
  font-size: 68px;
  line-height: 1.35;
  font-weight: 500;
}
html[lang='ar'] .home-product-info h3 {
  font-size: 22px;
  line-height: 1.6;
}
html[lang='ar'] .home-industry-grid h3 {
  white-space: normal;
}
html[lang='ar'] .home-system-link {
  height: auto;
  min-height: 80px;
  gap: 6px;
  padding: 12px 15px;
}
html[lang='ar'] .home-system-link strong {
  font-size: 15px;
  line-height: 1.65;
}
/* The decorative circuit stays anchored; only its labels follow RTL reading order. */
html[lang='ar'] .product-flow-start {
  left: auto;
  right: 0;
  text-align: left;
}
html[lang='ar'] .product-flow-end {
  right: auto;
  left: 0;
  text-align: right;
}
html[lang='ar'] .product-flow {
  font-size: 14px;
  line-height: 1.7;
}
html[lang='ar'] .product-flow-node {
  line-height: 1.65;
}
html[lang='ar'] .co-story-copy {
  gap: 24px;
}
html[lang='ar'] .co-service-link {
  height: auto;
}
html[lang='ar'] .co-story-image {
  height: 490px;
}
html[lang='ar'] :is(.co-services-list, .co-values, .co-capabilities) .eyebrow {
  margin-bottom: 24px;
}
html[lang='ar'] :is(.product-section-stack, .solutions-support-content) {
  gap: 32px;
}
html[lang='ar'] :is(.co-text-link, .product-text-link, .solutions-services-link) {
  min-height: 44px;
}
html[lang='ar'] .solutions-hero {
  margin-bottom: 0;
  overflow: hidden;
}
html[lang='ar'] .solutions-categories {
  padding-top: 64px;
}
html[lang='ar'] .mobile-menu-links a {
  font-size: 26px;
  line-height: 1.6;
}
html[lang='ar'] .site-footer h2 {
  font-size: 14px;
  line-height: 1.7;
}
html[lang='ar'] .footer-links a {
  font-size: 15px;
  line-height: 1.8;
}

/* Stack text-heavy sections before tablet columns become too narrow for Arabic. */
@media (max-width: 900px) {
  html[lang='ar'] :is(.co-story-grid, .co-maintenance-grid, .product-equipment-grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  html[lang='ar'] .company-page .co-story-image {
    height: auto;
    aspect-ratio: 4/3;
    max-height: 440px;
  }
  html[lang='ar'] .company-page .co-service-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px 16px;
  }
  html[lang='ar'] .company-page .co-service-row p {
    grid-column: 2;
  }
  html[lang='ar'] .contact-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  html[lang='ar'] .contact-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
  html[lang='ar'] .contact-page .enquiry-form {
    width: 100%;
    padding: 32px;
  }
  html[lang='ar'] :is(.co-cta-inner, .product-enquiry-content, .solutions-cta-content) {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
  html[lang='ar'] :is(.co-cta, .product-enquiry, .solutions-cta) .button {
    width: 100%;
  }
  html[lang='ar'] :is(.co-values-grid, .product-highlights-grid, .solutions-support-options) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  html[lang='ar'] :is(.co-values-grid, .co-capabilities-grid) {
    margin-top: 32px;
  }
  html[lang='ar'] .footer-links a {
    min-height: 40px;
    display: flex;
    align-items: center;
    margin-top: 4px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  html[lang='ar'] .home-product-info h3 {
    font-size: 20px;
  }
}
@media (max-width: 760px) {
  html[lang='ar'] .home-message h1 {
    font-size: 44px;
    line-height: 1.4;
  }
  html[lang='ar'] .home-product-info h3 {
    font-size: 21px;
  }
  html[lang='ar'] .home-industry-grid h3 {
    font-size: 22px;
  }
  html[lang='ar']
    :is(
      .company-page .co-hero,
      .contact-page .contact-intro,
      .product-page .product-hero,
      .solutions-intro
    )
    h1 {
    font-size: 36px;
    line-height: 1.4;
  }
  html[lang='ar']
    :is(.company-page h2, .solutions-support h2, .solutions-cta h2, .product-page h2) {
    font-size: 28px;
    line-height: 1.5;
  }
  html[lang='ar']
    :is(
      .company-page h3,
      .product-page h3,
      .solutions-support-options h3,
      .solutions-card-content h2
    ) {
    font-size: 22px;
    line-height: 1.5;
  }
  html[lang='ar'] :is(.contact-page .contact-details h2, .contact-page .enquiry-form h2) {
    font-size: 24px;
    line-height: 1.5;
  }
  html[lang='ar']
    :is(.company-page, .contact-page, .product-page, .solutions-page)
    p:not(.eyebrow) {
    font-size: 16px;
  }
  html[lang='ar'] .product-page .container {
    width: calc(100% - 48px);
  }
  html[lang='ar'] :is(.co-hero-intro, .contact-intro, .product-hero-copy, .solutions-intro) {
    padding-top: 40px;
    padding-bottom: 24px;
    gap: 20px;
  }
  html[lang='ar']
    :is(
      .co-section,
      .co-story,
      .product-highlights,
      .product-applications,
      .product-related,
      .solutions-support,
      .contact-enquiry
    ) {
    padding-block: 56px;
  }
  html[lang='ar'] :is(.co-cta, .product-enquiry, .solutions-cta) {
    padding-block: 48px;
  }
  html[lang='ar'] .solutions-categories {
    padding: 40px 0 56px;
  }
  html[lang='ar'] :is(.product-section-stack, .solutions-support-content) {
    gap: 24px;
  }
  html[lang='ar'] .company-page .co-service-row {
    padding-top: 28px;
    margin-top: 28px;
  }
  html[lang='ar'] .company-page .co-service-row:first-child {
    margin-top: 0;
  }
  html[lang='ar'] .co-service-rows {
    margin-top: 32px;
  }
  html[lang='ar'] .co-capabilities-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  html[lang='ar'] .contact-details {
    display: flex;
    gap: 32px;
  }
  html[lang='ar'] .contact-page .enquiry-form {
    padding: 24px 20px;
    gap: 20px;
  }
  html[lang='ar'] .contact-field-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  html[lang='ar'] .product-related-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }
  html[lang='ar'] .product-related-heading .product-text-link {
    width: 100%;
  }
}
@media (max-width: 700px) {
  html[lang='ar'] .product-flow {
    font-size: 12px;
  }
  html[lang='ar'] .product-flow-node {
    font-size: 13px;
    padding: 14px 6px;
  }
  html[lang='ar'] .solutions-quick-link {
    font-size: 14px;
    line-height: 1.7;
  }
  html[lang='ar'] .product-related-info {
    gap: 8px;
  }
  html[lang='ar'] .product-related-image,
  html[lang='ar'] .product-related-image img {
    width: 88px;
    height: 104px;
  }
  html[lang='ar'] .product-page .product-related-info > p {
    font-size: 15px;
  }
  html[lang='ar'] .solutions-card-content {
    padding: 20px;
  }
}
@media (max-width: 360px) {
  html[lang='ar']
    :is(
      .company-page .co-hero,
      .contact-page .contact-intro,
      .product-page .product-hero,
      .solutions-intro
    )
    h1 {
    font-size: 32px;
  }
  html[lang='ar'] .product-related-card {
    gap: 12px;
  }
  html[lang='ar'] .product-related-image,
  html[lang='ar'] .product-related-image img {
    width: 72px;
    height: 92px;
  }
  html[lang='ar'] .product-page .product-related-info h3 {
    font-size: 20px;
  }
}
