/* ===========================
   语言切换器
   =========================== */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang-switcher {
  position: relative;
  font-size: 13px;
}
.lang-current {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.lang-current:hover { background: rgba(255, 255, 255, 0.15); }
.lang-current .arrow {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.2s;
}
.lang-switcher.open .lang-current .arrow { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 4px 0;
  min-width: 130px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s;
  z-index: 200;
}
.lang-switcher.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-menu li {
  margin: 0;
}
.lang-menu a {
  display: block;
  padding: 7px 14px;
  color: #333 !important;
  font-size: 13px;
  text-decoration: none;
}
.lang-menu a:hover { background: #f5f7fb; }
.lang-menu .active a {
  background: rgba(26, 58, 108, 0.08);
  color: var(--color-primary) !important;
  font-weight: 600;
}
.admin-link {
  color: #fff !important;
  font-size: 13px;
  opacity: 0.85;
}
.admin-link:hover { opacity: 1; }

/* 移动端 */
@media (max-width: 768px) {
  .topbar-right {
    gap: 8px;
  }
  .admin-link {
    display: none;
  }
}

/* ===========================
   阿拉伯语 RTL 支持
   =========================== */
html[dir="rtl"] body {
  font-family: "Tahoma", "Segoe UI", "Arial", sans-serif;
}
html[dir="rtl"] .arrow {
  transform: scaleX(-1);
}
html[dir="rtl"] .topbar-wrap .topbar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .contact-info {
  text-align: right;
}
html[dir="rtl"] .nav-menu {
  padding-right: 0;
}
html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}
html[dir="rtl"] .site-footer .footer-grid > * {
  text-align: right;
}

/* RTL 时让所有 flex/grid 自动反向 */
html[dir="rtl"] .container,
html[dir="rtl"] .topbar,
html[dir="rtl"] .header-inner,
html[dir="rtl"] .hero-inner,
html[dir="rtl"] .stats-grid-2,
html[dir="rtl"] .cat-grid,
html[dir="rtl"] .product-grid,
html[dir="rtl"] .service-grid,
html[dir="rtl"] .case-grid {
  direction: rtl;
}

/* 阿拉伯语字体调整 */
html[lang="ar-SA"] body {
  font-size: 14px;
  letter-spacing: 0;
}
html[lang="ar-SA"] h1,
html[lang="ar-SA"] h2,
html[lang="ar-SA"] h3 {
  font-weight: 700;
}

/* 菜单下拉箭头在 RTL 时反向 */
html[dir="rtl"] .nav-menu a {
  text-align: right;
}

/* 表格在 RTL 下右对齐 */
html[dir="rtl"] table {
  text-align: right;
}