/* ==========================================================================
   vtp-rtl.css — 阿语站（woruiae）RTL 覆盖样式 · 手写部分
   由 mu-plugin vtp-rtl.php 在阿语站前台按需加载（filemtime 版本号，改完即生效）

   ★ 与 mirror-from-custom.css 的分工：
     · 本文件 = **structural / 结构性**：字体、方向性图标、箭头语义、输入框方向、
       以及「不在自研 CSS 里」的元素（如 Elementor 内容里的语言下拉）。
     · mirror-from-custom.css = **spacing**：由脚本从三份自研 CSS 自动生成的
       margin/padding/border/left-right 精确镜像。

   ⚠️ 教训（务必遵守）：
     **不要在这里手写 margin/padding 镜像。**
     起初我把 `.vm-sidebar .sidebar-item { padding: 15px }`（本来就是对称的）
     误当不对称去翻，写成了 `padding-left:15px; padding-right:0`，
     反而制造了「卡片贴住容器右边框」的 bug。
     间距类一律交给自动生成 —— 那里读的是原 CSS 的真实值。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 基础
   -------------------------------------------------------------------------- */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* 阿拉伯语字体栈：系统字体优先，避免拉丁字体把阿语字形拉坏 */
html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic",
               "Geeza Pro", "Arial", sans-serif;
}

/* 注：不要给 body 加 overflow-x:hidden —— 会创建滚动容器，破坏 sticky 定位。
   横向溢出已在下面「语言切换下拉」处按根因修正。 */

/* 拉丁内容（邮箱、型号、品牌）按内容自身方向渲染，避免数字与分隔符错位 */
html[dir="rtl"] .elementor-icon-list-text,
html[dir="rtl"] .prodetails-name,
html[dir="rtl"] .link-intro {
  unicode-bidi: plaintext;
}

/* --------------------------------------------------------------------------
   2. 语言切换下拉
   原来 `.lang-dropdown { right: 0 }` 锚在父级右缘；RTL 下父级被 flex 排到左侧，
   下拉仍以父级右缘为锚向右展开 → 左缘跑到 -13px，造成整站横向溢出。
   -------------------------------------------------------------------------- */
html[dir="rtl"] .lang-dropdown {
  right: auto !important;
  left: 0 !important;
}
html[dir="rtl"] .lang-btn .arrow {
  margin-left: 0 !important;
  margin-right: 4px !important;
}

/* --------------------------------------------------------------------------
   3. 方向性图标 —— 统一水平镜像
   （左右箭头、尖角、分类树展开箭头）
   -------------------------------------------------------------------------- */
html[dir="rtl"] .e-font-icon-svg.e-fas-angle-right,
html[dir="rtl"] .e-font-icon-svg.e-fas-angle-left,
html[dir="rtl"] .e-font-icon-svg.e-fas-arrow-right,
html[dir="rtl"] .e-font-icon-svg.e-fas-arrow-left,
html[dir="rtl"] .e-font-icon-svg.e-fas-long-arrow-alt-right,
html[dir="rtl"] .e-font-icon-svg.e-fas-long-arrow-alt-left,
html[dir="rtl"] .e-font-icon-svg.e-fas-chevron-right,
html[dir="rtl"] .e-font-icon-svg.e-fas-chevron-left {
  transform: scaleX(-1);
}
/* 注：.vm-cate-toggle 是 ::before/::after 拼的「+/-」加减号图标，
   镜像无意义（加号镜像还是加号），故不处理。其 right:0 定位由自动生成规则镜像。 */

/* --------------------------------------------------------------------------
   4. 翻页箭头语义
   LTR：prev 箭头朝左 ←，next 朝右 →
   RTL：往回翻是往右 → prev 朝右 ➜，next 朝左 ⬅（整体反转）
   间距已在 mirror-from-custom.css 处理，这里只管方向与浮动。
   -------------------------------------------------------------------------- */
html[dir="rtl"] .elementor-widget-post-navigation .post-navigation__prev--label::before,
html[dir="rtl"] .vm-prod-archive .pagelink .prev .link-intro::before {
  transform: none;              /* 取消 180° 旋转 → 朝右 */
}
html[dir="rtl"] .elementor-widget-post-navigation .post-navigation__next--label::before,
html[dir="rtl"] .vm-prod-archive .pagelink .next .link-intro::before {
  transform: rotate(180deg);    /* 朝左 */
}
/* post-navigation 的 next 箭头原本 float:right，RTL 下改为左侧 */
html[dir="rtl"] .elementor-widget-post-navigation .post-navigation__next--label::before {
  float: left;
}

/* --------------------------------------------------------------------------
   5. 表单
   -------------------------------------------------------------------------- */
/* 邮箱 / 电话输入框内容保持 LTR（避免 @ 与数字顺序错乱），文字右对齐 */
html[dir="rtl"] .inquiry-form input[type="email"],
html[dir="rtl"] .elementor-field-type-email input,
html[dir="rtl"] .elementor-field-type-tel input {
  direction: ltr;
  text-align: right;
}
html[dir="rtl"] .inquiry-form input,
html[dir="rtl"] .inquiry-form textarea {
  text-align: right;
}
/* 注：.input-error 原规则只有 `border-bottom: 1px solid red`（无左右边框），
   RTL 下无需镜像，不处理。 */

/* --------------------------------------------------------------------------
   6. 面包屑 / 分页 / 页脚
   -------------------------------------------------------------------------- */
html[dir="rtl"] #breadcrumbs,
html[dir="rtl"] .page-breadcrumbs,
html[dir="rtl"] .page-numbers,
html[dir="rtl"] .vm-paginate {
  direction: rtl;
}
html[dir="rtl"] footer .elementor-social-icons-wrapper,
html[dir="rtl"] .elementor-widget-social-icons .elementor-social-icons-wrapper {
  direction: rtl;
}
