/* ============================================================
   语言切换器 + RTL 基础
   独立文件：营销页与子后台都要用，不能塞进 components.css
   ============================================================ */

/* ============ 语言切换器 ============ */
.lang { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  transition: border-color .15s ease, color .15s ease;
}
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn:hover { border-color: var(--line-hi); color: var(--text); }
.lang[open] .lang-btn { border-color: var(--brand); color: var(--text); }
.lang-chev { transition: transform .18s ease; opacity: .7; }
.lang[open] .lang-chev { transform: rotate(180deg); }
.lang-flag {
  display: inline-flex;
  width: 20px;
  height: 14px;
  flex: none;
  border-radius: 2.5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(9, 15, 26, .12);
}
.lang-flag svg { width: 100%; height: 100%; display: block; }
.lang-native { white-space: nowrap; }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -22px rgba(9, 15, 26, .45);
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
}
.lang-item:hover { background: var(--bg-soft); color: var(--text); }
.lang-item.is-active { font-weight: 600; color: var(--text); }
.lang-check { margin-left: auto; color: var(--brand-ink); font-size: 12px; }

/* RTL：菜单靠左展开，箭头类图标镜像 */
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .a-link svg,
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* 阿拉伯语字体栈（系统内置，不引入外部字体） */
html[lang="ar"] {
  font-family: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", Tahoma, "Segoe UI", sans-serif;
}
html[lang="ar"] .hero-title { letter-spacing: 0; }

/* ---------- RTL 数字顺序 ----------
   阿拉伯语下 "$0.00+"、日期这类纯数字串会被 bidi 重排（加号跑到前面）。
   unicode-bidi: plaintext 让每个元素按自身首字符决定方向：
   纯数字 → LTR，阿拉伯文开头 → 仍然 RTL。 */
[dir="rtl"] .a-kpi-val,
[dir="rtl"] .a-plan-price,
[dir="rtl"] .a-plan-big,
[dir="rtl"] .a-table td,
[dir="rtl"] .hero-stats dt,
[dir="rtl"] .hero-stats dd,
[dir="rtl"] .price-block strong,
[dir="rtl"] .price-block .chg {
  unicode-bidi: plaintext;
}
