/**
 * Woodmart Arabic RTL - Main Styles
 * الإصلاحات الشاملة لجميع مشاكل RTL
 */

/* ============================================
   BASE RTL STYLES
   ============================================ */

/* HTML Direction */
html[dir="rtl"] {
    direction: rtl;
    unicode-bidi: plaintext;
}

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

/* Typography */
html[dir="rtl"] * {
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

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

/* Header Layout */
html[dir="rtl"] .whb-header {
    direction: rtl;
}

html[dir="rtl"] .whb-flex-grow {
    flex-direction: row-reverse;
}

html[dir="rtl"] .whb-row {
    direction: rtl;
}

/* Logo Alignment */
html[dir="rtl"] .whb-logo-wrap {
    margin-left: auto;
    margin-right: 0;
}

/* Navigation Menu */
html[dir="rtl"] .wd-nav-wrap {
    direction: rtl;
}

html[dir="rtl"] .wd-nav > li {
    float: right;
}

html[dir="rtl"] .wd-nav li {
    text-align: right;
}

html[dir="rtl"] .wd-nav li a {
    direction: rtl;
    text-align: right;
}

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

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

html[dir="rtl"] .wd-dropdown-menu li {
    text-align: right;
}

html[dir="rtl"] .wd-dropdown-menu li a {
    text-align: right;
    direction: rtl;
}

/* Sub-menu arrow */
html[dir="rtl"] .wd-nav-opener {
    left: 0;
    right: auto;
    transform: rotate(180deg);
}

/* ============================================
   SEARCH BAR
   ============================================ */

/* Main Search */
html[dir="rtl"] .wd-search-form {
    direction: rtl;
}

html[dir="rtl"] .wd-search-form input[type="text"],
html[dir="rtl"] .wd-search-form input[type="search"] {
    text-align: right;
    padding-right: 15px;
    padding-left: 40px;
    direction: rtl;
}

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

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

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

/* Search in header */
html[dir="rtl"] .whb-search-form {
    direction: rtl;
}

/* ============================================
   MOBILE MENU
   ============================================ */

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

html[dir="rtl"] .mobile-nav .wd-mobile-menu {
    text-align: right;
}

html[dir="rtl"] .mobile-nav li {
    text-align: right;
}

html[dir="rtl"] .mobile-nav li a {
    text-align: right;
    direction: rtl;
}

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

/* ============================================
   SIDEBAR & WIDGETS
   ============================================ */

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

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

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

html[dir="rtl"] .widget ul {
    padding-right: 0;
    padding-left: 0;
}

html[dir="rtl"] .widget li {
    text-align: right;
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .widget li::before {
    left: auto;
    right: 0;
}

/* ============================================
   WOOCOMMERCE PRODUCTS
   ============================================ */

/* Product Grid */
html[dir="rtl"] .products {
    direction: rtl;
}

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

html[dir="rtl"] ul.products {
    padding-right: 0;
}

/* Product Title */
html[dir="rtl"] .woocommerce-loop-product__title,
html[dir="rtl"] .woodmart-product-title,
html[dir="rtl"] .product-title,
html[dir="rtl"] .wd-product-title {
    text-align: right;
    direction: rtl;
}

/* Product Price */
html[dir="rtl"] .price {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] .woocommerce-Price-amount {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

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

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

html[dir="rtl"] .onsale {
    left: auto;
    right: 10px;
}

/* Product Actions */
html[dir="rtl"] .product-actions {
    direction: rtl;
}

html[dir="rtl"] .wd-add-btn {
    left: 10px;
    right: auto;
}

/* Quick View Button */
html[dir="rtl"] .quick-view-btn {
    left: 10px;
    right: auto;
}

/* Compare Button */
html[dir="rtl"] .compare-btn {
    left: 10px;
    right: auto;
}

/* ============================================
   SHOPPING CART
   ============================================ */

/* Cart Icon */
html[dir="rtl"] .wd-header-cart {
    direction: rtl;
}

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

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

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

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

/* Mini Cart */
html[dir="rtl"] .woodmart-cart-contents {
    direction: rtl;
}

html[dir="rtl"] .woodmart-cart-contents .wd-icon {
    transform: none;
}

/* ============================================
   WOOCOMMERCE CHECKOUT
   ============================================ */

/* Checkout Page */
html[dir="rtl"] .woocommerce-checkout {
    direction: rtl;
}

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

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

html[dir="rtl"] .col2-set .col-2 {
    float: left;
}

/* Checkout Form */
html[dir="rtl"] .woocommerce-checkout form {
    text-align: right;
}

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

html[dir="rtl"] .woocommerce-checkout .form-row label {
    text-align: right;
}

html[dir="rtl"] .woocommerce-checkout input[type="text"],
html[dir="rtl"] .woocommerce-checkout input[type="email"],
html[dir="rtl"] .woocommerce-checkout input[type="tel"],
html[dir="rtl"] .woocommerce-checkout textarea {
    text-align: right;
    direction: rtl;
}

/* Payment Methods */
html[dir="rtl"] #payment ul {
    padding-left: 0;
    padding-right: 1.5em;
}

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

/* ============================================
   WOOCOMMERCE MY ACCOUNT
   ============================================ */

/* Account Navigation */
html[dir="rtl"] .woocommerce-MyAccount-navigation {
    text-align: right;
}

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

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

html[dir="rtl"] .woocommerce-MyAccount-navigation ul li a {
    text-align: right;
    direction: rtl;
}

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

/* ============================================
   COMMENTS & REVIEWS
   ============================================ */

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

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

/* Comment Form */
html[dir="rtl"] .comment-form {
    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-comment {
    text-align: right;
}

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

/* Comment List */
html[dir="rtl"] .commentlist {
    padding-right: 0;
}

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

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

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

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

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

/* ============================================
   BREADCRUMBS
   ============================================ */

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

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

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

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

/* WooCommerce Messages */
html[dir="rtl"] .woocommerce-message,
html[dir="rtl"] .woocommerce-info,
html[dir="rtl"] .woocommerce-error,
html[dir="rtl"] .woocommerce-success {
    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;
}

html[dir="rtl"] .woocommerce-message .button {
    float: left;
}

/* ============================================
   BUTTONS
   ============================================ */

/* General Buttons */
html[dir="rtl"] .button,
html[dir="rtl"] .btn,
html[dir="rtl"] .woocommerce a.button,
html[dir="rtl"] .woocommerce button.button {
    direction: rtl;
    text-align: center;
}

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

/* ============================================
   TABS
   ============================================ */

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

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

html[dir="rtl"] .woocommerce-tabs ul.tabs li a {
    text-align: right;
}

/* ============================================
   IMAGES & GALLERY
   ============================================ */

/* Product Images */
html[dir="rtl"] .woocommerce-product-gallery {
    float: right;
}

html[dir="rtl"] .woocommerce-product-gallery__wrapper {
    direction: rtl;
}

/* Thumbnails */
html[dir="rtl"] .thumbnails {
    direction: rtl;
}

html[dir="rtl"] .flex-control-thumbs {
    direction: rtl;
}

html[dir="rtl"] .flex-control-thumbs li {
    float: right;
}

/* Gallery */
html[dir="rtl"] .gallery {
    direction: rtl;
}

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

/* ============================================
   TABLES
   ============================================ */

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

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

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

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

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

/* Cart Table */
html[dir="rtl"] .woocommerce-cart-form {
    text-align: right;
}

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

/* ============================================
   VARIATIONS
   ============================================ */

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

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

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

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

/* ============================================
   COUPON
   ============================================ */

/* Coupon Form */
html[dir="rtl"] .woocommerce-form-coupon {
    text-align: right;
}

html[dir="rtl"] .coupon {
    direction: rtl;
}

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

/* ============================================
   SHIPPING CALCULATOR
   ============================================ */

/* Shipping Calculator */
html[dir="rtl"] .shipping-calculator-form {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .shipping-calculator-form select,
html[dir="rtl"] .shipping-calculator-form input {
    direction: rtl;
    text-align: right;
}

/* ============================================
   PRICE SLIDER
   ============================================ */

/* Price Filter Widget */
html[dir="rtl"] .price_slider_amount {
    direction: rtl;
}

html[dir="rtl"] .price_slider_amount .price_label {
    text-align: left;
}

/* ============================================
   FORMS
   ============================================ */

/* All Forms */
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;
    direction: rtl;
    padding-right: 15px;
    padding-left: 15px;
}

/* Placeholder */
html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
    text-align: right;
    direction: rtl;
}

/* ============================================
   SELECT2
   ============================================ */

/* Select2 Dropdown */
html[dir="rtl"] .select2-container--default {
    direction: rtl;
}

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

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

html[dir="rtl"] .select2-container--default .select2-search--dropdown .select2-search__field {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .select2-container--default .select2-results__option {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .select2-container--default .select2-results > .select2-results__options {
    direction: rtl;
}

/* ============================================
   ICONS & BUTTONS
   ============================================ */

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

/* Header Icons */
html[dir="rtl"] .wd-header-cart .wd-icon {
    transform: none !important;
}

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

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

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

/* ============================================
   FOOTER
   ============================================ */

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

html[dir="rtl"] .footer-widget-area {
    direction: rtl;
}

/* Copyright */
html[dir="rtl"] .woodmart-footer-menu {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .woodmart-footer-menu li {
    float: right;
    margin-right: 0;
    margin-left: 15px;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

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

html[dir="rtl"] .wd-scroll-to-top {
    left: 20px;
    right: auto;
}

/* ============================================
   SOCIAL ICONS
   ============================================ */

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

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

/* ============================================
   BLOG
   ============================================ */

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

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

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

/* Blockquote */
html[dir="rtl"] blockquote {
    border-left: none;
    border-right: 3px solid var(--wd-primary-color, #c77dff);
    padding-right: 20px;
    padding-left: 0;
    text-align: right;
    direction: rtl;
}

/* ============================================
   LIST STYLES
   ============================================ */

/* UL/OL Lists */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-right: 25px;
    padding-left: 0;
    text-align: right;
}

html[dir="rtl"] li {
    text-align: right;
}

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

/* ============================================
   GRID LAYOUTS
   ============================================ */

/* Columns */
html[dir="rtl"] .col-2_3 {
    float: right;
}

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

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

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

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

/* ============================================
   ALIGNMENTS
   ============================================ */

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

html[dir="rtl"] .aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   MODAL & POPUP
   ============================================ */

/* Quick View Modal */
html[dir="rtl"] .wd-popup-quick-view {
    direction: rtl;
}

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

/* Modal */
html[dir="rtl"] .modal {
    direction: rtl;
}

html[dir="rtl"] .modal-dialog {
    direction: rtl;
}

/* ============================================
   LOADING & SPINNER
   ============================================ */

/* Loading */
html[dir="rtl"] .woodmart-loading {
    direction: ltr;
}

/* ============================================
   TAGS WIDGET
   ============================================ */

/* Tag Cloud */
html[dir="rtl"] .tagcloud,
html[dir="rtl"] .widget_tag_cloud .tagcloud {
    text-align: right;
}

html[dir="rtl"] .tagcloud a {
    direction: rtl;
}

/* ============================================
   RESPONSIVE RTL
   ============================================ */

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

    html[dir="rtl"] .whb-col {
        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;
    }

    html[dir="rtl"] .products {
        direction: rtl;
    }

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

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

/* Header Builder */
html[dir="rtl"] .whb-header {
    direction: rtl;
}

html[dir="rtl"] .whb-box {
    direction: rtl;
}

/* Product Categories */
html[dir="rtl"] .product-category {
    direction: rtl;
}

/* Swatches */
html[dir="rtl"] .woodmart-swatch {
    direction: rtl;
}

/* Wishlist Table */
html[dir="rtl"] .wishlist-table {
    direction: rtl;
}

/* Compare Table */
html[dir="rtl"] .compare-table {
    direction: rtl;
}

/* Quick Shop */
html[dir="rtl"] .quick-shop {
    direction: rtl;
    text-align: right;
}

/* ============================================
   WIDGETS
   ============================================ */

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

html[dir="rtl"] .widget_product_search input[type="submit"],
html[dir="rtl"] .widget_search input[type="submit"] {
    left: 0;
    right: auto;
}

/* Price Filter */
html[dir="rtl"] .woocommerce-widget-layered-nav-list {
    direction: rtl;
}

html[dir="rtl"] .woocommerce-widget-layered-nav-list li {
    text-align: right;
    direction: rtl;
}

/* Recent Reviews */
html[dir="rtl"] .woocommerce-widget-rating .star-rating {
    direction: ltr;
}

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

/* ============================================
   ORDER DETAILS
   ============================================ */

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

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

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

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

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

/* ============================================
   ACCOUNT ORDERS TABLE
   ============================================ */

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

/* ============================================
   FINAL OVERRIDES
   ============================================ */

/* Force RTL for all elements */
html[dir="rtl"] * {
    direction: rtl !important;
}

/* Except prices and numbers */
html[dir="rtl"] .price,
html[dir="rtl"] .amount,
html[dir="rtl"] .woocommerce-Price-amount,
html[dir="rtl"] bdi,
html[dir="rtl"] .wc-block-components-product-price__value,
html[dir="rtl"] .star-rating,
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] .quantity {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

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

/* ============================================
   FIX FORCED OPEN MENUS & OVERLAYS
   ============================================ */

/* Hide overlays by default in RTL */
html[dir="rtl"] .wd-overlay,
html[dir="rtl"] .woodmart-overlay,
html[dir="rtl"] .whb-overlay,
html[dir="rtl"] .whb-overlay-wh,
html[dir="rtl"] .whb-overlay-wh-bl,
html[dir="rtl"] .whb-overlay-wh-bcl {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Only show on click */
html[dir="rtl"] .wd-overlay.active,
html[dir="rtl"] .woodmart-overlay.active,
html[dir="rtl"] .wd-overlay.show,
html[dir="rtl"] .woodmart-overlay.show,
html[dir="rtl"] .wd-toolbar-side.active,
html[dir="rtl"] .woodmart-side-shadow {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Cart sidebar RTL */
html[dir="rtl"] .wd-widget-collapse.wd-opened > * {
    display: none !important;
}

html[dir="rtl"] .wd-widget-collapse > *:first-child {
    display: block !important;
}

/* Fix shopping cart sidebar - AGGRESSIVE RTL FIX */
html[dir="rtl"] .wd-shopping-cart,
html[dir="rtl"] .woodmart-shopping-cart,
html[dir="rtl"] .wd-cart-widget,
html[dir="rtl"] .woodmart-cart-widget,
html[dir="rtl"] .widget_shopping_cart,
html[dir="rtl"] .woodmart_widget_cart,
html[dir="rtl"] .whb-sidebar-content,
html[dir="rtl"] .wd-toolbar-side,
html[dir="rtl"] .woodmart-toolbar-side {
    transform: translateX(100%) !important;
    right: 0 !important;
    left: auto !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
    position: fixed !important;
}

/* Force hide any visible cart on page load */
html[dir="rtl"] body .wd-shopping-cart:not(.wd-loading),
html[dir="rtl"] body .woodmart-shopping-cart:not(.wd-loading) {
    display: none !important;
    visibility: hidden !important;
}

/* Only show cart when explicitly opened */
html[dir="rtl"] .wd-shopping-cart.wd-opened,
html[dir="rtl"] .woodmart-shopping-cart.wd-opened,
html[dir="rtl"] .wd-cart-widget.wd-opened,
html[dir="rtl"] .woodmart-cart-widget.wd-opened,
html[dir="rtl"] .wd-shopping-cart.opened,
html[dir="rtl"] .woodmart-shopping-cart.opened,
html[dir="rtl"] .wd-shopping-cart.show,
html[dir="rtl"] .woodmart-shopping-cart.show,
html[dir="rtl"] .whb-sidebar-content.show,
html[dir="rtl"] .whb-sidebar-content.opened,
html[dir="rtl"] .wd-toolbar-side.active,
html[dir="rtl"] .woodmart-toolbar-side.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
    position: fixed !important;
}

/* Fix cart button */
html[dir="rtl"] .wd-header-cart,
html[dir="rtl"] .woodmart-header-cart {
    position: relative !important;
}

html[dir="rtl"] .wd-header-cart .wd-dropdown,
html[dir="rtl"] .woodmart-header-cart .wd-dropdown {
    right: auto !important;
    left: 0 !important;
}

html[dir="rtl"] .wd-header-cart:hover .wd-dropdown,
html[dir="rtl"] .woodmart-header-cart:hover .wd-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Close button position for RTL */
html[dir="rtl"] .wd-close-sidebar-btn,
html[dir="rtl"] .woodmart-close-side-btn,
html[dir="rtl"] .wd-close-filter,
html[dir="rtl"] button.wd-close-sidebar-btn {
    left: 20px !important;
    right: auto !important;
}

/* Mobile menu overlay fix */
html[dir="rtl"] .mobile-nav-offcanvas .wd-nav-mobile {
    transform: translateX(-100%);
}

html[dir="rtl"] .mobile-nav-offcanvas.opened .wd-nav-mobile,
html[dir="rtl"] .mobile-nav-offcanvas.show .wd-nav-mobile {
    transform: translateX(0);
}

/* Prevent menus from staying open */
html[dir="rtl"] .wd-dropdown-menu,
html[dir="rtl"] .wd-sub-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px) !important;
    transition: all 0.2s ease !important;
}

html[dir="rtl"] .wd-dropdown-menu.opened,
html[dir="rtl"] .wd-dropdown-menu.show,
html[dir="rtl"] .wd-dropdown-menu.active,
html[dir="rtl"] .wd-nav li:hover > .wd-dropdown-menu,
html[dir="rtl"] .wd-nav li:focus-within > .wd-dropdown-menu,
html[dir="rtl"] .wd-nav li.menus-hover > .wd-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* Fix dropdowns position in RTL */
html[dir="rtl"] .wd-nav > li > .wd-dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

html[dir="rtl"] .wd-nav .wd-sub-menu > li > .wd-dropdown-menu,
html[dir="rtl"] .wd-nav .children > li > .wd-dropdown-menu {
    left: auto !important;
    right: 100% !important;
}

/* Menu toggle button */
html[dir="rtl"] .wd-nav-opener {
    transform: rotate(180deg) !important;
}

html[dir="rtl"] .wd-nav li:hover .wd-nav-opener,
html[dir="rtl"] .wd-nav li.menus-hover .wd-nav-opener {
    transform: rotate(90deg) !important;
}

/* Categories sidebar */
html[dir="rtl"] .woodmart-product-categories {
    direction: rtl;
}

html[dir="rtl"] .woodmart-product-categories li {
    text-align: right;
}

/* Category menu items */
html[dir="rtl"] .product-categories li,
html[dir="rtl"] .product-categories .cat-item {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .product-categories li a {
    direction: rtl;
    text-align: right;
}

/* Fix filter sidebar */
html[dir="rtl"] .wd-filter-area {
    direction: rtl;
}

html[dir="rtl"] .wd-filter-area .filter-swatch {
    transform: rotate(180deg);
}

/* Fix woodmart header tabs */
html[dir="rtl"] .woodmart-tabs-wrapper {
    direction: rtl;
}

html[dir="rtl"] .woodmart-tabs-navigation li {
    direction: rtl;
    text-align: right;
}

/* Quick view modal */
html[dir="rtl"] .wd-quick-view-popup {
    direction: rtl;
}

html[dir="rtl"] .wd-quick-view-close {
    left: 20px !important;
    right: auto !important;
}

/* Remove forced categories visibility */
html[dir="rtl"] .woodmart-product-categories.collapse-auto {
    height: auto !important;
    overflow: visible !important;
}

html[dir="rtl"] .woodmart-product-categories.collapse-auto > li {
    height: auto !important;
    overflow: visible !important;
}

html[dir="rtl"] .woodmart-product-categories.collapse-auto .children {
    display: none !important;
}

html[dir="rtl"] .woodmart-product-categories.collapse-auto li:hover > .children,
html[dir="rtl"] .woodmart-product-categories.collapse-auto li:focus-within > .children,
html[dir="rtl"] .woodmart-product-categories.collapse-auto li.open > .children {
    display: block !important;
}

/* Fix section headers */
html[dir="rtl"] .woodmart-title-wrapper {
    direction: rtl;
}

html[dir="rtl"] .woodmart-products-shop-view {
    direction: rtl;
}

/* Product grid */
html[dir="rtl"] .products-grid {
    direction: rtl;
}

html[dir="rtl"] .products-view-content {
    direction: rtl;
}

/* Footer */
html[dir="rtl"] .woodmart-footer-sidebar {
    direction: rtl;
}

html[dir="rtl"] .woodmart-footer-menu li {
    direction: rtl;
    text-align: right;
}