/* Woodmart Arabic RTL Styles */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

/* Set RTL direction */
html[dir="rtl"] body,
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* 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 {
    font-family: 'Tajawal', sans-serif !important;
}

/* Margin & Padding */
html[dir="rtl"] {
    margin-left: 0;
    margin-right: 0;
}

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

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

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

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

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

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

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

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

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

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

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

/* Vendor */
html[dir="rtl"] .woocompare-full-wrapper {
    left: 0;
    right: auto;
}

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

/* RTL Fixes for Woodmart specific */
html[dir="rtl"] .wd-header-cart .wd-icon {
    transform: none;
}

html[dir="rtl"] .wd-header-wishlist .wd-icon {
    transform: none;
}

html[dir="rtl"] .wd-header-compare .wd-icon {
    transform: none;
}

html[dir="rtl"] .wd-search-button .wd-icon {
    transform: none;
}

/* Text decorations */
html[dir="rtl"] .woodmart-highlighted-text,
html[dir="rtl"] .has-inline-color {
    direction: ltr;
}

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

/* Blog */
html[dir="rtl"] .entry-header {
    text-align: right;
}

html[dir="rtl"] .entry-content {
    text-align: right;
}

html[dir="rtl"] .post-password-form label {
    text-align: right;
}

html[dir="rtl"] .wp-caption {
    text-align: right;
}

html[dir="rtl"] .wp-caption-text {
    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;
}

/* Images */
html[dir="rtl"] .wp-image-296 {
    float: right;
    margin-left: 1em;
    margin-right: 0;
}

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

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

html[dir="rtl"] .gallery-columns-2 .gallery-item:nth-child(2n+1),
html[dir="rtl"] .gallery-columns-3 .gallery-item:nth-child(3n+1) {
    clear: right;
}

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

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

/* Recent comments */
html[dir="rtl"] .recentcomments {
    direction: rtl;
    text-align: right;
}

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

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

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

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

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

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

/* RTL Utilities */
html[dir="rtl"] .mr-0 { margin-right: 0 !important; }
html[dir="rtl"] .mr-1 { margin-right: 0.25rem !important; }
html[dir="rtl"] .mr-2 { margin-right: 0.5rem !important; }
html[dir="rtl"] .mr-3 { margin-right: 1rem !important; }
html[dir="rtl"] .mr-4 { margin-right: 1.5rem !important; }
html[dir="rtl"] .mr-5 { margin-right: 3rem !important; }

html[dir="rtl"] .ml-0 { margin-left: 0 !important; }
html[dir="rtl"] .ml-1 { margin-left: 0.25rem !important; }
html[dir="rtl"] .ml-2 { margin-left: 0.5rem !important; }
html[dir="rtl"] .ml-3 { margin-left: 1rem !important; }
html[dir="rtl"] .ml-4 { margin-left: 1.5rem !important; }
html[dir="rtl"] .ml-5 { margin-left: 3rem !important; }

html[dir="rtl"] .pr-0 { padding-right: 0 !important; }
html[dir="rtl"] .pr-1 { padding-right: 0.25rem !important; }
html[dir="rtl"] .pr-2 { padding-right: 0.5rem !important; }
html[dir="rtl"] .pr-3 { padding-right: 1rem !important; }
html[dir="rtl"] .pr-4 { padding-right: 1.5rem !important; }
html[dir="rtl"] .pr-5 { padding-right: 3rem !important; }

html[dir="rtl"] .pl-0 { padding-left: 0 !important; }
html[dir="rtl"] .pl-1 { padding-left: 0.25rem !important; }
html[dir="rtl"] .pl-2 { padding-left: 0.5rem !important; }
html[dir="rtl"] .pl-3 { padding-left: 1rem !important; }
html[dir="rtl"] .pl-4 { padding-left: 1.5rem !important; }
html[dir="rtl"] .pl-5 { padding-left: 3rem !important; }
