/* ==========================================================================
   Dandy Rugs · RTL + Persian/Urdu typography
   Loaded ONLY on /fa/* and /ur/* pages (after style.css + pages.css).
   The base layout is flexbox/grid, so `direction:rtl` mirrors most of it;
   this file fixes the pieces that use explicit sides, transforms or italics.
   ========================================================================== */

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

/* --- localised type. The DANDY RUGS wordmark + numerals stay Latin. --- */
html[lang="fa"] {
  --font-body: "Vazirmatn", -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Vazirmatn", Georgia, serif;
}
html[lang="ur"] {
  --font-body: "Noto Nastaliq Urdu", "Vazirmatn", Tahoma, serif;
  --font-display: "Noto Nastaliq Urdu", "Vazirmatn", serif;
}
html[dir="rtl"] .nav-brand,
html[dir="rtl"] .footer-word,
html[dir="rtl"] .loader-word { font-family: "Italiana", serif; }
/* the Latin wordmark reads left-to-right even on RTL pages */
html[dir="rtl"] .nav-brand,
html[dir="rtl"] .footer-word,
html[dir="rtl"] .footer-signoff,
html[dir="rtl"] .loader-word { direction: ltr; }
html[dir="rtl"] .nav-brand small { font-family: var(--font-body); }
/* bidi-isolate Latin runs (phone numbers, @handles, sizes) inside RTL text */
html[dir="rtl"] .nav-call,
html[dir="rtl"] .visit-phone,
html[dir="rtl"] a[href^="tel:"] { unicode-bidi: plaintext; }

/* Arabic script has no italic — render the "italic accent" upright + coloured */
html[dir="rtl"] .serif-i { font-style: normal; font-family: var(--font-display); }
html[dir="rtl"] .col-eyebrow { font-style: normal; }

/* --- Urdu Nastaliq needs generous leading or descenders collide --- */
html[lang="ur"] { line-height: 2.05; }
html[lang="ur"] p, html[lang="ur"] .lead, html[lang="ur"] li { line-height: 2.15; }
html[lang="ur"] .d-hero, html[lang="ur"] .d-1, html[lang="ur"] .d-2, html[lang="ur"] .d-3 { line-height: 1.7; padding-bottom: 0.12em; }
html[lang="ur"] .nav-links a, html[lang="ur"] .kicker, html[lang="ur"] .pcard-name, html[lang="ur"] .btn { line-height: 1.9; }
html[lang="ur"] .col-name { line-height: 1.7; padding-bottom: 0.12em; }
html[lang="fa"] .d-hero, html[lang="fa"] .d-1, html[lang="fa"] .d-2, html[lang="fa"] .d-3 { line-height: 1.28; }
html[lang="fa"] .col-name { line-height: 1.32; }

/* --- flip directional arrows (→ points ← in RTL); NOT phone/WhatsApp/social --- */
html[dir="rtl"] .btn svg,
html[dir="rtl"] .pcard-go svg,
html[dir="rtl"] .car-btn svg,
html[dir="rtl"] .col-arrow,
html[dir="rtl"] .col-all svg,
html[dir="rtl"] .to-top svg { transform: scaleX(-1); }
html[dir="rtl"] .btn-wa svg,
html[dir="rtl"] .nav-call svg,
html[dir="rtl"] .call-fab svg,
html[dir="rtl"] .wa-fab svg,
html[dir="rtl"] .footer-ig svg,
html[dir="rtl"] .nav-chev,
html[dir="rtl"] .to-top svg { transform: none; }
html[dir="rtl"] .to-top svg { transform: none; } /* up-arrow: leave */

/* --- pieces that used explicit left/right --- */
html[dir="rtl"] .nav-links a::after { left: 18px; right: 18px; }
html[dir="rtl"] .nav-dropdown { left: auto; right: 0; }
html[dir="rtl"] .lang-switch { margin-left: 0; margin-right: 14px; }
html[dir="rtl"] .pdp-specs .row dd { text-align: left; }
html[dir="rtl"] .scale-note { right: auto; left: 14px; }
html[dir="rtl"] .room .rug-box span { border-radius: 0 3px 0 0; }
html[dir="rtl"] .crumbs { direction: rtl; }
html[dir="rtl"] .marquee-track { direction: ltr; } /* keep the decorative strip stable */

/* horizontal carousels start from the right */
html[dir="rtl"] .car-track,
html[dir="rtl"] .shop-filters { direction: rtl; }

/* the switcher's own labels always read in their own script */
.lang-switch button[lang="fa"] { font-family: "Vazirmatn", Tahoma, sans-serif; }
.lang-switch button[lang="ur"] { font-family: "Noto Nastaliq Urdu", Tahoma, serif; }
