/* ===== 阿拉伯语 RTL 特殊样式 ===== */
/* 仅对 /ar/ 目录下的页面生效 */

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

/* ===== 布局镜像 ===== */

/* Header 导航镜像 */
html[dir="rtl"] .header-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-desktop {
  flex-direction: row-reverse;
}

html[dir="rtl"] .header-right {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lang-switcher-inline {
  margin-right: 0;
  margin-left: 12px;
}

/* 语言切换器顺序保持从左到右（语言代码习惯） */
html[dir="rtl"] .lang-switcher-inline {
  direction: ltr;
}

/* ===== 按钮和交互元素 ===== */

/* 按钮内图标间距调整 */
html[dir="rtl"] .btn-primary .btn-icon,
html[dir="rtl"] .btn-outline .btn-icon,
html[dir="rtl"] .btn-quote .btn-icon {
  margin-left: 0;
  margin-right: 8px;
}

/* CTA按钮组镜像 */
html[dir="rtl"] .hero-btns {
  flex-direction: row-reverse;
}

html[dir="rtl"] .cta-buttons {
  flex-direction: row-reverse;
}

/* ===== 内容区域镜像 ===== */

/* 左右布局区块镜像 */
html[dir="rtl"] .about-layout,
html[dir="rtl"] .section-split,
html[dir="rtl"] .content-row {
  flex-direction: row-reverse;
}

/* 产品列表布局 */
html[dir="rtl"] .products-layout {
  flex-direction: row-reverse;
}

html[dir="rtl"] .category-nav {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.1);
}

/* 产品网格 */
html[dir="rtl"] .product-grid {
  direction: rtl;
}

/* 特性/优势列表 */
html[dir="rtl"] .feature-list,
html[dir="rtl"] .benefit-list {
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .feature-list li,
html[dir="rtl"] .benefit-list li {
  text-align: right;
}

/* ===== 表单元素 ===== */

/* 表单标签和输入框 */
html[dir="rtl"] .form-group {
  text-align: right;
}

html[dir="rtl"] .form-input,
html[dir="rtl"] .form-textarea,
html[dir="rtl"] .form-select {
  text-align: right;
}

/* 表单行内元素 */
html[dir="rtl"] .form-row {
  flex-direction: row-reverse;
}

/* 复选框和单选按钮 */
html[dir="rtl"] .checkbox-wrap,
html[dir="rtl"] .radio-wrap {
  flex-direction: row-reverse;
}

html[dir="rtl"] .checkbox-wrap input,
html[dir="rtl"] .radio-wrap input {
  margin-right: 0;
  margin-left: 8px;
}

/* ===== 卡片和列表 ===== */

/* 卡片布局 */
html[dir="rtl"] .card-row {
  flex-direction: row-reverse;
}

/* 列表项 */
html[dir="rtl"] .list-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .list-icon {
  margin-right: 0;
  margin-left: 12px;
}

/* ===== 图标不反转处理 ===== */
/* 关键：图标保持原方向，不随RTL镜像 */

html[dir="rtl"] .icon,
html[dir="rtl"] .feature-icon,
html[dir="rtl"] .benefit-icon,
html[dir="rtl"] .service-icon,
html[dir="rtl"] .product-icon,
html[dir="rtl"] .category-icon,
html[dir="rtl"] .stat-icon,
html[dir="rtl"] .contact-icon,
html[dir="rtl"] .social-icon,
html[dir="rtl"] .logo-img,
html[dir="rtl"] img[src*="icon"],
html[dir="rtl"] .fas,
html[dir="rtl"] .far,
html[dir="rtl"] .fab,
html[dir="rtl"] .material-icons {
  transform: none !important;
}

/* 箭头图标特殊处理 - 需要翻转以符合RTL阅读习惯 */
html[dir="rtl"] .arrow-left,
html[dir="rtl"] .icon-arrow-left,
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .prev-arrow {
  transform: scaleX(-1) !important;
}

html[dir="rtl"] .arrow-right,
html[dir="rtl"] .icon-arrow-right,
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .next-arrow {
  transform: scaleX(-1) !important;
}

/* 但导航箭头保持视觉一致性 */
html[dir="rtl"] .nav-arrow {
  transform: none !important;
}

/* ===== 页脚镜像 ===== */

html[dir="rtl"] .footer-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-columns {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}

/* ===== 特殊组件 ===== */

/* 时间线/步骤条 */
html[dir="rtl"] .timeline {
  direction: rtl;
}

html[dir="rtl"] .timeline-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .timeline-marker {
  margin-right: 0;
  margin-left: 16px;
}

/* 标签页 */
html[dir="rtl"] .tab-nav {
  flex-direction: row-reverse;
}

/* 面包屑导航 */
html[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-item:not(:last-child)::after {
  content: "‹";
  margin: 0 8px;
}

/* 分页 */
html[dir="rtl"] .pagination {
  flex-direction: row-reverse;
}

/* 统计数字区块 */
html[dir="rtl"] .stats-row {
  flex-direction: row-reverse;
}

/* ===== 移动端菜单 ===== */

html[dir="rtl"] .mobile-nav {
  left: auto;
  right: -100%;
}

html[dir="rtl"] .mobile-nav.active {
  right: 0;
}

/* ===== 修正特定元素的镜像问题 ===== */

/* 保持图片正常方向 */
html[dir="rtl"] img:not(.arrow-icon):not(.nav-icon) {
  transform: none;
}

/* Logo不镜像 */
html[dir="rtl"] .logo {
  transform: none;
}

/* 搜索框 */
html[dir="rtl"] .search-box {
  flex-direction: row-reverse;
}

html[dir="rtl"] .search-input {
  text-align: right;
}

/* 下拉菜单 */
html[dir="rtl"] .dropdown-menu {
  left: auto;
  right: 0;
}

/* 提示框 */
html[dir="rtl"] .tooltip {
  direction: rtl;
}

/* 模态框 */
html[dir="rtl"] .modal-content {
  direction: rtl;
}
