/*
 * rtl.css — Élite Parfums RTL 覆盖样式
 * 阶段 4 实现
 *
 * 适用语言：阿拉伯语 (ar)、希伯来语 (he)、波斯语 (fa) 等 RTL 语言
 * 加载条件：is_rtl() === true 或当前语言代码为 RTL 语言时
 * 覆盖策略：仅覆盖需要镜像的属性，不重复定义与方向无关的样式
 */

/* ── 根节点方向 ──────────────────────────────────────────────────────────── */

html[dir="rtl"],
body.is-rtl {
  direction: rtl;
  text-align: right;
}

/* ── 排版 ──────────────────────────────────────────────────────────────────── */

body.is-rtl h1,
body.is-rtl h2,
body.is-rtl h3,
body.is-rtl h4,
body.is-rtl h5,
body.is-rtl h6,
body.is-rtl p,
body.is-rtl li {
  text-align: right;
}

/* ── 导航 Header ─────────────────────────────────────────────────────────── */

body.is-rtl .site-header .container,
body.is-rtl .nav-inner {
  flex-direction: row-reverse;
}

body.is-rtl .nav-logo { margin-right: 0; margin-left: auto; }
body.is-rtl .header-actions { margin-left: 0; margin-right: auto; }

body.is-rtl .nav-primary {
  flex-direction: row-reverse;
}

body.is-rtl .nav-item + .nav-item { margin-left: 0; margin-right: 1.5rem; }

/* 下拉菜单镜像 */
body.is-rtl .nav-dropdown { left: auto; right: 0; }

/* ── 移动端汉堡菜单 ───────────────────────────────────────────────────────── */

body.is-rtl .nav-mobile { left: auto; right: 0; transform: translateX(100%); }
body.is-rtl .nav-mobile.is-open { transform: translateX(0); }

body.is-rtl .nav-mobile-close {
  left: auto;
  right: 0;
  margin-right: auto;
  margin-left: 0;
}

/* ── 首页 Hero ──────────────────────────────────────────────────────────── */

body.is-rtl .ep-hero__content { text-align: right; }
body.is-rtl .ep-hero__actions { flex-direction: row-reverse; justify-content: flex-end; }
body.is-rtl .ep-hero__stats { flex-direction: row-reverse; }

/* ── 产品卡片 ────────────────────────────────────────────────────────────── */

body.is-rtl .ep-product-card__meta { text-align: right; }
body.is-rtl .ep-product-card__tags { flex-direction: row-reverse; }
body.is-rtl .ep-product-card__footer { flex-direction: row-reverse; }

/* ── 产品列表页筛选栏 ────────────────────────────────────────────────────── */

body.is-rtl .ep-filter-bar { flex-direction: row-reverse; }
body.is-rtl .ep-filter-group label { flex-direction: row-reverse; }

/* ── 产品详情页 ──────────────────────────────────────────────────────────── */

body.is-rtl .ep-product-gallery { flex-direction: row-reverse; }
body.is-rtl .ep-product-thumbs { order: 1; }
body.is-rtl .ep-product-main-image { order: -1; }
body.is-rtl .ep-sku-switcher { flex-direction: row-reverse; }
body.is-rtl .ep-tier-price-table th,
body.is-rtl .ep-tier-price-table td { text-align: right; }

/* ── 面包屑 ──────────────────────────────────────────────────────────────── */

body.is-rtl .ep-breadcrumb { flex-direction: row-reverse; }
body.is-rtl .ep-breadcrumb__separator { transform: scaleX(-1); }

/* ── Page Hero ───────────────────────────────────────────────────────────── */

body.is-rtl .ep-page-hero__content { text-align: right; }

/* ── FAQ 手风琴 ──────────────────────────────────────────────────────────── */

body.is-rtl .ep-accordion__trigger {
  flex-direction: row-reverse;
  text-align: right;
}
body.is-rtl .ep-accordion__icon { margin-right: auto; margin-left: 0; }

/* ── 博客卡片 ────────────────────────────────────────────────────────────── */

body.is-rtl .ep-blog-card__meta { flex-direction: row-reverse; }
body.is-rtl .ep-blog-card__footer { flex-direction: row-reverse; }

/* ── 博客详情页 ──────────────────────────────────────────────────────────── */

body.is-rtl .ep-toc { right: auto; left: 2rem; }
body.is-rtl .ep-share-buttons { flex-direction: row-reverse; }

/* ── 证言卡片 ────────────────────────────────────────────────────────────── */

body.is-rtl .ep-testimonial { text-align: right; }
body.is-rtl .ep-testimonial__author { flex-direction: row-reverse; }

/* ── 流程步骤（How It Works）────────────────────────────────────────────── */

body.is-rtl .ep-process-steps { flex-direction: row-reverse; }
body.is-rtl .ep-process-step__number {
  margin-right: 0;
  margin-left: 1rem;
}

/* ── 统计数字条 ──────────────────────────────────────────────────────────── */

body.is-rtl .ep-stats-bar { flex-direction: row-reverse; }

/* ── 品牌 Logo 滚动条（方向反转）─────────────────────────────────────────── */

body.is-rtl .ep-brands-track { animation-direction: reverse; }

/* ── 询盘表单 ────────────────────────────────────────────────────────────── */

body.is-rtl .ep-inquiry-tabs { flex-direction: row-reverse; }
body.is-rtl .ep-inquiry-field label { text-align: right; }
body.is-rtl .ep-inquiry-field input,
body.is-rtl .ep-inquiry-field textarea,
body.is-rtl .ep-inquiry-field select {
  text-align: right;
  direction: rtl;
}

/* ── 页脚 ────────────────────────────────────────────────────────────────── */

body.is-rtl .ep-footer__inner { flex-direction: row-reverse; }
body.is-rtl .ep-footer__col { text-align: right; }
body.is-rtl .ep-footer__social { flex-direction: row-reverse; }
body.is-rtl .ep-footer__bottom-inner { flex-direction: row-reverse; }

/* ── 通用间距镜像 ─────────────────────────────────────────────────────────── */

body.is-rtl .mr-auto { margin-right: 0 !important; margin-left: auto !important; }
body.is-rtl .ml-auto { margin-left: 0 !important; margin-right: auto !important; }

/* ── CTA 区块 ────────────────────────────────────────────────────────────── */

body.is-rtl .ep-cta__actions { flex-direction: row-reverse; }

/* ── 表格 ────────────────────────────────────────────────────────────────── */

body.is-rtl table { direction: rtl; }
body.is-rtl th,
body.is-rtl td { text-align: right; }

/* ── 后台 React 面板（管理员界面）────────────────────────────────────────── */

.rtl .ep-admin-panel { direction: rtl; text-align: right; }
.rtl .ep-settings-nav { text-align: right; }
.rtl .ep-field-row { flex-direction: row-reverse; }
