/* Woodmart Arabic RTL Styles */
/* This file provides RTL (Right-to-Left) support for Woodmart theme */

/* Typography */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] div,
html[dir="rtl"] li,
html[dir="rtl"] label {
    font-family: 'Tajawal', sans-serif;
}

/* Text alignment */
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }

/* Navigation */
html[dir="rtl"] .wd-header-nav .menu {
    margin-right: 0;
    margin-left: auto;
}

html[dir="rtl"] .wd-nav-opener span:before {
    transform: none;
}

/* Dropdown menus */
html[dir="rtl"] .wd-dropdown-menu {
    left: auto;
    right: 0;
}

html[dir="rtl"] .wd-dropdown-menu .wd-sub-menu {
    left: auto;
    right: 100%;
}

/* Header elements */
html[dir="rtl"] .whb-box:not(.whb-icon-box) {
    flex-direction: row-reverse;
}

/* Icons - Flip RTL */
html[dir="rtl"] .wd-icon,
html[dir="rtl"] .woodmart-i-icon,
html[dir="rtl"] [class*="wd-ic-"] {
    transform: scaleX(-1);
}

/* Cart icons should not be flipped */
html[dir="rtl"] .wd-header-cart .wd-icon,
html[dir="rtl"] .wd-header-wishlist .wd-icon,
html[dir="rtl"] .wd-header-compare .wd-icon,
html[dir="rtl"] .wd-search-button .wd-icon {
    transform: none !important;
}

/* Buttons */
html[dir="rtl"] .wd-button,
html[dir="rtl"] .woocommerce a.button,
html[dir="rtl"] .woocommerce button.button {
    flex-direction: row-reverse;
}

/* Form elements */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
    padding-right: 15px;
    padding-left: 15px;
}

/* Product grid */
html[dir="rtl"] .products .product {
    float: right;
}

/* Product badges */
html[dir="rtl"] .product-label {
    right: auto;
    left: 10px;
}

/* Product actions */
html[dir="rtl"] .product-compare-button,
html[dir="rtl"] .wd-add-btn-btn {
    left: auto;
    right: 10px;
}

/* Quick view */
html[dir="rtl"] .wd-popup-quick-view .wd-close-icon {
    right: auto;
    left: 20px;
}

/* Breadcrumbs */
html[dir="rtl"] .yoast-breadcrumbs,
html[dir="rtl"] .woodmart-breadcrumbs {
    text-align: right;
}

html[dir="rtl"] .breadcrumb-link-sep {
    margin-right: 0;
    margin-left: 8px;
}

/* Cart */
html[dir="rtl"] .woodmart-cart-opened .cart-widget-side {
    left: auto;
    right: 0;
}

html[dir="rtl"] .wd-cart-actions {
    text-align: left;
}

/* Mini cart */
html[dir="rtl"] .widget_shopping_cart .cart_list li {
    padding-left: 0;
    padding-right: 0;
}

html[dir="rtl"] .widget_shopping_cart .cart_list li a:not(.remove) {
    margin-left: 0;
    margin-right: 20px;
}

html[dir="rtl"] .widget_shopping_cart .cart_list li .quantity {
    margin-left: 0;
    margin-right: 20px;
}

/* WooCommerce */
html[dir="rtl"] .woocommerce a.button,
html[dir="rtl"] .woocommerce button.button,
html[dir="rtl"] .woocommerce input.button {
    float: right;
}

html[dir="rtl"] .woocommerce .col2-set,
html[dir="rtl"] .woocommerce-page .col2-set {
    float: right;
    margin-left: 4%;
    margin-right: 0;
}

html[dir="rtl"] .woocommerce .col2-set .col-1,
html[dir="rtl"] .woocommerce-page .col2-set .col-1 {
    float: right;
    width: 48%;
}

html[dir="rtl"] .woocommerce .col2-set .col-2,
html[dir="rtl"] .woocommerce-page .col2-set .col-2 {
    float: left;
    width: 48%;
}

/* Checkout */
html[dir="rtl"] #order_review_heading {
    text-align: right;
}

html[dir="rtl"] .woocommerce-checkout #payment ul {
    padding-left: 0;
    padding-right: 1.5em;
}

html[dir="rtl"] .woocommerce-checkout #payment ul li {
    text-align: right;
}

/* Account */
html[dir="rtl"] .woocommerce-MyAccount-navigation ul {
    padding-left: 0;
    padding-right: 0;
}

html[dir="rtl"] .woocommerce-MyAccount-navigation ul li a {
    border-left: none;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .woocommerce-MyAccount-navigation ul li a:hover,
html[dir="rtl"] .woocommerce-MyAccount-navigation ul li.is-active a {
    border-left: none;
    border-right-color: var(--wd-primary-color);
}

/* Tabs */
html[dir="rtl"] .woocommerce-tabs ul.tabs {
    padding-left: 0;
    padding-right: 0;
    text-align: right;
}

html[dir="rtl"] .woocommerce-tabs ul.tabs li {
    float: right;
    margin-left: 0;
    margin-right: -1px;
}

/* Star rating */
html[dir="rtl"] .star-rating {
    float: right;
}

/* Comment */
html[dir="rtl"] .comment-form-rating {
    text-align: right;
}

html[dir="rtl"] .commentlist .comment {
    padding-left: 0;
    padding-right: 80px;
}

html[dir="rtl"] .commentlist .avatar {
    left: auto;
    right: 0;
}

/* Pagination */
html[dir="rtl"] .woocommerce-pagination ul.page-numbers li {
    float: right;
}

/* Alerts */
html[dir="rtl"] .woocommerce-message,
html[dir="rtl"] .woocommerce-info,
html[dir="rtl"] .woocommerce-error {
    padding-right: 3.5em;
    padding-left: 1em;
}

html[dir="rtl"] .woocommerce-message:before,
html[dir="rtl"] .woocommerce-info:before,
html[dir="rtl"] .woocommerce-error:before {
    left: auto;
    right: 1em;
}

/* Alerts with buttons */
html[dir="rtl"] .woocommerce-message .button {
    float: left;
}

/* Select2 */
html[dir="rtl"] .select2-container--default .select2-selection--single {
    text-align: right;
}

html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 5px;
    right: auto;
}

/* Footer */
html[dir="rtl"] .footer-widget {
    text-align: right;
}

/* Scroll to top */
html[dir="rtl"] .scrollToTop {
    left: 20px;
    right: auto;
}

/* Search */
html[dir="rtl"] .wd-search-opened .wd-search-form {
    left: 0;
    right: auto;
}

html[dir="rtl"] .wd-search-by-title .searchsubmit {
    right: auto;
    left: 0;
}

/* Sharing icons */
html[dir="rtl"] .woodmart-social-icons {
    text-align: right;
}

html[dir="rtl"] .woodmart-social-icons li {
    margin-right: 0;
    margin-left: 10px;
}

/* Summary (product page) */
html[dir="rtl"] .woocommerce-product-gallery {
    float: right;
}

html[dir="rtl"] .summary {
    float: left;
}

/* Variations */
html[dir="rtl"] .woocommerce-variation-price {
    text-align: right;
}

/* Cross sells */
html[dir="rtl"] .cross-sells ul.products li.product {
    float: right;
}

/* Cart totals */
html[dir="rtl"] .cart-collaterals .cart_totals {
    float: left;
}

html[dir="rtl"] .wc-proceed-to-checkout {
    text-align: left;
}

/* Table */
html[dir="rtl"] table.shop_table {
    text-align: right;
}

html[dir="rtl"] table.shop_table .product-name {
    text-align: right;
}

html[dir="rtl"] table.shop_table tfoot th {
    text-align: left;
}

html[dir="rtl"] table.shop_table tfoot td {
    text-align: right;
}

/* Coupon */
html[dir="rtl"] .checkout_coupon {
    text-align: right;
}

/* Reset default RTL */
html[dir="rtl"] .alignleft {
    float: right;
    margin-left: 1.5em;
    margin-right: 0;
}

html[dir="rtl"] .alignright {
    float: left;
    margin-right: 1.5em;
    margin-left: 0;
}

/* Thumbnail navigation */
html[dir="rtl"] .woocommerce-product-gallery__wrapper .thumbnails {
    margin-left: 0;
    margin-right: 0;
}

/* Login/Register */
html[dir="rtl"] .woocommerce-form-login {
    text-align: right;
}

html[dir="rtl"] .woocommerce-form-login .lost_password {
    text-align: left;
}

/* Wishlist */
html[dir="rtl"] .yith-wcwl-share {
    text-align: right;
}

/* Additional information */
html[dir="rtl"] .woocommerce-product-attributes-item__label {
    text-align: right;
}

/* Order details */
html[dir="rtl"] .woocommerce-order-details {
    text-align: right;
}

html[dir="rtl"] .woocommerce-table--order-details {
    text-align: right;
}

/* Blockquotes */
html[dir="rtl"] blockquote {
    border-left: none;
    border-right: 3px solid var(--wd-primary-color);
    padding-right: 20px;
    padding-left: 0;
}

/* Gallery */
html[dir="rtl"] .gallery {
    text-align: right;
}

html[dir="rtl"] .gallery-item {
    float: right;
}

/* Search widget */
html[dir="rtl"] .widget_product_search .searchform,
html[dir="rtl"] .widget_search .searchform {
    direction: rtl;
}

/* Tags widget */
html[dir="rtl"] .widget_tag_cloud .tagcloud,
html[dir="rtl"] .woocommerce-widget-layered-nav .tagcloud {
    text-align: right;
}

/* Reviews */
html[dir="rtl"] .woocommerce-Reviews-title {
    text-align: right;
}

html[dir="rtl"] .comment-form-comment,
html[dir="rtl"] .comment-form-author,
html[dir="rtl"] .comment-form-email,
html[dir="rtl"] .comment-form-url {
    text-align: right;
}

html[dir="rtl"] .comment-form-rating .stars {
    text-align: right;
}

/* My Account orders */
html[dir="rtl"] .woocommerce-orders-table__cell-order-number a {
    text-align: right;
}

html[dir="rtl"] .woocommerce-orders-table__cell-order-actions {
    text-align: left;
}

/* Track order */
html[dir="rtl"] .woocommerce-track-dl {
    direction: rtl;
}

/* Applied coupons */
html[dir="rtl"] .woocommerce-remove-coupon {
    left: 0;
    right: auto;
}

/* Variations */
html[dir="rtl"] .variation {
    direction: rtl;
}

html[dir="rtl"] .variation dt {
    float: right;
    clear: both;
}

html[dir="rtl"] .variation dd {
    float: right;
    margin-right: 0;
    margin-left: .25em;
}

/* Admin bar */
html[dir="rtl"] #wpadminbar {
    direction: rtl;
}

/* List styles */
html[dir="rtl"] ul[role="list"] li {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] ul[role="list"] li::before {
    left: auto;
    right: 0;
}

/* Mobile menu */
html[dir="rtl"] .mobile-nav {
    left: auto;
    right: 0;
}

/* Price filter slider */
html[dir="rtl"] .price_slider_amount .price_label {
    text-align: left;
}

/* Woodmart Elementor specific */
html[dir="rtl"] .wd-rtl {
    direction: rtl;
}

/* Arrow directions */
html[dir="rtl"] .woodmart-slideshow .woodmart-slide-arrow,
html[dir="rtl"] .wd-prev,
html[dir="rtl"] .wd-next {
    transform: scaleX(-1);
}

/* Large screens */
@media (min-width: 1024px) {
    html[dir="rtl"] .site-content {
        direction: rtl;
    }

    html[dir="rtl"] .col-2_3 {
        float: right;
        width: 66.66%;
    }

    html[dir="rtl"] .col-1_3 {
        float: left;
        width: 33.33%;
    }

    html[dir="rtl"] .col-1_4 {
        float: left;
        width: 25%;
    }

    html[dir="rtl"] .col-3_4 {
        float: right;
        width: 75%;
    }

    html[dir="rtl"] .with-sidebar-left .site-main {
        float: left;
        padding-right: 30px;
        padding-left: 0;
    }

    html[dir="rtl"] .with-sidebar-right .site-main {
        float: right;
        padding-left: 30px;
        padding-right: 0;
    }
}

/* Medium screens */
@media (max-width: 1024px) {
    html[dir="rtl"] .woodmart-header row {
        direction: rtl;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html[dir="rtl"] .woocommerce-checkout #payment ul {
        padding-right: 0;
    }

    html[dir="rtl"] table.shop_table_responsive tr td {
        text-align: right;
    }

    html[dir="rtl"] table.shop_table_responsive tr td:before {
        text-align: right;
        float: right;
    }
}
