/* MELQ — select + advanced filter refinements.
   Loaded after the original template styles so LTR keeps the original look
   while RTL only mirrors direction-sensitive behavior. */

/* Native selects keep their original visual styling, but text follows document direction. */
select {
  font: inherit;
}

html[dir="rtl"] select,
html[dir="rtl"] select option {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] select {
  text-align-last: right;
}

/* Nice Select — global RTL geometry. Section-specific dimensions remain untouched. */
html[dir="rtl"] .nice-select {
  direction: rtl;
  text-align: right !important;
}

html[dir="rtl"] .nice-select .current {
  display: block;
  direction: rtl;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[dir="rtl"] .nice-select::after {
  right: auto !important;
  left: 12px;
  transform-origin: 34% 66%;
}

html[dir="rtl"] .nice-select .list {
  right: 0 !important;
  left: auto !important;
  direction: rtl;
  text-align: right;
  transform-origin: 100% 0;
}

html[dir="rtl"] .nice-select.wide .list {
  right: 0 !important;
  left: 0 !important;
}

html[dir="rtl"] .nice-select .option {
  direction: rtl;
  text-align: right;
  padding-right: 18px;
  padding-left: 29px;
}

/* Preserve the template's bespoke arrow spacing where it used larger insets. */
html[dir="rtl"] .search-box-cover .property-tab-section .nice-select::after,
html[dir="rtl"] .others-section-area .property-tab-section .nice-select::after,
html[dir="rtl"] .s-properties4 .s-porpeties-video .property-tab-section .nice-select::after {
  left: 24px;
}

html[dir="rtl"] .search-box-cover .wd-search-form .group-select .nice-select::after,
html[dir="rtl"] .others-section-area .wd-search-form .group-select .nice-select::after,
html[dir="rtl"] .s-properties4 .s-porpeties-video .wd-search-form .group-select .nice-select::after,
html[dir="rtl"] .property-half-grid-area .sidebar1-area .input-area .nice-select::after,
html[dir="rtl"] .property-inner-section-find .sidebar1-area .input-area .nice-select::after {
  left: 16px;
}

/* The custom list must sit above neighboring filter controls. */
.nice-select.open {
  z-index: 40;
}

.nice-select.open .list {
  z-index: 60;
}

/* Advanced filter: same geometry as the template, with reliable clickability in both directions. */
.others-section-area .wd-search-form,
.search-box-cover .wd-search-form,
.s-properties4 .s-porpeties-video .wd-search-form {
  pointer-events: none;
}

.others-section-area .wd-search-form.show-box,
.search-box-cover .wd-search-form.show-box,
.s-properties4 .s-porpeties-video .wd-search-form.show-box {
  pointer-events: auto;
  z-index: 30;
}

html[dir="rtl"] .others-section-area .wd-search-form.show-box,
html[dir="rtl"] .search-box-cover .wd-search-form.show-box,
html[dir="rtl"] .s-properties4 .s-porpeties-video .wd-search-form.show-box {
  opacity: 1;
  visibility: visible;
  margin-top: 0;
}

html[dir="rtl"] .property-tab-section .filter-group button.customize-sale {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .property-tab-section .filter-group button.customize-sale .icon {
  margin-left: 0;
  margin-right: 5px;
}

/* Keep numeric option values visually stable inside RTL menus. */
html[dir="rtl"] .nice-select .option[data-value] {
  unicode-bidi: plaintext;
}
