/* Giao diện chữ phải -> trái (he, ar) — 2026-11-04. Chỉ nạp khi trang ở ngôn ngữ RTL (layout.html), SAU bản CSS đảo chiều tự động
   (/f/rtl/css/... do vnh_rtl.flip_css sinh từ CSS gốc). File này chứa phần tự động không làm được. */

/* 1. Chữ Ả Rập / Do Thái: "mượn" thêm dải ký tự cho 2 họ font của site (unicode-range) -> không phải đổi font-family ở đâu cả,
      chữ Latin vẫn dùng Radnika / NeueEinstellung, trình duyệt chỉ tải font Noto khi trang có chữ đó. Font biến thiên (100-900). */
@font-face {font-family: Radnika; font-display: swap; font-style: normal; font-weight: 100 900;
  src: url("/f/fonts/rtl/NotoSansArabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFC;}
@font-face {font-family: NeueEinstellung; font-display: swap; font-style: normal; font-weight: 100 900;
  src: url("/f/fonts/rtl/NotoKufiArabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFC;}
@font-face {font-family: Radnika; font-display: swap; font-style: normal; font-weight: 100 900;
  src: url("/f/fonts/rtl/NotoSansHebrew.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+FB1D-FB4F, U+20AA;}
@font-face {font-family: NeueEinstellung; font-display: swap; font-style: normal; font-weight: 100 900;
  src: url("/f/fonts/rtl/NotoSansHebrew.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+FB1D-FB4F, U+20AA;}

/* letter-spacing làm đứt nét nối chữ Ả Rập; chữ hoa không có nghĩa với Ả Rập / Do Thái */
html[dir="rtl"] body, html[dir="rtl"] body * {letter-spacing: 0 !important;}
html[lang="ar"] body {line-height: 1.75;}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 {line-height: 1.45;}

/* 2. Nội dung luôn trái -> phải trong trang RTL: giá tiền, email, số điện thoại, URL, mã đơn, số thẻ/mã giảm giá */
html[dir="rtl"] .amount, html[dir="rtl"] .price, html[dir="rtl"] .woocommerce-Price-amount, html[dir="rtl"] bdi:not([dir]),
html[dir="rtl"] .customer-phone, html[dir="rtl"] .customer-email, html[dir="rtl"] .ltr {direction: ltr; unicode-bidi: isolate;}
html[dir="rtl"] .customer-phone, html[dir="rtl"] .customer-email {text-align: right;}
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="number"], html[dir="rtl"] input[name*="coupon"], html[dir="rtl"] input[name*="phone"],
html[dir="rtl"] input[name*="email"], html[dir="rtl"] input[name*="zip"], html[dir="rtl"] input[name*="postcode"] {direction: ltr; text-align: right;}

/* 3. Thư viện JS tự tính tọa độ theo trái -> phải: giữ LTR cho khung, chữ bên trong vẫn RTL */
html[dir="rtl"] .master-slider-parent, html[dir="rtl"] .master-slider, html[dir="rtl"] .ms-container {direction: ltr;}
html[dir="rtl"] .master-slider .ms-layer, html[dir="rtl"] .master-slider .ms-slide-info {direction: rtl;}
/* Gallery ảnh sản phẩm (FlexSlider, products-gallery.js đặt rtl:false) */
html[dir="rtl"] .woocommerce-product-gallery, html[dir="rtl"] .flexslider, html[dir="rtl"] .flex-viewport {direction: ltr;}

/* Thông báo nổi: JS custom-notifications.js tính vị trí theo trái -> phải (CSS gốc không đảo, xem layout.html): giữ LTR cho khung, chữ bên trong RTL */
html[dir="rtl"] .page-notifications {direction: ltr;}
html[dir="rtl"] .page-notifications .gbt-custom-notification-message {direction: rtl;}

/* 4. Mũi tên "tiếp / quay lại" đảo theo chiều đọc */
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-fill::before, html[dir="rtl"] .bi-caret-left-fill::before,
html[dir="rtl"] .bi-chevron-double-right::before, html[dir="rtl"] .bi-chevron-double-left::before {display: inline-block; transform: scaleX(-1);}
