/* Woodmart 9.6.0 Lite: targeted compatibility improvements. */
/* The shop archive already renders WooCommerce prices correctly. The customized
   single-product cards use their own LTR flex parent and RTL child overrides.
   Respect WooCommerce's position setting but normalize the two visual items
   inside the price <bdi> to a stable left-currency/right-number layout.

   WooCommerce left_space:  <span currency> تومان </span> NBSP number
   WooCommerce right_space: number NBSP <span currency> تومان </span>

   Constrain to actual product details/sticky bars only, never shop loops,
   cart/checkout, or currency-switcher internals. No DOM/amount manipulation. */
html[dir="rtl"] body.single-product:is(.wd-soma-irt-left-space,.wd-soma-irt-right-space)
  :is(.wd-soma-product-page,.summary-inner,.wd-sticky-btn,.wd-soma-mobile-sticky-action)
  .woocommerce-Price-amount > bdi:has(> .woocommerce-Price-currencySymbol) {
  display: inline-flex !important;
  align-items: baseline;
  justify-content: flex-start;
  direction: ltr !important;
  unicode-bidi: isolate;
  white-space: nowrap;
  gap: 0;
}
/* "Left, with a space" is the value selected in WooCommerce on the live site. */
html[dir="rtl"] body.single-product.wd-soma-irt-left-space
  :is(.wd-soma-product-page,.summary-inner,.wd-sticky-btn,.wd-soma-mobile-sticky-action)
  .woocommerce-Price-amount > bdi:has(> .woocommerce-Price-currencySymbol) {
  flex-direction: row !important;
}
/* Maintain backward compatibility with previous "right_space" exports. */
html[dir="rtl"] body.single-product.wd-soma-irt-right-space
  :is(.wd-soma-product-page,.summary-inner,.wd-sticky-btn,.wd-soma-mobile-sticky-action)
  .woocommerce-Price-amount > bdi:has(> .woocommerce-Price-currencySymbol) {
  flex-direction: row-reverse !important;
}
/* Avoid creating a new stacking contest with dialogs. Actually lift the
   phone above the shown sticky purchase panel, based on its measured height. */
body.single-product .wd-soma-floating-phone {
  bottom: calc(var(--wd-soma-fab-bottom, 20px) + var(--wd-soma-sticky-clearance, 0px)) !important;
}
body.single-product.wd-soma-floating-above-sticky .wd-soma-floating-phone {
  z-index: 100210;
}
/* Respect the existing mobile toolbar spacing when there is no purchase bar. */
@media (max-width: 767px) {
  body.single-product.sticky-toolbar-on .wd-soma-floating-phone {
    bottom: calc(74px + var(--wd-soma-sticky-clearance, 0px)) !important;
  }
}
