/*
 * ReplitTheme CarParts — RTL (Right-to-Left) Stylesheet
 * Loaded automatically by WordPress for Arabic / RTL locales.
 * Uses flexbox direction reversal so all flex containers
 * auto-mirror smoothly without duplicating layout rules.
 *
 * Text Domain: carparts
 */

/* ============================================================
   GLOBAL RTL RESET
   ============================================================ */
body {
    direction: rtl;
    text-align: right;
}

/* Reverse flex containers globally */
.cp-flex,
.cp-flex-between,
.cp-header-inner,
.cp-header-right,
.cp-footer-bottom,
.cp-lang-switcher,
.cp-logo,
.post-meta,
.post-meta-item {
    flex-direction: row-reverse;
}

/* Reverse grid order where needed */
.cp-about-grid,
.cp-two-col {
    direction: rtl;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
body,
h1, h2, h3, h4, h5, h6,
p, li, label, th, td,
input, textarea, select,
.widget,
.comment-content {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', Arial, sans-serif;
}

/* ============================================================
   LISTS & INDENTATION
   ============================================================ */
ul, ol { padding-left: 0; padding-right: 1.5rem; }
.cp-nav-menu .sub-menu { left: auto; right: 0; }

/* WooCommerce list overrides */
.woocommerce ul.products { direction: rtl; }

/* ============================================================
   HEADER
   ============================================================ */
#cp-header .cp-header-inner { flex-direction: row-reverse; }
#cp-header .cp-logo { flex-direction: row-reverse; }

/* Dropdown: open to the left instead of right */
.cp-nav-menu .sub-menu { left: auto; right: 0; }
.cp-cart-count { right: auto; left: -5px; }

/* Mobile menu slides from the right */
@media (max-width: 900px) {
    .cp-nav-menu.open { flex-direction: column; }
    .cp-nav-menu .sub-menu { padding-left: 0; padding-right: 1rem; }
}

/* ============================================================
   BLOCKQUOTE
   ============================================================ */
blockquote {
    border-left: none;
    border-right: 4px solid var(--cp-primary);
    border-radius: var(--cp-radius-md) 0 0 var(--cp-radius-md);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#cp-back-to-top { right: auto; left: 2rem; }

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-to-content { left: auto; right: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.cp-footer-bottom { flex-direction: row-reverse; }
.cp-footer-widget ul li { text-align: right; }

/* ============================================================
   FORMS
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="password"],
textarea,
select {
    text-align: right;
    direction: rtl;
}

/* ============================================================
   TABLE
   ============================================================ */
th, td { text-align: right; }

/* ============================================================
   ELEMENTOR RTL COMPATIBILITY
   ============================================================ */
.elementor-section,
.elementor-column,
.elementor-widget-wrap {
    direction: rtl;
}
.elementor-icon-list-items { padding-right: 0; }

/* ============================================================
   WOOCOMMERCE RTL
   ============================================================ */
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    text-align: right;
}
.woocommerce .cart-collaterals { float: right; }
.woocommerce-checkout #payment ul.payment_methods { padding-right: 0; }

/* ============================================================
   POLYLANG / WPML LANGUAGE SWITCHER RTL
   ============================================================ */
.pll-parent-menu-item { direction: rtl; }
.wpml-ls-item { direction: rtl; }
