/* Farnaam × Parchin | Price display | v1.0.6
 * Each of the two price types has its own column: label above amount.
 * Archive product cards can be narrow on mobile, so typography scales gently.
 * Pure presentation: WooCommerce basket, currency and XLSX logic untouched.
 */
.fpm-price-table {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  margin: 10px 0 12px;
  padding: 0 !important;
  border: 1px solid #d9e9df !important;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  direction: rtl;
  color: #234034;
  font-family: inherit;
  text-align: center !important;
  clear: both;
  container-type: inline-size;
}
.fpm-price-table, .fpm-price-table * { box-sizing: border-box; }
.fpm-price-table > .fpm-price-row {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100%;
  height: 100%;
  padding: 12px 7px !important;
  margin: 0 !important;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 0 !important;
  text-align: center !important;
  background: #fff;
  line-height: 1.65;
}
.fpm-price-table > .fpm-price-row.fpm-price-secondary {
  background: #f4faf6 !important;
  border-inline-start: 1px solid #dfece4 !important;
}
.fpm-price-table > .fpm-price-row:first-child:last-child {
  grid-column: 1 / -1;
}
.fpm-price-table > .fpm-price-row > span {
  display: block !important;
  width: 100% !important;
  min-width: 0;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
  color: #52685b !important;
  direction: rtl;
  text-align: center !important;
  white-space: normal;
}
.fpm-price-table > .fpm-price-row > strong {
  display: block !important;
  width: 100% !important;
  min-width: 0;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  color: #009b56 !important;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
.fpm-price-table > .fpm-price-row.fpm-price-secondary > strong {
  color: #306451 !important;
}
.fpm-price-table .amount,
.fpm-price-table .woocommerce-Price-amount,
.fpm-price-table .woocommerce-Price-amount bdi {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  white-space: normal !important;
}
.fpm-price-table .woocommerce-Price-currencySymbol { font-size: .85em !important; }
.fpm-price-table del { opacity: .52; font-size: .88em; margin-inline: 4px; }
.fpm-price-table ins { text-decoration: none; background: transparent; }
.fpm-price-table .fpm-pick { font-size: 12px; color: #799185; font-weight: 400; }
/* WooCommerce / Woodmart archive cards: keep the two-column grid, increase legibility. */
.woocommerce ul.products li.product .fpm-price-table,
.wd-products .product-grid-item .fpm-price-table {
  margin: 10px 0 8px !important;
}
.woocommerce ul.products li.product .fpm-price-table > .fpm-price-row,
.wd-products .product-grid-item .fpm-price-table > .fpm-price-row {
  padding: 11px 5px !important;
  gap: 6px !important;
}
.woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > span,
.wd-products .product-grid-item .fpm-price-table > .fpm-price-row > span {
  font-size: 12.5px !important;
}
.woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > strong,
.wd-products .product-grid-item .fpm-price-table > .fpm-price-row > strong {
  font-size: 14px !important;
}
/* Narrow cards: avoid numerical overflow without collapsing the columns. */
@container (max-width: 235px) {
  .fpm-price-table > .fpm-price-row,
  .woocommerce ul.products li.product .fpm-price-table > .fpm-price-row,
  .wd-products .product-grid-item .fpm-price-table > .fpm-price-row { padding-inline: 3px !important; }
  .fpm-price-table > .fpm-price-row > span,
  .woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > span,
  .wd-products .product-grid-item .fpm-price-table > .fpm-price-row > span { font-size: 11.5px !important; }
  .fpm-price-table > .fpm-price-row > strong,
  .woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > strong,
  .wd-products .product-grid-item .fpm-price-table > .fpm-price-row > strong { font-size: 12.5px !important; }
}
@container (max-width: 170px) {
  .fpm-price-table > .fpm-price-row > span,
  .woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > span,
  .wd-products .product-grid-item .fpm-price-table > .fpm-price-row > span { font-size: 10.5px !important; }
  .fpm-price-table > .fpm-price-row > strong,
  .woocommerce ul.products li.product .fpm-price-table > .fpm-price-row > strong,
  .wd-products .product-grid-item .fpm-price-table > .fpm-price-row > strong { font-size: 11px !important; }
}
/* Archive thickness: SHERA green, slightly larger than before. */
.wd-products .wd-entities-title .fpm-product-thickness,
.wd-products .wd-product-title .fpm-product-thickness,
.woocommerce ul.products li.product .fpm-product-thickness,
.product-grid-item .fpm-product-thickness {
  color: #00a651 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.8;
}
/* Keep existing single product tag break and variation-price hiding behavior. */
.single-product .product_meta .tagged_as a .fpm-tag-break,
.single-product .tagged_as a .fpm-tag-break { display: block !important; }
.single-product .tagged_as a .fpm-tag-thickness { display: inline-block; margin-top: 2px; color: #079b55; font-weight: 600; }
.single-product .summary.fpm-variation-active .woocommerce-variation-price { display: none !important; }

/* v1.0.5 — clearer divider between the two information-only price columns.
   In RTL, the primary unit is on the right and the square-meter unit on the left. */
.fpm-price-table > .fpm-price-row.fpm-price-secondary {
  border-inline-start: 2px solid #badbc8 !important;
}
/* WooCommerce may place currency before or after digits according to store settings.
   Reorder only inside Farnaam price boxes so the currency follows the number
   in Persian reading order (number at right, currency label at left).
   Leave core currency configuration and cart/checkout untouched. */
.fpm-price-table .woocommerce-Price-amount bdi {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 4px !important;
  direction: rtl !important;
  unicode-bidi: isolate !important;
  white-space: nowrap !important;
  vertical-align: baseline;
}
.fpm-price-table .woocommerce-Price-amount bdi > .woocommerce-Price-currencySymbol {
  order: -1 !important;
  direction: ltr !important;
  unicode-bidi: isolate !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* v1.0.6 — a COMPLETE '+' divider on two-price tables only.
   Draw both arms in one coordinate space, instead of separate item borders:
   this prevents the middle vertical stroke from stopping at the row break.
   Also works in Woodmart archive cards, single products, and variations. */
.fpm-price-table.fpm-price-table--cross {
  position: relative !important;
  isolation: isolate;
}
.fpm-price-table.fpm-price-table--cross > .fpm-price-row.fpm-price-secondary {
  border-inline-start: 0 !important;
}
.fpm-price-table.fpm-price-table--cross::before,
.fpm-price-table.fpm-price-table--cross::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  z-index: 5;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #badbc8 !important;
}
/* Vertical arm: full height, separating unit and square-meter prices. */
.fpm-price-table.fpm-price-table--cross::before {
  inset-block: 0 !important;
  inset-inline-start: calc(50% - 0.75px) !important;
  width: 1.5px !important;
  height: 100% !important;
}
/* Horizontal arm: full width, between the labels and the price amounts. */
.fpm-price-table.fpm-price-table--cross::after {
  inset-inline: 0 !important;
  top: calc(50% - 0.5px) !important;
  width: 100% !important;
  height: 1px !important;
}

/* v1.0.8 — Rial in Latin letters on the visually right side of the price.
   Flex order -1 places the currency at the RTL start edge, before the digits.
   This is scoped only to Farnaam display boxes and does not change checkout. */
.fpm-price-table .woocommerce-Price-amount bdi > .woocommerce-Price-currencySymbol {
  order: -1 !important;
  direction: ltr !important;
}

/* v1.0.9 - keep English Rial to the visual RIGHT of its amount also in
   Woodmart single product price blocks. Archive and checkout remain unaffected. */
.fpm-price-table .woocommerce-Price-amount bdi > span.woocommerce-Price-currencySymbol {
  order: -1 !important;
  direction: ltr !important;
  unicode-bidi: isolate !important;
  white-space: nowrap !important;
}

/* v1.0.10 | Global storefront visual price switch. Cart/checkout numbers remain valid. */
.fpm-prices-hidden .fpm-price-table,
.fpm-prices-hidden .woocommerce ul.products li.product .price,
.fpm-prices-hidden .wd-products .price,
.fpm-prices-hidden .product-grid-item .price,
.fpm-prices-hidden.single-product .summary > .price,
.fpm-prices-hidden.single-product .summary .woocommerce-variation-price,
.fpm-prices-hidden.single-product .summary .wd-single-price { display:none!important; }

/* v1.0.14 | Per-product note (third full-width rectangle).
   This sits OUTSIDE the + price grid, preserving both intersecting lines. */
.fpm-price-with-note {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  margin: 10px 0 12px !important;
  padding: 0 !important;
  text-align: center !important;
  clear: both;
}
.fpm-price-with-note > .fpm-price-table {
  margin: 0 !important;
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 0 !important;
}
.fpm-price-with-note > .fpm-product-note {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 9px !important;
  margin: 0 !important;
  border: 1px solid #d9e9df !important;
  border-top: 1px solid #badbc8 !important;
  border-radius: 0 0 12px 12px !important;
  background: #f1faf4 !important;
  color: #167449 !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1.9 !important;
  text-align: center !important;
  overflow-wrap: anywhere;
  white-space: normal;
  unicode-bidi: plaintext;
}
/* Archive cards are narrower than single-product columns. */
.woocommerce ul.products li.product .fpm-price-with-note,
.wd-products .product-grid-item .fpm-price-with-note { margin: 10px 0 8px !important; }
.woocommerce ul.products li.product .fpm-price-with-note > .fpm-product-note,
.wd-products .product-grid-item .fpm-price-with-note > .fpm-product-note {
  font-size: 12.5px !important;
  padding: 9px 5px !important;
}
/* The global storefront hide-prices switch retains its existing semantics. */
.fpm-prices-hidden .fpm-price-with-note { display:none!important; }
