/* 阿语预览件 RTL 覆盖层 v3
   v2 的两处观感问题已修：
   1) v2 给 h1~h4 强行 text-align:right，覆盖掉原模板 .home-page h3{text-align:center}，
      导致 «من نحن» / «المنتجات» 两个大标题贴死右边框。v3 标题只给 direction:rtl，
      text-align 交还原模板（居中），并补左右各 20px 保险留白。
   2) 字体由系统 Tahoma 回退改为本地自带 Cairo（现代 Naskh 无衬线 400/600/700），
      阿语行高放宽、字号收一点；对比度只靠 text-shadow，不加背景遮罩
      （v3 初版加的径向渐变在亮背景上会露出硬边、像个黑方块，已撤掉）。
   结构容器仍显式 LTR —— 整页 direction:rtl 会让 flexslider / Bootstrap 栅格塌陷成白屏。 */

/* ---------- 自带阿语字体：零外网依赖，可随 /ar/ 一起上线 ---------- */
@font-face {
  font-family: 'CairoAR'; src: url('assets/fonts/Cairo-400.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'CairoAR'; src: url('assets/fonts/Cairo-600.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'CairoAR'; src: url('assets/fonts/Cairo-700.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
html[dir="rtl"] body,
html[dir="rtl"] input, html[dir="rtl"] button,
html[dir="rtl"] textarea, html[dir="rtl"] select {
  font-family: 'CairoAR', 'Dubai', 'Segoe UI', Tahoma, Arial, sans-serif;
  /* 阿语是连写文字，任何 letter-spacing 都会把字母拆开；这里统一归零 */
  letter-spacing: normal;
}

/* 结构容器恢复 LTR，保住原模板版式 */
html[dir="rtl"] .home-banner,
html[dir="rtl"] .flexslider,
html[dir="rtl"] .flexslider .slides,
html[dir="rtl"] .flexslider .slides > li,
html[dir="rtl"] .row,
html[dir="rtl"] [class*="col-"],
html[dir="rtl"] .nav,
html[dir="rtl"] .nav > ul,
html[dir="rtl"] .container,
html[dir="rtl"] .wrap,
html[dir="rtl"] .home-page,
html[dir="rtl"] .home-products,
html[dir="rtl"] .home-cases,
html[dir="rtl"] .home-customers,
html[dir="rtl"] .img-pc,
html[dir="rtl"] picture {
  direction: ltr;
}

/* 标题：只改书写方向 + 字体，保留原模板的居中，不动 text-align */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 {
  direction: rtl;
  font-family: 'CairoAR', 'Dubai', 'Segoe UI', Tahoma, Arial, sans-serif;
  letter-spacing: normal;
}
html[dir="rtl"] .home-page h3 {
  line-height: 1.5;
  font-weight: 600;
  padding-left: 20px;
  padding-right: 20px;
}

/* 正文 / 导航 / 页脚：从右往左、右对齐 */
html[dir="rtl"] p,
html[dir="rtl"] .slogan,
html[dir="rtl"] .company-intro,
html[dir="rtl"] .ButtonBox-text,
html[dir="rtl"] .footer-nav,
html[dir="rtl"] .footer-address,
html[dir="rtl"] .title,
html[dir="rtl"] .copyright {
  direction: rtl;
  text-align: right;
}
/* 阿语字母带上下延伸符号，行高必须比英文松 */
html[dir="rtl"] p { line-height: 1.95; }
html[dir="rtl"] .footer-nav li,
html[dir="rtl"] .footer-address li { text-align: right; }

/* banner 大字：位置沿用原模板 left:6%（压在左侧暗色楼群上，白字对比度最好）。
   阿语文字右对齐，但绝不能把整块挪到画面右侧 —— 那里是明亮的东方明珠球体，白字会糊掉。 */
@media (min-width: 768px) {
  html[dir="rtl"] .slogan {
    left: 6%;
    width: 58%;
    max-width: 700px;
    padding: 0 28px 0 0;
    direction: rtl;
    text-align: right;
  }
}
html[dir="rtl"] .slogan h2 {
  font-size: 28px;
  line-height: 1.72;
  font-weight: 600;
  letter-spacing: normal;
  text-shadow: 0 2px 10px rgba(0,0,0,.9), 0 0 34px rgba(0,0,0,.65);
}
html[dir="rtl"] .slogan a { font-weight: 600; }

/* 数字 / 电话 / 邮箱 / 网址在 RTL 里必须锁左到右，否则乱序 */
html[dir="rtl"] .d1,
html[dir="rtl"] .web-link a,
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"],
html[dir="rtl"] [dir="ltr"] {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

/* 轮播箭头与按钮图标镜像 */
html[dir="rtl"] .flex-direction-nav a { transform: scaleX(-1); }
html[dir="rtl"] .ButtonBox-icon { transform: scaleX(-1); }

/* 产品详情页 CMS 富文本里的红色竖装饰线：英文版在左侧（阅读起点），
   RTL 下必须镜像到右侧。同时覆盖 inline style 和正文内嵌 <style> 里的类规则
   （后者在 body 里、比 head 的 rtl.css 晚加载，必须带 !important）。
   只动 border，不碰 padding，避免把四面 20px 的内边距改坏。 */
html[dir="rtl"] section[style*="border-left"],
html[dir="rtl"] div[style*="border-left"],
html[dir="rtl"] h2[style*="border-left"],
html[dir="rtl"] h3[style*="border-left"],
html[dir="rtl"] .solution-header h2,
html[dir="rtl"] .cta-banner {
  border-left: 0 !important;
  border-right-width: 5px !important;
  border-right-style: solid !important;
  border-right-color: #cc0000 !important;
}
html[dir="rtl"] .cta-banner { text-align: right !important; }

/* 11-18：其他产品标题收回卡片右边缘 */
html[dir="rtl"] .related-items .sub-title { padding-right: 84px; }
@media (max-width: 992px) {
  html[dir="rtl"] .related-items .sub-title { padding-right: 45px; }
}
