/**
 * JetSmartFilters — RTL overrides
 * Loaded only when is_rtl() is true.
 */

/* -------------------------------------------------------------------------
 * Frontend filters
 * ---------------------------------------------------------------------- */

.rtl .jet-smart-filters-search .jet-search-filter .jet-filter-label {
	text-align: right;
}

.rtl .jet-checkboxes-list .jet-checkboxes-list__item .jet-checkboxes-list__decorator,
.rtl .jet-radio-list .jet-radio-list__item .jet-radio-list__decorator {
	margin-right: 0;
	margin-left: 5px;
}

.rtl .jet-list-collapsible .jet-collapse-icon,
.rtl .jet-list-collapsible .jet-collapse-none {
	margin-right: 0;
	margin-left: 5px;
}

.rtl .jet-list-tree__children {
	padding-left: 0;
	padding-right: 10px;
}

.rtl .jet-filter-items-dropdown__label {
	padding: 8px 12px 8px 20px;
}

.rtl .jet-filter-items-dropdown__label:after {
	right: auto;
	left: 5px;
}

.rtl .jet-filter-items-dropdown__active__item__remove {
	margin-left: 0;
	margin-right: 5px;
}

.rtl .jet-filter-items-dropdown__footer {
	justify-content: left;
}

.rtl .jet-smart-filters-active .jet-active-filters__title,
.rtl .jet-smart-filters-active-tags .jet-active-tags__title {
	margin-right: 0;
	margin-left: 5px;
}

.rtl .jet-smart-filters-active .jet-active-filter,
.rtl .jet-smart-filters-active-tags .jet-active-tag {
	padding-right: 0;
	padding-left: 10px;
}

.rtl .jet-smart-filters-active .jet-active-filter__label,
.rtl .jet-smart-filters-active-tags .jet-active-tag__label {
	padding-right: 0;
	padding-left: 3px;
}

.rtl .jet-smart-filters-active .jet-active-filter__remove,
.rtl .jet-smart-filters-active-tags .jet-active-tag__remove {
	right: auto;
	left: 0;
}

.rtl .jet-date-period__prev {
	margin-right: 0;
	margin-left: 5px;
}

.rtl .jet-date-period__next {
	margin-left: 0;
	margin-right: 5px;
}

.rtl .apply-filters .apply-filters__button,
.rtl .jet-remove-all-filters .jet-remove-all-filters__button {
	align-self: flex-end;
}

/* -------------------------------------------------------------------------
 * Admin — Listing Builder / DataViews
 * ---------------------------------------------------------------------- */

.rtl .jsf-listings-list__add-new-button,
.rtl .jsf-items-list__add-new-button {
	margin-left: 0;
	margin-right: 40px;
}

.rtl .jsf-listings-header__right .jsf-back-to-listing-btn {
	margin-left: 0;
	margin-right: 30px;
}

/* Keep actions on the opposite side of the Add button (mirror of LTR flex-end). */
.rtl .jsf-listings-list .dataviews__view-actions,
.rtl .jsf-items-list .dataviews__view-actions {
	justify-content: flex-end;
}

.rtl .jsf-listings-list .dataviews-search,
.rtl .jsf-items-list .dataviews-search {
	position: relative;
	z-index: 2;
}

.rtl .dataviews-view-table th {
	text-align: right;
}

.rtl .dataviews-view-table td.dataviews-view-table__actions-column,
.rtl .dataviews-view-table th.dataviews-view-table__actions-column {
	text-align: left;
}

.rtl .dataviews-filters__summary-chip.has-reset {
	padding-inline-end: 12px;
	padding-inline-start: 28px;
}

.rtl .dataviews-filters__summary-chip-remove {
	left: auto;
	right: 4px;
}

.rtl .dataviews-filters__search-widget-filter-combobox__input {
	padding: 0 32px 0 8px;
}

.rtl .dataviews-filters__search-widget-filter-combobox__icon {
	left: auto;
	right: 12px;
}

.rtl .dataviews-filters-toggle__count {
	transform: translate(50%, -50%);
}

/* View options (gear) popover — open away from the admin menu in RTL */
.rtl .dataviews-config__popover.components-popover {
	z-index: 100000;
}

.rtl .dataviews-bulk-actions-footer__container {
	margin-left: 0;
	margin-right: auto;
}

/* Default block appender "+" — keep on the visual left in RTL.
 * Core uses `right: 0`; RTLCSS / focus states flip inconsistently and the
 * button lands on the right over Persian placeholder text. */
.rtl .jsf-editor .block-editor-default-block-appender {
	position: relative;
}

.rtl .jsf-editor .block-editor-default-block-appender .block-editor-inserter,
.rtl .jsf-editor .block-editor-block-list__empty-block-inserter {
	right: auto !important;
	left: 0 !important;
}

.rtl .jsf-editor .block-editor-default-block-appender__content {
	padding-left: 48px;
	padding-right: 14px;
	text-align: right;
}

.rtl .jsf-editor__sidebar {
	border-right: none;
	border-left: 1px solid #ddd;
}

.rtl .jsf-editor__left-sidebar {
	border-left: none;
	border-right: 1px solid #ddd;
}

.rtl .jsf-editor__sidebar__close {
	margin-left: 0;
	margin-right: 8px;
}

/* PanelBody accordion chevrons — keep on the visual left in RTL so they
 * don't sit on Persian titles like «پیشرفته». */
.rtl .jsf-editor .components-panel__body-title.components-button,
.rtl .jsf-editor .components-panel__body > h2 > .components-button {
	padding-left: 48px;
	padding-right: 16px;
}

.rtl .jsf-editor .components-panel__body .components-button .components-panel__arrow {
	right: auto !important;
	left: 14px !important;
}

.rtl .jsf-editor__left-sidebar__header {
	padding: 7px 10px 7px 20px;
}

.rtl .jsf-control-number .components-input-control__suffix {
	margin: 0 8px 0 0;
}

.rtl .jsf-repeater__item__header,
.rtl .jsf-sortable-repeater__item__header {
	padding-left: 0;
	padding-right: 5px;
}

.rtl .jsf-repeater__item__header {
	padding-right: 0;
	padding-left: 10px;
}

.rtl .dataforms-layouts-panel__field-control .components-button {
	text-align: right;
}

/* -------------------------------------------------------------------------
 * More
 * ---------------------------------------------------------------------- */
.jet-ui_number input.jet-ui_number-input {
	border-color: #e7e7e7;
}

.jet-ui_switcher-panel {
	background: #dbdbdb;
}

.jet-ui_switcher-trigger {
	box-shadow: 0 1px 4px rgba(35,40,45,.4);
  }

/* Input borders — stickier than bundled jet-ui defaults */
#jet-smart-filters-admin-app .jet-ui_advanced-input input.jet-ui_advanced-input-text,
#jet-smart-filters-admin-app .jet-ui_colorpicker,
#jet-smart-filters-admin-app .jet-ui_number input.jet-ui_number-input,
#jet-smart-filters-admin-app .jet-ui_select-panel,
#jet-smart-filters-admin-app .jet-ui_textarea textarea.jet-ui_textarea-input,
#jet-smart-filters-admin-app input.jet-ui_text-input,
#jet-smart-filters-admin-app .jet-ui_text input {
	border: 2px solid #e7e7e7 !important;
}

/* Listing builder block alignment (margin:0 override) */
.rtl .jsf-editor .wp-block[data-align="center"],
.rtl .jsf-editor .wp-block.aligncenter {
	margin-left: auto !important;
	margin-right: auto !important;
	text-align: center !important;
}
.rtl .jsf-editor .has-text-align-center {
	text-align: center !important;
}
.rtl .jsf-editor .wp-block[data-align="center"] .components-placeholder,
.rtl .jsf-editor .wp-block.aligncenter .components-placeholder {
	margin-left: auto;
	margin-right: auto;
	text-align: center !important;
}

/* Keep move-up above move-down in listing field controls (avoid RTL row reverse confusion). */
.rtl .dataviews-field-control__actions {
	flex-direction: column !important;
}
