/*
 * Baha Digital — RTL overrides (loaded only when Arabic is active).
 * The layout is flex/grid based, so dir="rtl" on <html> flips ordering
 * automatically; this file handles the Arabic font stack, text alignment,
 * and the explicit left/right offsets the base CSS uses.
 */

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

/* Arabic-capable font stack (base theme fonts are Latin-first) */
html[dir="rtl"] body,
html[dir="rtl"] .bd-body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] .bd-title-xl,
html[dir="rtl"] .bd-title-lg,
html[dir="rtl"] .bd-lead,
html[dir="rtl"] .bd-nav-list,
html[dir="rtl"] .bd-kicker {
    font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Arial", sans-serif;
}

/* Default text flows right in RTL */
html[dir="rtl"] .bd-hero-copy,
html[dir="rtl"] .bd-section-heading,
html[dir="rtl"] .bd-card,
html[dir="rtl"] .bd-prose,
html[dir="rtl"] .bd-cta-panel,
html[dir="rtl"] .bd-empty-state,
html[dir="rtl"] .bd-contact-form label,
html[dir="rtl"] .bd-footer-shell,
html[dir="rtl"] .bd-generic-shell article {
    text-align: right;
}

/* Latin/technical fragments stay LTR so brand + codes read correctly */
html[dir="rtl"] code,
html[dir="rtl"] .bd-language-code,
html[dir="rtl"] .bd-price,
html[dir="rtl"] .woocommerce-Price-amount,
html[dir="rtl"] .bd-mini-cart__count,
html[dir="rtl"] [dir="ltr"] {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Keep checkout / funnel panels LTR (the Baha checkout app is RTL-aware itself) */
html[dir="rtl"] .bd-store-checkout,
html[dir="rtl"] .bd-saas-shell {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .bd-store-checkout__legacy {
    direction: rtl;
    text-align: right;
}

/* Language menu opens on the correct side */
html[dir="rtl"] .bd-language-menu {
    right: auto;
    left: 0;
}

/* Prose lists indent from the right */
html[dir="rtl"] .bd-prose ul,
html[dir="rtl"] .bd-prose ol {
    padding-right: 1.2rem;
    padding-left: 0;
}

/* Header actions + nav already flip via flex; nudge the skip link */
html[dir="rtl"] .bd-skip-link {
    left: auto;
    right: 1rem;
}

/* Mini-cart panel + WooCommerce tables align right */
html[dir="rtl"] .woocommerce table.shop_table th,
html[dir="rtl"] .woocommerce table.shop_table td,
html[dir="rtl"] .woocommerce-MyAccount-content {
    text-align: right;
}

/* Search form + inputs */
html[dir="rtl"] .bd-search-form input[type="search"],
html[dir="rtl"] .bd-contact-form input,
html[dir="rtl"] .bd-contact-form textarea {
    text-align: right;
}

/* Chips / meta rows wrap naturally; keep numbers LTR inside */
html[dir="rtl"] .bd-product-delivery-note__meta span bdi,
html[dir="rtl"] .bd-mini-cart__total strong {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Pagination flows right-to-left */
html[dir="rtl"] .bd-pagination .nav-links {
    flex-direction: row-reverse;
    justify-content: flex-end;
}
