/* ==========================================================================
   Mandala Bloom — RTL Overrides for Arabic
   Loaded conditionally only when is_rtl() is true.
   Covers all components: header, shop, product, cart, checkout, homepage.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography — Cairo for Arabic
   -------------------------------------------------------------------------- */

body {
	font-family: 'Cairo', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.mb-hero__title,
.mb-hero__card .mb-hero__title,
.mb-product-card__title,
.mb-testimonial-card__text,
.mb-occasions__label,
.mb-footer__brand-name,
.woocommerce div.product .product_title,
.woocommerce-loop-product__title,
.cart_totals h2,
.mb-addons__title,
.mb-thankyou-whatsapp__title {
	font-family: 'Cairo', 'Outfit', sans-serif;
	letter-spacing: 0;
}

/* Arabic body text — more line-height */
body,
p,
li,
label,
.mb-hero__description,
.mb-editorial__content p,
.mb-testimonial-card__text,
.mb-footer p,
.woocommerce div.product .woocommerce-product-details__short-description,
.woocommerce-checkout .form-row label {
	line-height: 1.75;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.35;
}


/* --------------------------------------------------------------------------
   2. Uppercase → disabled for Arabic
   -------------------------------------------------------------------------- */

.mb-btn,
.mb-text-upper,
.mb-label,
.mb-footer__heading,
.mb-trust-item__title,
.mb-category-tab,
.mb-addons__free-badge,
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.add_to_cart_button,
.woocommerce ul.products li.product a.product_type_variable,
.woocommerce div.product .single_add_to_cart_button,
.woocommerce div.product .variations label,
.woocommerce #place_order,
.woocommerce div.product .woocommerce-tabs ul.tabs li a,
.woocommerce .woocommerce-result-count,
.woocommerce-cart .coupon .button,
.woocommerce-cart button[name="update_cart"],
.wc-proceed-to-checkout a.checkout-button,
.mandala-delivery-selector__field label,
.mandala-delivery-selector__submit {
	text-transform: none !important;
	letter-spacing: 0 !important;
}


/* --------------------------------------------------------------------------
   3. Select Dropdown Arrow — flip to left side
   -------------------------------------------------------------------------- */

select,
.mb-select,
.mandala-delivery-selector__field select,
.woocommerce-checkout select,
.woocommerce-checkout .form-row select {
	background-position: left 0.85rem center !important;
	padding-inline-start: 2.5rem !important;
	padding-inline-end: 1rem !important;
}


/* --------------------------------------------------------------------------
   4. Numbers, Prices, Quantities — always LTR
   -------------------------------------------------------------------------- */

.woocommerce .price,
.woocommerce-Price-amount,
.mb-product-card__price,
.mandala-delivery-selector__fee-amount,
.mb-addon-item__price,
.cart_totals .woocommerce-Price-amount,
.woocommerce-checkout .order-total .woocommerce-Price-amount,
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="date"] {
	direction: ltr;
	display: inline-block;
}

/* Quantity — always LTR */
.woocommerce .quantity {
	direction: ltr;
}

/* Phone field — LTR input */
.woocommerce-checkout #billing_phone {
	direction: ltr;
	text-align: end;
}

/* Email — LTR */
.woocommerce-checkout #billing_email,
.mb-newsletter__form input[type="email"] {
	direction: ltr;
	text-align: start;
}


/* --------------------------------------------------------------------------
   5. Directional Icons — flip arrows/chevrons
   -------------------------------------------------------------------------- */

.mb-icon-directional,
.woocommerce nav.woocommerce-pagination a.next,
.woocommerce nav.woocommerce-pagination a.prev,
.woocommerce .woocommerce-breadcrumb .breadcrumb-separator {
	transform: scaleX(-1);
}

/* Blocksy nav dropdown arrow */
header[data-id="type-1"] nav .ct-toggle-dropdown-desktop svg {
	transform: none; /* Don't flip the down arrow */
}


/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */

/* Account icon + label */
.mb-header-account {
	flex-direction: row-reverse;
}

/* Mobile header — keep icon order */
header[data-id="type-1"] [data-device="mobile"] [data-column="end"] [data-items] {
	flex-direction: row-reverse;
}


/* --------------------------------------------------------------------------
   7. Hero — card position
   -------------------------------------------------------------------------- */

/* In RTL, card should be on the LEFT side visually */
body.home .mb-hero.mb-hero.wp-block-group {
	justify-content: flex-end !important;
	padding-left: clamp(3rem, 8vw, 10rem) !important;
	padding-right: 0 !important;
}

@media (max-width: 768px) {
	body.home .mb-hero.mb-hero.wp-block-group {
		align-items: center !important;
		padding-left: var(--mb-space-md) !important;
		padding-right: var(--mb-space-md) !important;
	}

	body.home .mb-hero__card {
		margin-inline: auto !important;
	}
}


/* --------------------------------------------------------------------------
   8. Shop — Category Tabs & Product Cards
   -------------------------------------------------------------------------- */

/* Product card text — right-aligned for Arabic */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	text-align: start;
}

/* Product card price */
.woocommerce ul.products li.product .price {
	justify-content: flex-start;
}

/* Category tabs — stay in natural RTL flow */
.mb-category-tabs {
	flex-direction: row;
}

/* Shop controls — flex-direction handled by logical properties, no override needed */


/* --------------------------------------------------------------------------
   9. Single Product
   -------------------------------------------------------------------------- */

/* Add-ons grid */
.mb-addon-item__content {
	flex-direction: row-reverse;
}

.mb-addon-item__info {
	text-align: start;
}

/* Card message toggle */
.mb-addons__card-toggle-text {
	flex-direction: row-reverse;
}

/* Availability notices — border on right for RTL */
.mandala-availability-notice {
	border-inline-start: none;
	border-inline-end: 3px solid;
}

.mandala-availability--whatsapp {
	border-inline-end-color: var(--mb-gold);
}

.mandala-availability--same-day {
	border-inline-end-color: var(--mb-success);
}

.mandala-availability--out-of-season {
	border-inline-end-color: #9E9E9E;
}


/* --------------------------------------------------------------------------
   10. Cart
   -------------------------------------------------------------------------- */

body.woocommerce-cart .ct-woocommerce-cart-form .cart_totals table td {
	text-align: start;
}

/* Remove button stays accessible */
.woocommerce-cart table.shop_table .product-remove {
	text-align: center;
}


/* --------------------------------------------------------------------------
   11. Checkout
   -------------------------------------------------------------------------- */

/* Payment method instructions — border flip */
.woocommerce-checkout #payment .payment_method_cod .payment_box {
	border-inline-start: none;
	border-inline-end: 3px solid var(--mb-gold);
}

.mb-thankyou-instructions--whish {
	border-inline-start: none;
	border-inline-end: 3px solid var(--mb-success);
}

.mb-thankyou-instructions--cod {
	border-inline-start: none;
	border-inline-end: 3px solid var(--mb-gold);
}

/* Whish checkout details */
.mb-whish-checkout__row {
	flex-direction: row-reverse;
}

/* Delivery date note */
.woocommerce-checkout #mandala_delivery_date_field .description {
	text-align: start;
}


/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

/* Payment badges */
.mb-footer-payments {
	flex-direction: row-reverse;
}

/* Footer social icons */
footer.ct-footer .ct-footer-socials {
	justify-content: flex-start;
}


/* --------------------------------------------------------------------------
   13. Delivery Bar
   -------------------------------------------------------------------------- */

.mandala-delivery-bar {
	flex-direction: row-reverse;
}


/* --------------------------------------------------------------------------
   14. Occasions — badge position
   -------------------------------------------------------------------------- */

.mb-occasions__tile p {
	inset-inline-start: auto;
	inset-inline-end: -10px;
}


/* --------------------------------------------------------------------------
   15. Stars / Ratings — keep LTR
   -------------------------------------------------------------------------- */

.mb-testimonial-card__stars,
.star-rating {
	direction: ltr;
	display: inline-block;
}


/* --------------------------------------------------------------------------
   16. WhatsApp Float — flip to left side
   -------------------------------------------------------------------------- */

.mb-whatsapp-float {
	inset-inline-end: auto;
	inset-inline-start: var(--mb-space-xl);
}

@media (max-width: 480px) {
	.mb-whatsapp-float {
		inset-inline-start: var(--mb-space-md);
	}
}


/* --------------------------------------------------------------------------
   16. My Account — RTL
   -------------------------------------------------------------------------- */

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
	text-align: right;
}
