/* ACE Product Filters Persian RTL compatibility layer.
 * Scoped to ACE classes so WoodMart/Elementor controls remain untouched.
 */
.cpf-filter-panel,
.cpf-filter {
  direction: rtl;
  text-align: right;
  font-family: inherit;
  unicode-bidi: plaintext;
}

.cpf-filter-panel__content,
.cpf-filter__panel-body { direction: rtl; }

.cpf-filter__panel-heading,
.cpf-filter__panel-heading-row,
.cpf-filter__group-header,
.cpf-filter__choice,
.cpf-filter__button,
.cpf-filter__term-search,
.cpf-filter__term-search-row { text-align: right; }

.cpf-filter__panel-heading-row { flex-direction: row; }
.cpf-filter__panel-toggle { direction: ltr; }

/* Checkboxes/radios: label on the right, control on the right, count at the end. */
.cpf-filter__choice,
.cpf-filter__button {
  direction: rtl;
}

/* Price controls: Persian UI, numeric values stay LTR for correct editing and ranges. */
.cpf-filter--price,
.cpf-price-filter__header,
.cpf-price-filter__fields,
.cpf-price-filter__field { direction: rtl; }

.cpf-price-filter__title,
.cpf-price-filter__field-label { text-align: right; }

.cpf-price-filter__current,
.cpf-price-filter__number-input {
  direction: ltr;
  unicode-bidi: plaintext;
}

.cpf-price-filter__current { justify-content: center; }
.cpf-price-filter__separator { direction: ltr; }

/* Native range sliders are geometrically LTR; don't reverse the actual price scale. */
.cpf-price-filter__slider,
.cpf-price-filter__range-input { direction: ltr; }

.cpf-price-filter__fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpf-price-filter__field { align-items: stretch; }
.cpf-price-filter__number-input {
  text-align: right;
  width: 100%;
  min-width: 0;
}

.cpf-filter__term-search-input {
  direction: rtl;
  text-align: right;
  padding-right: 36px;
  padding-left: 12px;
}

.cpf-filter__term-search-clear {
  right: auto;
  left: 6px;
}

.cpf-filter-panel__toolbar { justify-content: flex-start; }
.cpf-filter-panel__clear { direction: rtl; }

.cpf-filter--swatches .cpf-filter__panel-body { direction: rtl; }

/* Prevent common WoodMart/Elementor rules from making the price inputs visually LTR/uneven. */
.cpf-filter input[type="number"] { box-sizing: border-box; }
.cpf-filter input[type="range"] { margin-inline: 0; }

@media (max-width: 767px) {
  .cpf-price-filter__fields { gap: 10px; }
  .cpf-price-filter__number-input { min-height: 44px; }
}
