/* Arabic RTL — natural document direction; do NOT manually swap grid columns */
html[lang="zh-Hans"] body {
  direction: ltr;
}

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

html[dir="rtl"] .header-inner,
html[dir="rtl"] .header-actions,
html[dir="rtl"] .nav {
  direction: rtl;
}

html[dir="rtl"] .logo.logo--image,
html[dir="rtl"] .page-catalog .logo--image,
html[dir="rtl"] .page-product-detail .logo--image {
  margin-left: 0;
  margin-inline-start: clamp(-0.45rem, -1.2vw, -0.1rem);
}

/* —— Solutions section: centered heading —— */
html[dir="rtl"] #solutions .h-section,
html[dir="rtl"] #solutions .solutions-cta-line {
  text-align: center !important;
}

html[dir="rtl"] .section-solutions .solution-grid {
  direction: rtl;
}

/* —— Contact section: centered heading —— */
html[dir="rtl"] #contact .h-section,
html[dir="rtl"] #contact .contact-subtitle,
html[dir="rtl"] .page-contact .h-section,
html[dir="rtl"] .page-contact .contact-subtitle,
html[dir="rtl"] .page-contact .contact-lead {
  text-align: center !important;
}

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

html[dir="rtl"] .contact-form,
html[dir="rtl"] .contact-aside {
  direction: rtl;
  text-align: start;
}

/* —— Homepage product strips —— */
html[dir="rtl"] .hp-two {
  direction: rtl;
}

html[dir="rtl"] .hp-copy,
html[dir="rtl"] .hp-media {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .hp-two--reverse {
  direction: ltr;
}

html[dir="rtl"] .hp-two--reverse .hp-copy,
html[dir="rtl"] .hp-two--reverse .hp-media {
  direction: rtl;
}

@media (max-width: 900px) {
  html[dir="rtl"] .hp-two,
  html[dir="rtl"] .hp-two--reverse {
    direction: rtl;
  }
}

html[dir="rtl"] .feat-list li {
  direction: rtl;
  text-align: start;
}

/* —— News: cards flow right → left —— */
html[dir="rtl"] .news-grid-home {
  direction: rtl;
}

html[dir="rtl"] .news-card-body {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .section-news-home .h-section--left,
html[dir="rtl"] .news-sub {
  text-align: start;
}

/* —— Catalog: RTL grid auto-places sidebar on the right —— */
html[dir="rtl"] .catalog-toolbar-inner {
  direction: rtl;
}

html[dir="rtl"] .catalog-shell {
  direction: rtl;
}

html[dir="rtl"] .catalog-content,
html[dir="rtl"] .cat-sidebar {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .cat-link {
  text-align: start;
}

html[dir="rtl"] .catalog-intro,
html[dir="rtl"] .catalog-intro-lead,
html[dir="rtl"] .catalog-intro-columns {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .catalog-bc {
  direction: rtl;
}

html[dir="rtl"] .catalog-intro-list li {
  direction: rtl;
  text-align: start;
  list-style-position: inside;
}

html[dir="rtl"] .breadcrumb-back {
  transform: scaleX(-1);
}

@media (max-width: 960px) {
  html[dir="rtl"] .cat-sidebar.is-open {
    left: auto;
    right: 0;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  }
}

/* —— Product detail —— */
html[dir="rtl"] .detail-hero-pro {
  direction: rtl;
}

html[dir="rtl"] .detail-hero-copy {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .detail-bc {
  direction: rtl;
}

html[dir="rtl"] .detail-jiabo-tabbar {
  direction: rtl;
}

html[dir="rtl"] .detail-jiabo-facts li {
  direction: rtl;
  text-align: start;
  padding-left: 0;
  padding-inline-start: 1.15rem;
}

html[dir="rtl"] .detail-jiabo-facts li::before {
  left: auto;
  inset-inline-start: 0;
}

html[dir="rtl"] .detail-jiabo-table-simple tbody th,
html[dir="rtl"] .detail-jiabo-table-simple td,
html[dir="rtl"] .detail-jiabo-table-compare tbody th {
  text-align: start;
}

html[dir="rtl"] .detail-jiabo-table-simple,
html[dir="rtl"] .detail-jiabo-table-compare {
  direction: rtl;
}

/* —— After-sales / news pages —— */
html[dir="rtl"] .news-content-layout {
  direction: rtl;
}

html[dir="rtl"] .news-article-body {
  direction: rtl;
  text-align: start;
}

html[dir="rtl"] .news-subnav-list {
  direction: rtl;
}

/* —— Arrows & footer —— */
html[dir="rtl"] .ico-forward {
  display: inline-block;
  transform: scaleX(-1);
}

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

html[dir="rtl"] .page-back-btn {
  direction: rtl;
}

html[dir="rtl"] .catalog-search {
  direction: rtl;
}

/* —— Carousels: keep LTR slide math (translateX) inside RTL pages —— */
html[dir="rtl"] .machine-catalog-carousel,
html[dir="rtl"] .machine-catalog-viewport,
html[dir="rtl"] .machine-catalog-track {
  direction: ltr;
}

html[dir="rtl"] .catalog-hero-viewport,
html[dir="rtl"] .catalog-hero-track {
  direction: ltr;
}

/* —— Home machine catalog: RTL captions & controls (track stays LTR for slide math) —— */
html[dir="rtl"] .section-machine-catalog .machine-catalog-sub {
  direction: rtl;
  text-align: start;
  margin-inline-start: auto;
  margin-inline-end: 0;
}

html[dir="rtl"] .machine-catalog-item .solution-card-caption {
  direction: rtl;
  align-items: flex-end;
  text-align: start;
}

html[dir="rtl"] .machine-catalog-item .solution-card-title,
html[dir="rtl"] .machine-catalog-item .solution-card-kicker,
html[dir="rtl"] .machine-catalog-item .solution-card-desc {
  direction: rtl;
  text-align: start;
  width: 100%;
}

html[dir="rtl"] .machine-catalog-nav--prev {
  left: auto;
  right: -0.35rem;
}

html[dir="rtl"] .machine-catalog-nav--next {
  right: auto;
  left: -0.35rem;
}

html[dir="rtl"] .machine-catalog-nav--prev::after {
  transform: rotate(-45deg);
  margin-left: 0;
  margin-right: 3px;
}

html[dir="rtl"] .machine-catalog-nav--next::after {
  transform: rotate(135deg);
  margin-right: 0;
  margin-left: 3px;
}

html[dir="rtl"] .machine-catalog-dots {
  direction: rtl;
}

/* —— Language switcher —— */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem 0.4rem 0.5rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft, #475569);
  cursor: pointer;
}

.lang-select {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  padding: 0 1.1rem 0 0.15rem;
  max-width: 8.5rem;
  line-height: 1.2;
}

html[dir="rtl"] .lang-select {
  padding: 0 0.15rem 0 1.1rem;
}

.lang-select-short {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header .lang-switcher {
  flex-shrink: 0;
}
