/* Additional Persian refinements. Native WoodMart RTL files own the layout. */
html:lang(fa) body.wd-fa {
  --wd-text-line-height: 1.85;
}

html:lang(fa) :is(.wd-entities-title, .entry-title, .product_title, .woocommerce-notices-wrapper, .woocommerce-error, .woocommerce-message, .wd-breadcrumbs, .breadcrumbs) {
  overflow-wrap: break-word;
  word-break: normal;
}

html:lang(fa) :is(.wd-nav-link, .wd-entities-title, .product_title, .entry-title, .woocommerce-form, .wd-search-form) {
  letter-spacing: normal;
}

/* Keep machine-oriented fields readable without changing the RTL form layout. */
html:lang(fa) input:is([type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [name="billing_phone"], [name="shipping_phone"], [name="billing_postcode"], [name="shipping_postcode"]) {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

html:lang(fa) input:is([type="email"], [type="tel"], [type="url"], [type="password"])::placeholder {
  direction: rtl;
  text-align: right;
}

html:lang(fa) .quantity input.qty {
  direction: ltr;
  text-align: center;
}

html:lang(fa) :is(.sku, .wd-fa-ltr) {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
}

html:lang(fa) :is(pre, code, kbd, samp) {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

html:lang(fa) .woocommerce-Price-amount {
  unicode-bidi: isolate;
  white-space: nowrap;
}

html:lang(fa) :is(.woocommerce-Price-amount, .wd-entities-title) bdi {
  unicode-bidi: isolate;
}

/* The upstream desktop cart floats shipping radios left even in its RTL file. */
html:lang(fa) body.rtl .woocommerce-shipping-methods input.shipping_method {
  float: right;
  margin-inline: 0 7px;
}

html:lang(fa) .select2-container {
  direction: rtl;
}

html:lang(fa) .select2-search__field {
  text-align: start;
}

html:lang(fa) .wd-timer-value {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

/* Persian labels need room for joined glyphs and taller ascenders. */
html:lang(fa) .wd-toolbar-label {
  inset-inline: 3px;
  font-size: 10.5px;
  line-height: 1.4;
}

@media (max-width: 359px) {
  html:lang(fa) .wd-toolbar-label {
    font-size: 10px;
  }
}

html:lang(fa) .woocommerce-order-overview :is(.email, .order) strong {
  display: inline-block;
  unicode-bidi: isolate;
}
