/* ============================================================
 * RTL 样式：仅当 html[dir="rtl"] 时生效（维吾尔语）
 * 中文（dir="ltr"）完全不应用这些规则
 * ============================================================ */

/* 维吾尔语字体 */
html[dir="rtl"] {
    direction: rt l;
}
html[dir="rtl"] body {
    font-family: 'UTT', system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
    text-align: right;
}
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] .btn {
    font-family: 'UTT', system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

/* 输入框方向 */
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="text"] {
    text-align: right;
}

/* 输入框内图标镜像 */
html[dir="rtl"] .bi-chevron-right::before,
html[dir="rtl"] .bi-chevron-left::before,
html[dir="rtl"] .bi-arrow-right::before,
html[dir="rtl"] .bi-arrow-left::before,
html[dir="rtl"] .bi-caret-right::before,
html[dir="rtl"] .bi-caret-left::before {
    display: inline-block;
    transform: scaleX(-1);
}

/* Bootstrap text 工具类修正 */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end   { text-align: left !important; }
html[dir="rtl"] .ms-auto    { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .me-auto    { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-1 { margin-right: .25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-2 { margin-right: .5rem !important;  margin-left: 0 !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important;   margin-left: 0 !important; }
html[dir="rtl"] .me-1 { margin-left: .25rem !important;  margin-right: 0 !important; }
html[dir="rtl"] .me-2 { margin-left: .5rem !important;   margin-right: 0 !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important;    margin-right: 0 !important; }

/* 表单图标对齐 */
html[dir="rtl"] .input-group-text {
    border-radius: 0 .375rem .375rem 0 !important;
}

/* 表格方向 */
html[dir="rtl"] .table th,
html[dir="rtl"] .table td { text-align: right; }
html[dir="rtl"] .table th.text-center,
html[dir="rtl"] .table td.text-center { text-align: center !important; }

/* ============================================================
 * 底部导航 RTL —— 关键修正
 * 用 !important 覆盖 layout.php 里的 flex-direction: row-reverse
 * ============================================================ */
html[dir="rtl"] .bottom-nav {
    flex-direction: row !important;
    direction: rtl !important;
}
html[dir="rtl"] .bottom-nav a {
    direction: rtl !important;
}

/* 顶部返回按钮：维吾尔语时靠右 */
html[dir="rtl"] .topbar .back { right: 12px !important; left: auto !important; }

/* 悬浮按钮：维吾尔语时靠左下 */
html[dir="rtl"] .fab { left: 16px !important; right: auto !important; }

/* 抽屉从底部上来，方向跟随 RTL */
html[dir="rtl"] .dr { direction: rtl; }

/* 列表项左右方向 */
html[dir="rtl"] .list-item { direction: rtl; }

/* 图片、图标不允许镜像 */
html[dir="rtl"] .goods-item .img img,
html[dir="rtl"] .gd-slide img {
    transform: none !important;
}