/*
 * elpizzero — Overrides RTL para árabe / hebreo / persa.
 * Se carga SOLO cuando <html dir="rtl">. Reescribe direcciones de flex,
 * text-align, márgenes, paddings asimétricos y elementos de UI con
 * dirección lógica.
 */

html[dir="rtl"] body { direction: rtl; }

/* Tipografía: respeta direcciones lógicas */
html[dir="rtl"] {
    text-align: right;
}

/* Topbar */
html[dir="rtl"] .r-topbar-inner { direction: rtl; }
html[dir="rtl"] .r-topbar-brand { flex-direction: row; gap: .65rem; }
html[dir="rtl"] .r-topbar-name { text-align: right; }
html[dir="rtl"] .r-topbar-nap { justify-content: flex-end; }

/* Hero */
html[dir="rtl"] .r-hero-inner h1,
html[dir="rtl"] .r-hero-sub,
html[dir="rtl"] .r-hero-cta { text-align: center; }

/* Productos */
html[dir="rtl"] .product { direction: rtl; }
html[dir="rtl"] .product .info { text-align: right; }
html[dir="rtl"] .product .add { right: auto; left: .85rem; }
html[dir="rtl"] .product .ph { margin-right: 0; margin-left: 1rem; }

/* Modal producto */
html[dir="rtl"] .pmodal { direction: rtl; }
html[dir="rtl"] .pmodal h2,
html[dir="rtl"] .pmodal .desc,
html[dir="rtl"] .pmodal .opt-group h4 { text-align: right; }
html[dir="rtl"] .opt-row { flex-direction: row-reverse; }
html[dir="rtl"] .opt-row input[type="checkbox"],
html[dir="rtl"] .opt-row input[type="radio"] { margin-right: 0; margin-left: .6rem; }

/* Cart */
html[dir="rtl"] .cart { direction: rtl; }
html[dir="rtl"] .cart-item { flex-direction: row-reverse; }
html[dir="rtl"] .cart-item .body { text-align: right; }
html[dir="rtl"] .cart-totals .line,
html[dir="rtl"] .cart-totals .total { flex-direction: row-reverse; }

/* Checkout */
html[dir="rtl"] .co { direction: rtl; }
html[dir="rtl"] .co label,
html[dir="rtl"] .co h2 { text-align: right; }
html[dir="rtl"] .co .seg { direction: rtl; }
html[dir="rtl"] .co input,
html[dir="rtl"] .co select,
html[dir="rtl"] .co textarea { text-align: right; }
html[dir="rtl"] .co .row { direction: rtl; }

/* Categorías nav */
html[dir="rtl"] .cat-nav { direction: rtl; }
html[dir="rtl"] .cat-nav .scroll { flex-direction: row; }

/* Selector idioma (siempre LTR para banderas) */
html[dir="rtl"] .lang-switcher .menu { right: auto; left: 0; }
html[dir="rtl"] .lang-switcher .item { direction: ltr; text-align: left; }

/* FAB carrito */
html[dir="rtl"] .cart-fab { right: auto; left: 16px; }

/* Footer */
html[dir="rtl"] .r-footer { direction: rtl; text-align: right; }
html[dir="rtl"] .r-footer-logo { margin-right: 0; margin-left: 1rem; }

/* Tipografía árabe: tipo Noto Sans Arabic via system fallbacks */
html[lang="ar"] body,
html[lang="he"] body,
html[lang="fa"] body {
    font-family: "Noto Sans Arabic", "Geeza Pro", "Tahoma", "Arial", sans-serif;
}
html[lang="zh"] body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; }
html[lang="ja"] body { font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif; }
html[lang="ko"] body { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
