/**
 * 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;
}

body.rtl #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 .et-menu .sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

/* Logo floats right, nav floats left in RTL header */
body.rtl #logo {
    float: right;
}

body.rtl #et-top-navigation {
    float: left;
    direction: rtl;
}

body.rtl #et-top-navigation nav {
    float: right;
}

/* Search icon and secondary nav */
body.rtl #et_search_icon,
body.rtl .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 */
body.rtl #et_mobile_nav_menu,
body.rtl .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;
}

/* ==============================================
   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 */
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;
}

/* ==============================================
   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;
}
