/**
 * Megatheme RTL Frontend Stylesheet — F-01
 * Enqueued only when is_rtl() is true (fa_IR locale).
 * Handle: megatheme-rtl-frontend
 *
 * Rules use .rtl body class (added by Divi) for specificity where needed,
 * so builder inline styles always take precedence.
 * No !important used on layout rules.
 */

/* ==============================================
   BASE
   ============================================== */
body.rtl {
    direction: rtl;
    unicode-bidi: embed;
}

/* ==============================================
   SECTIONS, ROWS, COLUMNS
   ============================================== */
body.rtl .et_pb_section,
body.rtl .et_pb_row,
body.rtl .et_pb_column {
    direction: rtl;
}

/* ==============================================
   TEXT MODULE
   ============================================== */
body.rtl .et_pb_text,
body.rtl .et_pb_text_inner {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_text_inner p,
body.rtl .et_pb_text_inner ul,
body.rtl .et_pb_text_inner ol,
body.rtl .et_pb_text_inner li,
body.rtl .et_pb_text_inner h1,
body.rtl .et_pb_text_inner h2,
body.rtl .et_pb_text_inner h3,
body.rtl .et_pb_text_inner h4,
body.rtl .et_pb_text_inner h5,
body.rtl .et_pb_text_inner h6 {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_text_inner ul,
body.rtl .et_pb_text_inner ol {
    padding-right: 1.5em;
    padding-left: 0;
}

/* ==============================================
   BLURB / FEATURE BOX
   ============================================== */
body.rtl .et_pb_blurb {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_blurb .et_pb_blurb_container {
    text-align: right;
}

/* Icon to the right in horizontal (left-icon) layout */
body.rtl .et_pb_blurb.et_pb_blurb_position_left .et_pb_main_blurb_image,
body.rtl .et_pb_blurb.et_pb_blurb_position_left .et_pb_blurb_icon {
    float: right;
    margin-right: 0;
    margin-left: 20px;
}

body.rtl .et_pb_blurb.et_pb_blurb_position_left .et_pb_blurb_content {
    padding-left: 0;
    padding-right: 90px;
}

/* ==============================================
   IMAGE MODULE
   ============================================== */
body.rtl .et_pb_image {
    text-align: right;
}

body.rtl .et_pb_image figcaption,
body.rtl .wp-caption-text {
    text-align: right;
    direction: rtl;
}

/* ==============================================
   CALL TO ACTION (CTA)
   ============================================== */
body.rtl .et_pb_cta {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_cta .et_pb_promo_description {
    text-align: right;
}

body.rtl .et_pb_cta .et_pb_cta_button {
    float: right;
    margin-right: 0;
    margin-left: 15px;
}

/* ==============================================
   BUTTON MODULE
   ============================================== */
body.rtl .et_pb_button_module_wrapper {
    text-align: right;
}

/* ==============================================
   HEADING MODULE
   ============================================== */
body.rtl .et_pb_heading,
body.rtl .et_pb_heading .et_pb_heading_container {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   NAVIGATION — HEADER & MENUS
   ============================================== */
/* Primary nav items flow right */
body.rtl #top-menu,
body.rtl .et-menu {
    direction: rtl;
    text-align: right;
}

/* Floating the primary menu items is only right for the default (left-aligned)
   header. The centered and split headers lay their items out inline so the menu
   can be centered; a float here left the menu off-centre and dropped the search
   icon below it. */
body.rtl.et_header_style_left:not(.et_vertical_nav) #top-menu > li,
body.rtl .et-menu > li {
    float: right;
}

/* Dropdowns open to the left */
body.rtl #top-menu .sub-menu,
body.rtl .et-menu .sub-menu,
body.rtl .nav ul ul {
    left: auto;
    right: 0;
    text-align: right;
}

body.rtl #top-menu .sub-menu .sub-menu,
body.rtl #top-menu .children .children,
body.rtl .et-menu .sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

/* Logo floats right, nav floats left in the default (left-aligned) RTL header.
   Scoped to .et_header_style_left: the centered / split / slide / fullscreen
   headers have their own layout rules in the theme's rtl.css, and floating the
   logo and nav here pushed them out of position (centered logo ended up at the
   right edge, menu no longer centered). */
body.rtl.et_header_style_left:not(.et_vertical_nav) #logo {
    float: right;
}

body.rtl.et_header_style_left:not(.et_vertical_nav) #et-top-navigation {
    float: left;
    direction: rtl;
}

body.rtl.et_header_style_left:not(.et_vertical_nav) #et-top-navigation nav {
    float: right;
}

/* Search icon and secondary nav */
body.rtl.et_header_style_left:not(.et_vertical_nav) #et_search_icon,
body.rtl.et_header_style_left:not(.et_vertical_nav) .et_top_search {
    float: left;
}

body.rtl .et_header_style_left #et-top-navigation {
    padding-left: 0;
    padding-right: 20px;
}

/* Breadcrumbs */
body.rtl .et_pb_breadcrumbs,
body.rtl #breadcrumbs {
    direction: rtl;
    text-align: right;
}

/* Mobile hamburger on the LEFT side in RTL (default header only: the centered and
   split headers make the mobile bar full width and position the icon absolutely,
   so floating it left shrank the bar to its content and the menu items wrapped
   in a narrow column). */
body.rtl.et_header_style_left #et_mobile_nav_menu,
body.rtl.et_header_style_left .mobile_nav .mobile_menu_bar {
    float: left;
}

/* Mobile menu items */
body.rtl .et_mobile_nav_menu .et_mobile_menu,
body.rtl .et_mobile_nav_menu .et_mobile_menu li a {
    direction: rtl;
    text-align: right;
}

/* Vertical nav dropdowns in mobile */
body.rtl .et_mobile_nav_menu .et_mobile_menu li .menu-item-has-children .sub-menu {
    text-align: right;
}

/* ==============================================
   FULLWIDTH MENU MODULE
   ============================================== */
body.rtl .et_pb_fullwidth_menu {
    direction: rtl;
}

body.rtl .et_pb_fullwidth_menu .et_pb_menu_inner_container ul li {
    float: right;
}

body.rtl .et_pb_fullwidth_menu .sub-menu {
    left: auto;
    right: 0;
    text-align: right;
}

body.rtl .et_pb_menu .et_pb_menu_inner_container {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   SLIDER & CAROUSEL
   ============================================== */

/* Swap arrow positions: prev on right, next on left */
body.rtl .et_pb_slider .et-pb-arrow-prev,
body.rtl .et_pb_fullwidth_slider .et-pb-arrow-prev,
body.rtl .et_pb_post_slider .et-pb-arrow-prev {
    left: auto;
    right: 27px;
}

body.rtl .et_pb_slider .et-pb-arrow-next,
body.rtl .et_pb_fullwidth_slider .et-pb-arrow-next,
body.rtl .et_pb_post_slider .et-pb-arrow-next {
    right: auto;
    left: 27px;
}

/* Mirror arrow glyphs */
body.rtl .et_pb_slider .et-pb-arrow-prev::before,
body.rtl .et_pb_fullwidth_slider .et-pb-arrow-prev::before,
body.rtl .et_pb_post_slider .et-pb-arrow-prev::before {
    display: inline-block;
    transform: scaleX(-1);
}

body.rtl .et_pb_slider .et-pb-arrow-next::before,
body.rtl .et_pb_fullwidth_slider .et-pb-arrow-next::before,
body.rtl .et_pb_post_slider .et-pb-arrow-next::before {
    display: inline-block;
    transform: scaleX(-1);
}

/* Slide content */
body.rtl .et_pb_slide .et_pb_slide_description {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   TESTIMONIAL
   ============================================== */
body.rtl .et_pb_testimonial {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_testimonial_portrait {
    float: right;
    margin-right: 0;
    margin-left: 20px;
}

body.rtl .et_pb_testimonial_description {
    text-align: right;
}

body.rtl .et_pb_testimonial_author {
    text-align: right;
    padding-right: 100px;
    padding-left: 0;
}

/* ==============================================
   HEADER VARIANTS
   ============================================== */
/* Fullscreen header: Divi pins the close button to right:30px. In RTL the
   hamburger that opens the overlay is at the left, so the close button jumped to
   the opposite corner. Mirror it. */
body.rtl.et_header_style_fullscreen .et_slide_in_menu_container span.mobile_menu_bar.et_toggle_fullscreen_menu {
    right: auto;
    left: 30px;
}

/* ==============================================
   PRICING TABLES
   ============================================== */
body.rtl .et_pb_pricing {
    direction: rtl;
}

body.rtl .et_pb_pricing_table .et_pb_pricing_content ul {
    text-align: right;
    padding-right: 0;
}

body.rtl .et_pb_pricing_table .et_pb_pricing_content li::before {
    margin-right: 0;
    margin-left: 5px;
}

/* ==============================================
   CONTACT FORM
   ============================================== */
body.rtl .et_pb_contact_form_container {
    direction: rtl;
}

body.rtl .et_pb_contact_field {
    direction: rtl;
}

body.rtl .et_pb_contact_field input[type="text"],
body.rtl .et_pb_contact_field input[type="email"],
body.rtl .et_pb_contact_field input[type="tel"],
body.rtl .et_pb_contact_field input[type="url"],
body.rtl .et_pb_contact_field input[type="number"],
body.rtl .et_pb_contact_field textarea,
body.rtl .et_pb_contact_field select {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_contact_field label,
body.rtl .et_pb_contact_field .et_pb_contact_field_options_title {
    direction: rtl;
    text-align: right;
    display: block;
}

body.rtl .et_pb_contact_form .et_pb_contact_submit {
    float: right;
}

/* ==============================================
   TABS MODULE
   ============================================== */
body.rtl .et_pb_tabs {
    direction: rtl;
}

body.rtl .et_pb_tabs_controls {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_tabs_controls li {
    float: right;
}

body.rtl .et_pb_tab {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   ACCORDION & TOGGLE
   ============================================== */
body.rtl .et_pb_accordion,
body.rtl .et_pb_toggle {
    direction: rtl;
}

body.rtl .et_pb_toggle_title {
    text-align: right;
    padding-right: 0;
    padding-left: 40px;
}

/* Arrow sits on the left (visual right-to-read) */
body.rtl .et_pb_toggle .et_pb_toggle_title::before,
body.rtl .et_pb_accordion .et_pb_toggle_title::before {
    right: auto;
    left: 15px;
}

body.rtl .et_pb_toggle_content {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   NUMBER & BAR COUNTERS
   ============================================== */
body.rtl .et_pb_number_counter,
body.rtl .et_pb_circle_counter .et_pb_circle_counter_title {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_bar_counters {
    direction: rtl;
}

body.rtl .et_pb_bar_counters .et_pb_counter_title {
    text-align: right;
}

body.rtl .et_pb_counter_amount {
    right: auto;
    left: 10px;
}

/* ==============================================
   SOCIAL MEDIA FOLLOW
   ============================================== */
body.rtl .et_pb_social_media_follow {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_social_media_follow li {
    float: right;
}

/* ==============================================
   TEAM MEMBER
   ============================================== */
body.rtl .et_pb_team_member {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_member_social_links {
    direction: rtl;
}

/* ==============================================
   BLOG MODULE
   ============================================== */
body.rtl .et_pb_blog_grid article,
body.rtl .et_pb_posts article {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_post .post-meta,
body.rtl .et_pb_post .entry-summary {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_post .post-categories,
body.rtl .et_pb_post .post-tags {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   PORTFOLIO
   ============================================== */
body.rtl .et_pb_portfolio {
    direction: rtl;
}

body.rtl .et_pb_portfolio_item .et_pb_portfolio_image_overlay_content {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   GALLERY
   ============================================== */
body.rtl .et_pb_gallery {
    direction: rtl;
}

body.rtl .et_pb_gallery_item figcaption {
    text-align: right;
}

/* ==============================================
   SEARCH MODULE
   ============================================== */
body.rtl .et_pb_search {
    direction: rtl;
}

body.rtl .et_pb_search input[type="search"] {
    direction: rtl;
    text-align: right;
    padding-right: 10px;
    padding-left: 50px;
}

body.rtl .et_pb_search .et_pb_searchsubmit {
    right: auto;
    left: 0;
}

/* ==============================================
   SIDEBAR
   ============================================== */
body.rtl .et_pb_widget,
body.rtl #sidebar,
body.rtl .et_pb_widget_area {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_widget ul,
body.rtl .et_pb_widget ol {
    padding-right: 1em;
    padding-left: 0;
    text-align: right;
}

/* Full-width layout: main content right, sidebar left.
   Desktop only: at <=980px Divi stacks content and sidebar with float:none,
   and these higher-specificity rules would otherwise keep #left-area floated
   so the sidebar slides up and overlaps the article. */
@media (min-width: 981px) {
    body.rtl #left-area {
        float: right;
    }

    body.rtl #sidebar.et_pb_widget_area {
        float: left;
    }
}

/* ==============================================
   AUDIO MODULE
   ============================================== */
body.rtl .et_pb_audio_module {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_audio_module_content,
body.rtl .et_pb_audio_module .et_pb_audio_module_title {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   LOGIN MODULE
   ============================================== */
body.rtl .et_pb_login {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_login input[type="text"],
body.rtl .et_pb_login input[type="password"] {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_login label {
    direction: rtl;
    text-align: right;
    display: block;
}

/* ==============================================
   FULLWIDTH HEADER
   ============================================== */
body.rtl .et_pb_fullwidth_header {
    direction: rtl;
    text-align: right;
}

body.rtl .et_pb_fullwidth_header .et_pb_fullwidth_header_subhead {
    text-align: right;
}

body.rtl .et_pb_fullwidth_header .et_pb_header_content_wrapper {
    text-align: right;
}

/* ==============================================
   VIDEO & MAP — KEEP LTR (their own handling)
   ============================================== */
body.rtl .et_pb_video_wrap,
body.rtl .et_pb_map_container {
    direction: ltr;
}

/* ==============================================
   COMMENTS
   ============================================== */
body.rtl #comments,
body.rtl .comment-list,
body.rtl .comment-body {
    direction: rtl;
    text-align: right;
}

body.rtl #commentform input,
body.rtl #commentform textarea {
    direction: rtl;
    text-align: right;
}

body.rtl .comment-author .fn {
    direction: rtl;
}

/* Replies: Divi indents nested comments with margin-left (100 / 50 / 25px), and its
   RTL stylesheet does not mirror it, so every reply hung from the same right edge.
   Indent from the right instead. The Comments module's narrow-column rules have
   higher specificity, so they are mirrored one by one. */
body.rtl .comment .children {
    margin-left: 0;
    margin-right: 100px;
}
@media (max-width: 767px) {
    body.rtl .comment .children { margin-right: 50px; }
}
@media (max-width: 479px) {
    body.rtl .comment .children { margin-right: 25px; }
}
@media (min-width: 480px) {
    body.rtl .et_pb_column_1_4 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_5 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_6 .et_pb_comments_module .comment .children {
        margin-left: 0;
        margin-right: 0;
    }
}
@media (min-width: 981px) {
    body.rtl .et_pb_column_1_2 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_3 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_4 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_5 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_1_6 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_2_5 .et_pb_comments_module .comment .children,
    body.rtl .et_pb_column_3_5 .et_pb_comments_module .comment .children {
        margin-left: 0;
        margin-right: 25px;
    }
}

/* ==============================================
   WOOCOMMERCE
   ============================================== */
body.rtl .woocommerce,
body.rtl .woocommerce-page {
    direction: rtl;
}

/* Product grids */
body.rtl .woocommerce ul.products li.product {
    direction: rtl;
    text-align: right;
    float: right;
}

body.rtl .woocommerce .price,
body.rtl .woocommerce-page .price,
body.rtl .woocommerce .product_title {
    text-align: right;
    direction: rtl;
}

/* Cart */
body.rtl .woocommerce-cart table.cart,
body.rtl .woocommerce-cart table.cart th,
body.rtl .woocommerce-cart table.cart td {
    direction: rtl;
    text-align: right;
}

body.rtl .woocommerce .cart_totals {
    float: right;
    text-align: right;
}

/* Checkout */
body.rtl .woocommerce-checkout .woocommerce,
body.rtl .woocommerce-billing-fields,
body.rtl .woocommerce-shipping-fields {
    direction: rtl;
    text-align: right;
}

body.rtl .woocommerce-checkout input,
body.rtl .woocommerce-checkout select,
body.rtl .woocommerce-checkout textarea {
    direction: rtl;
    text-align: right;
}

body.rtl .woocommerce-checkout label {
    direction: rtl;
    text-align: right;
    display: block;
}

/* Product tabs */
body.rtl .woocommerce div.product .woocommerce-tabs ul.tabs {
    direction: rtl;
}

body.rtl .woocommerce div.product .woocommerce-tabs ul.tabs li {
    float: right;
}

body.rtl .woocommerce div.product .woocommerce-tabs ul.tabs li a {
    direction: rtl;
}

/* Add to cart quantity */
body.rtl .woocommerce .quantity input {
    direction: rtl;
    text-align: center;
}

/* ==============================================
   WP CORE ALIGNMENT HELPERS (RTL swap)
   ============================================== */
body.rtl .alignleft {
    float: right;
    margin-right: 0;
    margin-left: 1.5em;
}

body.rtl .alignright {
    float: left;
    margin-left: 0;
    margin-right: 1.5em;
}

/* ==============================================
   GENERAL FORM INPUTS (site-wide)
   ============================================== */
body.rtl input[type="text"],
body.rtl input[type="email"],
body.rtl input[type="tel"],
body.rtl input[type="url"],
body.rtl input[type="number"],
body.rtl input[type="search"],
body.rtl input[type="password"],
body.rtl textarea,
body.rtl select {
    direction: rtl;
    text-align: right;
}

/* ==============================================
   PAGINATION
   ============================================== */
body.rtl .pagination,
body.rtl .page-numbers,
body.rtl .wp-pagenavi {
    direction: rtl;
}

body.rtl .nav-links .nav-previous {
    float: right;
}

body.rtl .nav-links .nav-next {
    float: left;
}


/* ==============================================
   BLOCKQUOTE
   ============================================== */
/* Divi's compiled RTL stylesheet flips blockquote once, then a later plain
   `blockquote { border-left; padding-left }` rule undoes it (source order), so
   quotes rendered with the accent bar on the left (seen in the Visual Builder
   canvas). Re-assert the RTL side; the Persian typography blockquote carries
   its own styling and is left alone. */
body.rtl blockquote:not(.megatheme-pt-blockquote) {
    border-left: 0;
    padding-left: 0;
    border-right: 5px solid;
    padding-right: 20px;
}


/* ==============================================
   CODE — always left-to-right
   ============================================== */
/* Code is LTR even inside a Persian page. Inheriting direction:rtl reorders
   punctuation (`function test() {` rendered as `} ()function test`). */
body.rtl pre,
body.rtl code,
body.rtl kbd,
body.rtl samp {
    direction: ltr;
    unicode-bidi: isolate;
}

body.rtl pre {
    text-align: left;
}

/* ==============================================
   TABLES
   ============================================== */
/* Divi sets th/td to text-align:left; the table already lays columns out
   right-to-left, so cell text must start at the right edge as well. Scoped to
   content areas so builder modules with their own alignment are unaffected. */
body.rtl .entry-content th,
body.rtl .entry-content td,
body.rtl .et_pb_text_inner th,
body.rtl .et_pb_text_inner td,
body.rtl .comment-content th,
body.rtl .comment-content td {
    text-align: right;
}



/* ==============================================
   HEADER VARIANTS
   ============================================== */
/* Fullscreen header: Divi pins the close button to right:30px. In RTL the
   hamburger that opens the overlay is at the left, so the close button jumped to
   the opposite corner. Mirror it. */
body.rtl.et_header_style_fullscreen .et_slide_in_menu_container span.mobile_menu_bar.et_toggle_fullscreen_menu {
    right: auto;
    left: 30px;
}

/* ==============================================
   PRICING TABLE
   ============================================== */
/* Divi positions the currency label as an absolutely placed superscript with
   margin-left:-.5em and the bullet with left:-14px - both unflipped, so the
   label (a word like "تومان") overlaps the price digits and the bullets land
   on the wrong side of the text. Lay the price out as a flex row instead
   (number, then currency, then period) and move the bullet to the start side. */
body.rtl .et_pb_pricing .et_pb_et_price {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
}

body.rtl .et_pb_pricing .et_pb_sum {
    order: 1;
}

body.rtl .et_pb_pricing .et_pb_dollar_sign {
    order: 2;
    position: static;
    margin: 0 .4em;
}

body.rtl .et_pb_pricing .et_pb_frequency {
    order: 3;
}

body.rtl .et_pb_pricing li > span:before {
    left: auto;
    right: -14px;
}

/* ==============================================
   MENU MODULE - COLLAPSIBLE MOBILE MENU (Divi 5.16+)
   ============================================== */
/* The grid layout (link | toggle) follows direction:rtl by itself, so the toggle is
   already on the left. Only the two physical paddings need mirroring: the gap between
   the link text and the toggle, and the indent of the opened submenu. */
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.menu-item-has-children > a,
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.page_item_has_children > a {
    padding-right: 5%;
    padding-left: 12px;
}
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.menu-item-has-children > .children,
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.menu-item-has-children > .sub-menu,
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.page_item_has_children > .children,
body.rtl .et_pb_menu.et_pb_menu--collapsible-mobile .et_mobile_menu li.page_item_has_children > .sub-menu {
    padding-left: 0;
    padding-right: 10px;
}

/* ==============================================
   FILTERABLE PORTFOLIO
   ============================================== */
/* Divi floats the category filter links left, so "All" (the first link) ended up
   at the left end of the bar. Start the bar on the right instead. */
body.rtl .et_pb_filterable_portfolio .et_pb_portfolio_filters li {
    float: right;
}

/* ==============================================
   FULLWIDTH PORTFOLIO CAROUSEL
   ============================================== */
/* Items and slide groups are floated left; the first project belongs on the right. */
body.rtl .et_pb_fullwidth_portfolio .et_pb_portfolio_items:not(.et_flex_module):not(.et_grid_module) .et_pb_portfolio_item,
body.rtl .et_pb_fullwidth_portfolio .et_pb_carousel_group {
    float: right;
}

/* ==============================================
   WOOCOMMERCE SALE BADGE
   ============================================== */
/* Divi pins the badge with left:10px !important and never mirrors it. In RTL the
   WooCommerce RTL sheet also sets right:-.5em, so on the product page the badge
   stretched between both sides across the summary. Pin it top-right instead. */
body.rtl .woocommerce span.onsale,
body.rtl.woocommerce span.onsale,
body.rtl.woocommerce-page span.onsale,
body.rtl .woocommerce ul.products li.product .onsale,
body.rtl.woocommerce-page ul.products li.product .onsale {
    left: auto !important;
    right: 10px !important;
}

/* WooCommerce Cart/Checkout blocks (React) print prices as <bdi>number <span dir="auto">currency</span></bdi>.
   The bdi's own direction is auto-detected and skips the span that carries dir, so with Persian digits it falls
   back to LTR and shows "تومان ۱٬۲۵۰٬۰۰۰". Force RTL: number on the right, currency after it.
   (Classic templates get <bdi dir="rtl"> from persian-digits.php.) */
body.rtl .wc-block-formatted-money-amount bdi,
body.rtl .wc-block-components-formatted-money-amount bdi {
    direction: rtl;
    unicode-bidi: isolate;
}
