/* Custom price range layout – tuned for "min تا max تومان"
 *
 * Desktop (>=900px):
 *   320/000 تا 1/980/000 تومان   (all in one line, with spaces)
 *
 * Mobile (<900px):
 *   320/000 تا
 *   1/980/000 تومان
 */

/* Base: allow wrapping inside price cells and strip theme "badge" look */
.rtbl .price-badge,
.rtbl .price,
.rtbl span.price-text {
  white-space: normal !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Make sure custom price cells can wrap if any nowrap leaked in */
table td.mtbl-price-cell,
table th.mtbl-price-cell {
  white-space: normal !important;
}

/* Base layout for all mtbl-price-range elements */
table .mtbl-price-range {
  display: inline-block !important;
  direction: rtl !important;
  white-space: normal !important;
  font-variant-numeric: tabular-nums;
}

/* Reset inner pieces to inline and zero margins by default */
table .mtbl-price-range .min,
table .mtbl-price-range .sep,
table .mtbl-price-range .max,
table .mtbl-price-range .currency {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.6 !important;
}

/* Mild styling for the separator on all viewports */
table .mtbl-price-range .sep {
  margin: 0 0.25em !important;
}

/* Mild spacing for the currency token */
table .mtbl-price-range .currency {
  margin-right: 0.25em !important;
  margin-left: 0.25em !important;
}

/* =======================
 * Desktop (>= 900px)
 * =======================
 * Everything in one line:
 *   320/000 تا 1/980/000 تومان
 */
@media (min-width: 900px) {
  table .mtbl-price-range.mtbl-price-range-toman {
    white-space: nowrap !important;
  }
}

/* =======================
 * Mobile (< 900px)
 * =======================
 * Two-line layout:
 *   320/000 تا
 *   1/980/000 تومان
 */
@media (max-width: 899.98px) {
  /* Mobile: stack each part vertically ONLY inside rotated 3×5 comparison tables
   * 705/000
   * تا
   * 1/320/000
   * تومان
   */
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman {
    white-space: normal !important;
    text-align: center !important;
  }

  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .min,
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .sep,
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .max,
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .currency {
    display: block !important;
  }

  /* Smaller numbers in narrow columns */
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .min,
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .max {
    font-size: 0.56rem !important;
    line-height: 1.25 !important;
  }

  /* Even smaller for "تا" and "تومان" */
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .sep,
  table.mtable[data-mt-rotated="1"] .mtbl-price-range.mtbl-price-range-toman .currency {
    font-size: 0.56rem !important;
    line-height: 1.2 !important;
  }
}
