/* ==========================================================================
   RTL + BILINGUAL SUPPORT LAYER
   ==========================================================================
   Rules:
   1. Nothing in this file touches default (LTR/English) rendering.
      Every rule here is scoped under [dir="rtl"] or applies only to markup
      that didn't exist before (the language switcher), so main.css and the
      existing English design are 100% unchanged.
   2. Most of the site needs zero overrides: flexbox/grid layouts already
      mirror correctly under dir="rtl" natively. The rules below only cover
      the handful of *physical* (left/right) properties in main.css that
      don't auto-flip with direction.
   ========================================================================== */

/* Persian (Farsi) webfont — Latin fonts in main.css don't cover Farsi
   glyphs at all, so a matching font is required for the page to render
   readable text in that language. Only loads/applies under dir="rtl". */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] button {
  font-family: 'Vazirmatn', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .display {
  font-family: 'Vazirmatn', Georgia, serif;
  font-weight: 700;
}

html[dir="rtl"] .eyebrow,
html[dir="rtl"] .brand small,
html[dir="rtl"] .cat,
html[dir="rtl"] .total-label,
html[dir="rtl"] .footer-col h4,
html[dir="rtl"] .stock-flag,
html[dir="rtl"] .status-pill,
html[dir="rtl"] .order-card .order-id,
html[dir="rtl"] .cart-table th {
  font-family: 'Vazirmatn', monospace;
  /* wide tracking + uppercase were tuned for Latin letterforms only */
  letter-spacing: normal;
  text-transform: none;
}

/* ---------- directional glyphs (arrows) ---------- */
/* Wrap any hard-coded left/right arrow in <span class="rtl-flip">…</span>;
   mirroring it only under RTL keeps LTR pixel-identical. */
html[dir="rtl"] .rtl-flip {
  display: inline-block;
  transform: scaleX(-1);
}

/* ---------- language switcher + cart group (new markup, not present before) ---------- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.lang-switch button {
  opacity: .78;
}

.lang-switch button.is-active-lang {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .nav-right {
    gap: 10px;
  }
}

/* ---------- physical-property fixes (main.css uses left/right here) ---------- */

html[dir="rtl"] .stock-flag {
  left: auto;
  right: 13px;
}

html[dir="rtl"] .cart-table th {
  text-align: right;
}

html[dir="rtl"] .page-head::after {
  left: auto;
  right: 0;
  background: linear-gradient(90deg, var(--amber), var(--rose));
}

/* Stone-properties drawer: slides in from the trailing edge, which is the
   left in RTL rather than the right. */
html[dir="rtl"] .facet-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 45px rgba(57, 43, 38, .13);
  transform: translateX(-100%);
}

html[dir="rtl"] .facet-drawer.is-open {
  transform: translateX(0);
}

html[dir="rtl"] .facet-drawer-head {
  /* mirror of: polygon(0 0, 100% 0, 100% 90%, 94% 100%, 0 100%) */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 6% 100%, 0 90%);
}

html[dir="rtl"] .facet-drawer-close {
  right: auto;
  left: 20px;
}
