/* Arabic RTL Fixes for DarDecors - v1.2 */

/* Import Arabic-optimized font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* Override theme font variables for Arabic */
html[lang="ar"],
html[lang="ar"] body,
body.rtl,
body.lang-ar {
    --dekoro-main-font: 'Cairo', 'Noto Sans Arabic', sans-serif !important;
    --dekoro-heading-font: 'Cairo', 'Noto Sans Arabic', sans-serif !important;
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Force Cairo font on all text elements */
html[lang="ar"] *,
body.rtl *,
body.lang-ar * {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif !important;
}

/* RTL text alignment fixes */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p,
html[lang="ar"] li,
html[lang="ar"] span,
html[lang="ar"] a,
html[lang="ar"] .elementor-widget-text-editor,
html[lang="ar"] .elementor-heading-title {
    text-align: right !important;
    direction: rtl !important;
}

/* Fix Elementor columns for RTL */
html[lang="ar"] .elementor-row {
    flex-direction: row-reverse !important;
}

html[lang="ar"] .elementor-section .elementor-container {
    flex-direction: row-reverse !important;
}

/* Fix header navigation RTL */
html[lang="ar"] .site-header,
html[lang="ar"] header,
html[lang="ar"] .elementor-nav-menu,
html[lang="ar"] .primary-menu {
    direction: rtl !important;
}

html[lang="ar"] .elementor-nav-menu--main .elementor-nav-menu {
    flex-direction: row-reverse !important;
}

/* Fix logo positioning */
html[lang="ar"] .site-branding,
html[lang="ar"] .elementor-widget-theme-site-logo {
    text-align: right !important;
}

/* Fix WooCommerce elements for RTL */
html[lang="ar"] .woocommerce-products-header,
html[lang="ar"] .woocommerce ul.products,
html[lang="ar"] .products {
    direction: rtl !important;
}

html[lang="ar"] .woocommerce ul.products li.product {
    float: right !important;
    text-align: right !important;
}

html[lang="ar"] .woocommerce .product .price,
html[lang="ar"] .woocommerce-Price-amount {
    direction: ltr !important;
    display: inline-block;
}

/* Fix cart and checkout RTL */
html[lang="ar"] .woocommerce-cart,
html[lang="ar"] .woocommerce-checkout {
    direction: rtl !important;
}

html[lang="ar"] .woocommerce table.cart th,
html[lang="ar"] .woocommerce table.cart td {
    text-align: right !important;
}

/* Fix buttons alignment */
html[lang="ar"] .elementor-button-wrapper {
    text-align: right !important;
}

html[lang="ar"] .elementor-button-content-wrapper {
    flex-direction: row-reverse !important;
}

html[lang="ar"] .elementor-button-icon {
    order: 2 !important;
    margin-left: 0 !important;
    margin-right: 10px !important;
}

/* Fix icon boxes RTL */
html[lang="ar"] .elementor-widget-icon-box .elementor-icon-box-wrapper {
    flex-direction: row-reverse !important;
}

html[lang="ar"] .elementor-widget-icon-box .elementor-icon-box-icon {
    margin-left: 15px !important;
    margin-right: 0 !important;
}

html[lang="ar"] .elementor-widget-icon-box .elementor-icon-box-content {
    text-align: right !important;
}

/* Fix footer RTL */
html[lang="ar"] footer,
html[lang="ar"] .site-footer {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix form fields RTL */
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix breadcrumbs RTL */
html[lang="ar"] .woocommerce-breadcrumb,
html[lang="ar"] .breadcrumbs {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix sidebar RTL */
html[lang="ar"] .widget,
html[lang="ar"] aside {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix list items */
html[lang="ar"] ul,
html[lang="ar"] ol {
    padding-right: 20px !important;
    padding-left: 0 !important;
}

/* Fix product gallery RTL */
html[lang="ar"] .woocommerce-product-gallery {
    float: right !important;
}

html[lang="ar"] .woocommerce div.product div.summary {
    float: left !important;
}

/* Fix tabs RTL */
html[lang="ar"] .woocommerce-tabs ul.tabs {
    direction: rtl !important;
}

html[lang="ar"] .woocommerce-tabs ul.tabs li {
    float: right !important;
}

/* Fix quantity selector - keep LTR for numbers */
html[lang="ar"] .quantity {
    direction: ltr !important;
}

/* Fix WhatsApp button position for RTL */
html[lang="ar"] .cht-position-br {
    left: 25px !important;
    right: auto !important;
}

/* Ensure phone numbers stay LTR */
html[lang="ar"] a[href^="tel:"] {
    direction: ltr !important;
    unicode-bidi: embed;
}

/* Fix search form RTL */
html[lang="ar"] .search-form {
    direction: rtl !important;
}

html[lang="ar"] .search-form input[type="search"] {
    text-align: right !important;
    padding-right: 15px !important;
}
