/* Smart Multilingual — Woodmart compatibility (layout-safe)
 * Persian text is RTL, while the structural page geometry remains in the
 * source/LTR direction so Woodmart section-stretch and Elementor positioning
 * calculations are not mirrored. */

html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl{
	direction:rtl!important;
}

/* CRITICAL: keep layout roots LTR. Woodmart uses direction-sensitive logical
 * positioning for stretched sections and container geometry. */
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(
	.main-page-wrapper,
	.site-content,
	.wd-content-layout,
	.wd-page-content,
	.entry-content,
	.woocommerce,
	.woocommerce-page,
	.wd-builder-off,
	.elementor
){
	direction:ltr!important;
}

/* Elementor text widgets explicitly marked by SML are RTL. */
html[dir="rtl"] body.sml-site-woodmart .sml-rtl-text-widget{
	direction:rtl!important;
}

html[dir="rtl"] body.sml-site-woodmart .sml-rtl-text-widget:not(.sml-preserve-center),
html[dir="rtl"] body.sml-site-woodmart .sml-rtl-text-widget:not(.sml-preserve-center) > .elementor-widget-container,
html[dir="rtl"] body.sml-site-woodmart .sml-rtl-text-widget:not(.sml-preserve-center) :is(
	.elementor-heading-title,
	.elementor-text-editor,
	.elementor-button-wrapper,
	.elementor-button-text,
	.elementor-icon-list-text,
	.elementor-image-box-content,
	.elementor-icon-box-content,
	.elementor-tab-content,
	.elementor-tab-title,
	.elementor-toggle-content,
	.elementor-toggle-title,
	.elementor-post__text,
	.elementor-post__title,
	.elementor-post__excerpt
){
	direction:rtl!important;
	text-align:justify!important;
}

html[dir="rtl"] body.sml-site-woodmart .sml-preserve-center,
html[dir="rtl"] body.sml-site-woodmart .sml-preserve-center > .elementor-widget-container,
html[dir="rtl"] body.sml-site-woodmart .sml-preserve-center :is(
	.elementor-heading-title,
	.elementor-button-wrapper,
	.elementor-button-text,
	.elementor-icon-list-text,
	.elementor-image-box-content,
	.elementor-icon-box-content
){
	direction:rtl!important;
	text-align:center!important;
}

/* Native Woodmart text surfaces. */
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(
	.wd-title,
	.wd-entities-title,
	.widget-title,
	.product_title,
	.wd-entry-content,
	.woocommerce-product-details__short-description,
	.woocommerce-tabs .wc-tab,
	.wd-checkout-steps,
	.wd-my-account-sidebar,
	.wd-my-account-links,
	.wd-shop-tools,
	.wd-loop-header,
	.wd-page-title
){
	direction:rtl!important;
	text-align:right;
}

/* Forms/search — keep controls usable and placeholders readable. */
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(
	input:not([type="checkbox"]):not([type="radio"]),
	textarea,
	select
){
	direction:rtl;
	text-align:right;
}
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(input,textarea)::placeholder{
	direction:rtl;
	text-align:right;
}

/* Breadcrumbs and common inline metadata. */
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(
	.woocommerce-breadcrumb,
	.breadcrumbs,
	.yoast-breadcrumb,
	.wd-breadcrumbs,
	.entry-meta,
	.product_meta
){
	direction:rtl!important;
	text-align:right!important;
}

/* Menus remain RTL-readable without changing the page-layout roots. */
html[dir="rtl"] body.sml-site-woodmart.sml-dir-rtl :is(
	.wd-nav,
	.wd-nav > li > a,
	.menu,
	.menu > li > a,
	.mobile-nav,
	.wd-dropdown-menu
){
	direction:rtl;
}

/* Explicit author controls. */
html[dir="rtl"] body.sml-site-woodmart .sml-rtl-row-reverse{
	flex-direction:row-reverse!important;
}
html[dir="rtl"] body.sml-site-woodmart .sml-keep-layout,
html[dir="rtl"] body.sml-site-woodmart .sml-keep-direction{
	direction:inherit!important;
}
