/*
 * Bagery RTL compatibility improvements (October 2026)
 * Loaded only when WordPress is in an RTL language, AFTER theme styles.
 * Deliberately targeted: no global transform scaleX and no image mirroring.
 * Keeps the chosen original header; no need to switch to the 'RTL' demo header.
 */

/* The standard WordPress language_attributes() sets html[dir="rtl"] and
   body_class() adds .rtl. Both are scoped here for robust child layouts. */
html[dir="rtl"] body,
body.rtl .boxed_wrapper,
body.rtl .boxed_wrapper_2 {
    direction: rtl;
}

/* Regular text flows from the right, without overriding designer-centered
   headings, buttons, or Elementor widgets deliberately aligned centrally. */
body.rtl .post,
body.rtl .entry-content,
body.rtl .blog-sidebar,
body.rtl .shop-sidebar,
body.rtl .shop-page-section,
body.rtl .product-details-content,
body.rtl .product-sidebar,
body.rtl .comment-form,
body.rtl .woocommerce,
body.rtl .woocommerce-page,
body.rtl .woocommerce-account,
body.rtl .woocommerce-cart,
body.rtl .woocommerce-checkout {
    direction: rtl;
    text-align: right;
}

/* Header: mirror existing header variants rather than selecting a different
   template, which would otherwise change the site's design and menu setup. */
body.rtl .main-header.style-one .outer-box,
body.rtl .main-header.style-two .sticky-header .outer-box {
    direction: rtl;
}
body.rtl .main-menu .navigation > li {
    float: right;
}
body.rtl .main-menu .navigation > li.dropdown > a {
    padding-left: 19px;
    padding-right: 0;
}
body.rtl .main-menu .navigation > li.dropdown > a:before {
    left: 0;
    right: auto;
}
body.rtl .main-menu .navigation > li > ul,
body.rtl .main-menu .navigation > li > .megamenu {
    right: 0;
    left: auto;
    text-align: right;
}
body.rtl .main-menu .navigation > li > ul > li > ul {
    left: 100%;
    right: auto;
}
body.rtl .main-menu .navigation > li > ul > li > ul.from-right {
    left: auto;
    right: 100%;
}
body.rtl .main-menu .navigation > li > ul > li > a,
body.rtl .main-menu .navigation > li > ul > li > ul > li > a,
body.rtl .main-menu .navigation > li > .megamenu li > a {
    text-align: right;
}
body.rtl .main-menu .navigation > li > ul > li.dropdown > a:after {
    content: "\f104";
    right: auto;
    left: 20px;
}
body.rtl .main-header.style-one .menu-right-content li {
    float: right;
    margin-right: 0;
    margin-left: 10px;
}
body.rtl .main-header.style-one .menu-right-content li:last-child {
    margin-left: 0;
}
body.rtl .main-header.style-one .main-menu .navigation > li:first-child,
body.rtl .main-header.style-five .main-menu .navigation > li:first-child {
    margin-right: 0 !important;
    margin-left: 22px !important;
}
body.rtl .main-header.style-one .main-menu .navigation > li:last-child,
body.rtl .main-header.style-five .main-menu .navigation > li:last-child {
    margin-right: 22px !important;
    margin-left: 0 !important;
}
/* Center-logo header variants keep their centered logo, but swap controls. */
body.rtl .main-header.style-two .menu-right-content .search-box-outer {
    right: 70px;
    left: auto;
}
body.rtl .main-header.style-two .menu-right-content .cart-btn {
    left: 70px;
    right: auto;
}
body.rtl .main-header.style-two .sticky-header .menu-right-content li,
body.rtl .main-header.style-two .sticky-header .menu-right-content .search-box-outer,
body.rtl .main-header.style-two .sticky-header .menu-right-content .cart-btn {
    position: relative;
    right: auto;
    left: auto;
}
body.rtl .main-header .search-box-outer .dropdown-menu {
    text-align: right;
    left: 0 !important;
    right: auto !important;
}
body.rtl .main-header .search-panel .search-btn {
    left: 1px;
    right: auto;
}
body.rtl .main-header .search-panel input[type="text"],
body.rtl .main-header .search-panel input[type="search"],
body.rtl .main-header .search-panel input[type="password"] {
    padding-right: 15px;
    padding-left: 50px;
    text-align: right;
}

/* Mobile navigation: open from the right and keep the close/menu triggers
   on the correct edges, including smaller viewports. */
body.rtl .mobile-nav-toggler,
body.rtl .menu-area .mobile-nav-toggler {
    float: left;
}
body.rtl .mobile-menu {
    right: 0;
    left: auto;
    padding-right: 0;
    padding-left: 30px;
    direction: rtl;
}
body.rtl .mobile-menu .menu-box {
    left: auto;
    right: 0;
    text-align: right;
}
body.rtl .mobile-menu .nav-logo {
    text-align: right;
}
body.rtl .mobile-menu .navigation li.dropdown .dropdown-btn {
    left: 6px;
    right: auto;
}
body.rtl .mobile-menu .navigation li > a:before {
    left: auto;
    right: 0;
}
body.rtl .mobile-menu .close-btn {
    left: 25px;
    right: auto;
}

/* Shop listing and cards: preserve product imagery; mirror text, controls,
   price badges and sorting elements rather than reversing the products. */
body.rtl .shop-block-one .inner-box .lower-content,
body.rtl .shop-block-one .inner-box .lower-content h3,
body.rtl .shop-page-section .item-shorting,
body.rtl .product-details-content .product-details {
    text-align: right;
}
body.rtl .shop-block-one .inner-box .lower-content .price-box {
    left: 0;
    right: auto;
}
body.rtl .shop-page-section .item-shorting .left-column,
body.rtl .shop-page-section .item-shorting .left-column .text,
body.rtl .shop-page-section .item-shorting .right-column .short-box,
body.rtl .shop-page-section .item-shorting .right-column .filter-box,
body.rtl .shop-page-section .item-shorting .right-column .menu-box,
body.rtl .shop-page-section .item-shorting .right-column .short-box p {
    float: right;
}
body.rtl .shop-page-section .item-shorting .right-column .short-box p {
    margin-left: 15px;
    margin-right: 0;
}
body.rtl .te-shop-archive__custom .woocommerce-ordering select {
    text-align: right;
    background-position: left center;
}
body.rtl .nice-select,
body.rtl .nice-select .option {
    text-align: right !important;
}
body.rtl .nice-select:after {
    left: 20px;
    right: auto;
}
body.rtl .product-details-content .product-details .rating li {
    float: right;
}

/* Blog cards and sidebar widgets. */
body.rtl .news-block-one .inner-box .lower-content,
body.rtl .blog-sidebar .sidebar-widget,
body.rtl .blog-sidebar .post-widget .post,
body.rtl .blog-sidebar .sidebar-archives .archives-list {
    text-align: right;
}
body.rtl .blog-sidebar .post-widget .post {
    padding-right: 100px;
    padding-left: 0;
}
body.rtl .blog-sidebar .post-widget .post .post-thumb {
    right: 0;
    left: auto;
}
body.rtl .blog-sidebar .search-widget .search-form .form-group input[type="search"] {
    padding-right: 20px;
    padding-left: 75px;
    text-align: right;
}
body.rtl .blog-sidebar .search-widget .search-form .form-group button {
    left: 5px;
    right: auto;
}
body.rtl .news-block-one .inner-box .image-box .category {
    right: 30px;
    left: auto;
}

/* WooCommerce classic components. Most RTL behavior is inherited from the
   document direction; explicitly override left floats and review details. */
body.rtl.woocommerce ul.products li.product,
body.rtl.woocommerce-page ul.products li.product {
    float: right;
    text-align: right;
}
body.rtl.woocommerce div.product div.images,
body.rtl.woocommerce-page div.product div.images {
    float: right;
}
body.rtl.woocommerce div.product div.summary,
body.rtl.woocommerce-page div.product div.summary {
    float: left;
    text-align: right;
}
body.rtl.woocommerce #reviews #comments ol.commentlist li .comment_container {
    direction: rtl;
    text-align: right;
}
body.rtl.woocommerce #reviews #comments ol.commentlist li .comment-text {
    text-align: right;
}
body.rtl.woocommerce .woocommerce-message,
body.rtl.woocommerce .woocommerce-info,
body.rtl.woocommerce .woocommerce-error {
    text-align: right;
}
body.rtl .wc-block-cart,
body.rtl .wc-block-checkout,
body.rtl .wc-block-components-sidebar,
body.rtl .woocommerce-MyAccount-navigation,
body.rtl .woocommerce-MyAccount-content {
    direction: rtl;
    text-align: right;
}
body.rtl .page .is-large.wc-block-cart .wc-block-cart__totals-title,
body.rtl .page .wc-block-cart .wc-block-cart__totals-title {
    text-align: right;
}
body.rtl .woocommerce form .form-row .input-text,
body.rtl .woocommerce-page form .form-row .input-text,
body.rtl .woocommerce form .form-row textarea,
body.rtl .woocommerce-page form .form-row textarea {
    text-align: right;
}

/* Forms and common content retain useful number, email and URL direction. */
body.rtl input:not([type="email"]):not([type="url"]):not([type="number"]),
body.rtl textarea,
body.rtl .wpcf7-form {
    text-align: right;
}
body.rtl input[type="email"],
body.rtl input[type="url"],
body.rtl input[type="tel"] {
    direction: ltr;
    text-align: left;
}

/* Elementor respects WordPress RTL itself. Avoid broad overrides of its
   section grids; simply ensure Arabic fields and ordinary widgets flow RTL. */
body.rtl .elementor-widget-text-editor,
body.rtl .elementor-widget-heading,
body.rtl .elementor-widget-woocommerce-products {
    direction: rtl;
}
body.rtl .elementor-widget-text-editor .elementor-widget-container {
    unicode-bidi: plaintext;
}

/* The theme's original rtl.css already handles carousels in LTR to avoid
   breaking scripted slide transforms. Do not mirror these images or tracks. */
