/**
 * Omni Orders - Arabic RTL Styles
 * Place in: wp-content/themes/woodmart-child/assets/css/rtl.css
 * Enqueued automatically for Arabic language
 */

/* =============================================================================
   BASE RTL FIXES
   ============================================================================= */

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

/* Fix flexbox direction for RTL */
body.rtl .elementor-row,
body.rtl .elementor-column,
body.rtl .wd-flex,
body.rtl .d-flex {
    flex-direction: row-reverse;
}

/* Fix grid direction */
body.rtl .wd-grid {
    direction: rtl;
}

/* =============================================================================
   HEADER & NAVIGATION
   ============================================================================= */

body.rtl .header-wrapper {
    direction: rtl;
}

body.rtl .site-header .header-main .header-left {
    order: 2;
}

body.rtl .site-header .header-main .header-right {
    order: 1;
}

body.rtl .site-header .header-main .header-center {
    order: 3;
}

/* Menu items */
body.rtl .main-nav > ul > li {
    float: right;
    margin-left: 20px;
    margin-right: 0;
}

body.rtl .main-nav > ul > li:last-child {
    margin-left: 0;
}

/* Submenu positioning */
body.rtl .main-nav ul.sub-menu {
    left: auto;
    right: 0;
}

body.rtl .main-nav ul.sub-menu .sub-menu {
    left: auto;
    right: 100%;
}

/* Mobile menu */
body.rtl .mobile-menu-wrapper {
    right: 0;
    left: auto;
}

body.rtl .mobile-menu-close {
    left: 20px;
    right: auto;
}

/* Search form */
body.rtl .header-search-form {
    direction: rtl;
}

body.rtl .header-search-form input {
    padding-right: 50px;
    padding-left: 20px;
}

body.rtl .header-search-form button {
    right: auto;
    left: 10px;
}

/* =============================================================================
   WOCOMMERCE RTL
   ============================================================================= */

body.rtl .woocommerce {
    direction: rtl;
}

/* Product grid */
body.rtl .products.columns-4,
body.rtl .products.columns-3,
body.rtl .products.columns-5 {
    direction: rtl;
}

body.rtl .product {
    float: right;
    clear: none;
}

body.rtl .product.first {
    clear: right;
}

body.rtl .product.last {
    clear: none;
}

/* Single product */
body.rtl .woocommerce div.product {
    direction: rtl;
}

body.rtl .woocommerce div.product .woocommerce-product-gallery {
    float: right;
}

body.rtl .woocommerce div.product .summary {
    float: right;
    padding-right: 0;
    padding-left: 40px;
}

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

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

/* Cart */
body.rtl .woocommerce-cart table.cart td.product-thumbnail,
body.rtl .woocommerce-checkout table.cart td.product-thumbnail {
    text-align: right;
}

body.rtl .woocommerce-cart table.cart td.product-name,
body.rtl .woocommerce-checkout table.cart td.product-name {
    text-align: right;
}

body.rtl .woocommerce table.shop_table td,
body.rtl .woocommerce table.shop_table th {
    text-align: right;
}

/* Cart totals */
body.rtl .cart_totals tr td,
body.rtl .cart_totals tr th {
    text-align: right;
}

body.rtl .wc-proceed-to-checkout {
    text-align: left;
}

/* Checkout form */
body.rtl .woocommerce-checkout .col-1,
body.rtl .woocommerce-checkout .col-2 {
    float: right;
}

body.rtl .woocommerce-billing-fields,
body.rtl .woocommerce-shipping-fields {
    direction: rtl;
}

body.rtl .woocommerce form .form-row-first {
    float: right;
}

body.rtl .woocommerce form .form-row-last {
    float: left;
}

/* Order review */
body.rtl #order_review_heading {
    text-align: right;
}

body.rtl #payment {
    direction: rtl;
}

body.rtl .payment_methods li {
    text-align: right;
    padding-right: 2.5em;
    padding-left: 0;
}

body.rtl .payment_methods label {
    right: 0;
    left: auto;
}

body.rtl .payment_box {
    margin-right: 2em;
    margin-left: 0;
}

/* My Account */
body.rtl .woocommerce-MyAccount-navigation {
    float: right;
    margin-left: 30px;
    margin-right: 0;
}

body.rtl .woocommerce-MyAccount-content {
    float: right;
}

/* =============================================================================
   ELEMENTOR RTL
   ============================================================================= */

body.rtl .elementor-section,
body.rtl .elementor-column,
body.rtl .elementor-widget-wrap {
    direction: rtl;
}

body.rtl .elementor-widget {
    direction: rtl;
}

/* Elementor columns */
body.rtl .elementor-row > .elementor-column {
    float: right;
}

/* Elementor widgets common fixes */
body.rtl .elementor-widget-heading .elementor-heading-title {
    text-align: right;
}

body.rtl .elementor-widget-text-editor {
    text-align: right;
}

body.rtl .elementor-widget-button .elementor-button-wrapper {
    justify-content: flex-start;
}

body.rtl .elementor-widget-image {
    text-align: right;
}

/* =============================================================================
   WOODMART SPECIFIC
   ============================================================================= */

/* Header builder */
body.rtl .wd-header-builder {
    direction: rtl;
}

body.rtl .wd-header-element {
    direction: rtl;
}

/* Footer */
body.rtl .footer-wrapper {
    direction: rtl;
    text-align: right;
}

body.rtl .footer-widgets {
    direction: rtl;
}

/* Sidebar */
body.rtl .sidebar-left {
    float: right;
}

body.rtl .sidebar-right {
    float: left;
}

body.rtl .content-area {
    float: right;
}

/* Blog */
body.rtl .blog-posts .post-item {
    direction: rtl;
}

body.rtl .post-meta {
    direction: rtl;
}

/* Forms */
body.rtl .wpcf7-form {
    direction: rtl;
    text-align: right;
}

body.rtl .wpcf7-form input,
body.rtl .wpcf7-form textarea,
body.rtl .wpcf7-form select {
    text-align: right;
}

/* =============================================================================
   LOGIN PAGE RTL
   ============================================================================= */

body.rtl.login {
    direction: rtl;
}

body.rtl.login #login {
    text-align: right;
}

body.rtl.login form {
    text-align: right;
}

body.rtl.login label {
    text-align: right;
}

body.rtl.login #nav,
body.rtl.login #backtoblog {
    text-align: right;
}

/* =============================================================================
   ADMIN BAR (if shown)
   ============================================================================= */

body.rtl #wpadminbar {
    direction: rtl;
}

body.rtl #wpadminbar .ab-top-menu > li {
    float: right;
}

body.rtl #wpadminbar .ab-top-secondary > li {
    float: left;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.rtl-only {
    display: none;
}

.ltr-only {
    display: inherit;
}

body.rtl .rtl-only {
    display: inherit;
}

body.rtl .ltr-only {
    display: none;
}

/* Margin/Padding helpers for RTL */
body.rtl .mr-auto { margin-right: auto !important; margin-left: 0 !important; }
body.rtl .ml-auto { margin-left: auto !important; margin-right: 0 !important; }
body.rtl .pr-0 { padding-right: 0 !important; }
body.rtl .pl-0 { padding-left: 0 !important; }

/* =============================================================================
   MEDIA QUERIES
   ============================================================================= */

@media (max-width: 768px) {
    body.rtl .main-nav > ul > li {
        float: none;
        margin: 0;
    }

    body.rtl .woocommerce div.product .woocommerce-product-gallery,
    body.rtl .woocommerce div.product .summary {
        float: none;
        width: 100%;
        padding: 0;
    }

    body.rtl .woocommerce-MyAccount-navigation,
    body.rtl .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
        margin: 0;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    body.rtl {
        direction: rtl;
    }
}