/* Multilingual storefront: fonts per language, LTR icon mirroring, language switcher */

html:not([lang="fa"]) {
  --font-fa: "Vazirmatn", Tahoma, sans-serif;
  --fluent-font: "Vazirmatn", Tahoma, sans-serif;
}

html[lang="en"] {
  --font-fa: "Vazirmatn", "Segoe UI", Roboto, Arial, sans-serif;
  --fluent-font: "Vazirmatn", "Segoe UI", Roboto, Arial, sans-serif;
}

/* Directional glyphs are drawn for RTL; flip them on LTR pages (owl nav text is already direction-aware) */
html[dir="ltr"] .mdi-chevron-left,
html[dir="ltr"] .mdi-chevron-right,
html[dir="ltr"] .mdi-arrow-left,
html[dir="ltr"] .mdi-arrow-right,
html[dir="ltr"] .fa-angle-left,
html[dir="ltr"] .fa-angle-right {
  display: inline-block;
  transform: scaleX(-1);
}

html[dir="ltr"] .owl-nav .fa {
  transform: none;
}

/* Language switcher (header) */
body.store-fluent .store-header .store-lang {
  position: relative !important;
  display: inline-flex !important;
  align-items: center;
}

body.store-fluent .store-header .store-action--lang {
  width: auto !important;
  min-width: 44px !important;
  padding: 0 0.6rem !important;
  gap: 0.3rem;
  background: rgba(92, 46, 145, 0.1) !important;
  border-color: rgba(92, 46, 145, 0.2) !important;
  color: #5C2E91 !important;
}

body.store-fluent .store-header .store-action--lang:hover {
  background: rgba(92, 46, 145, 0.16) !important;
  border-color: rgba(92, 46, 145, 0.32) !important;
}

body.store-fluent .store-header .store-action--lang .store-action-glyph {
  width: auto;
}

body.store-fluent .store-header .store-action--lang .store-action-glyph > .mdi {
  color: #5C2E91 !important;
  font-size: 1.25rem !important;
}

body.store-fluent .store-header .store-lang-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  direction: ltr;
}

body.store-fluent .store-header .store-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 160px;
  padding: 0.35rem;
  margin: 0;
  background: #fff;
  border: 1px solid #E1DFDD;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  z-index: 1500;
}

body.store-fluent .store-header .store-lang-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  inset-inline: 0;
  height: 10px;
}

body.store-fluent .store-header .store-lang.is-open .store-lang-menu,
body.store-fluent .store-header .store-lang:focus-within .store-lang-menu {
  display: block;
}

body.store-fluent .store-header .store-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: #323130 !important;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: background 140ms ease;
}

body.store-fluent .store-header .store-lang-item:hover,
body.store-fluent .store-header .store-lang-item:focus-visible {
  background: #F3F2F1;
}

body.store-fluent .store-header .store-lang-item.is-active {
  color: #5C2E91 !important;
  font-weight: 700;
  background: rgba(92, 46, 145, 0.08);
}

body.store-fluent .store-header .store-lang-item .mdi {
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  body.store-fluent .store-header .store-action--lang {
    padding: 0 0.45rem !important;
  }

  body.store-fluent .store-header .store-lang-code {
    display: none;
  }
}
