/* ==========================================================================
   Cafe Bloom — Arabic / RTL overlays
   ========================================================================== */

body.rtl.cafe-bloom-app,
body.cb-is-arabic.cafe-bloom-app {
	direction: rtl;
	--cb-font: "Cairo", "DM Sans", system-ui, sans-serif;
}

body.rtl.cafe-bloom-app,
body.cb-is-arabic.cafe-bloom-app,
body.rtl .cb-app,
body.cb-is-arabic .cb-app {
	font-family: var(--cb-font);
}

body.rtl .cb-header,
body.cb-is-arabic .cb-header {
	direction: rtl;
}

/* Language switcher — header styles live in app.css */
.cb-sidebar__lang {
	padding: 8px 16px 12px;
	border-bottom: 1px solid var(--cb-border);
}

/* Keep money / counters LTR inside RTL (amounts only — not .price blocks) */
body.rtl .cb-cart-badge,
body.rtl .woocommerce-Price-amount,
body.rtl .cb-loyalty-bar__points,
body.rtl .cb-bottom-cart__total,
body.rtl .cb-bill .amount,
body.cb-is-arabic .cb-cart-badge,
body.cb-is-arabic .woocommerce-Price-amount {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Single product: title + price sit on the start edge (right in Arabic) */
body.rtl .cb-single-product__summary,
body.cb-is-arabic .cb-single-product__summary {
	text-align: start;
}

body.rtl .cb-single-product__summary .product_title,
body.rtl .cb-single-product__summary .price,
body.cb-is-arabic .cb-single-product__summary .product_title,
body.cb-is-arabic .cb-single-product__summary .price {
	text-align: start;
}

body.rtl .cb-single-product__summary .price .woocommerce-Price-amount,
body.cb-is-arabic .cb-single-product__summary .price .woocommerce-Price-amount {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Related product cards — price under title on the right */
body.rtl .cb-related__card,
body.cb-is-arabic .cb-related__card {
	text-align: start;
}

body.rtl .cb-related__title,
body.rtl .cb-related__price,
body.cb-is-arabic .cb-related__title,
body.cb-is-arabic .cb-related__price {
	text-align: start;
}

body.rtl .cb-related__price .woocommerce-Price-amount,
body.cb-is-arabic .cb-related__price .woocommerce-Price-amount {
	direction: ltr;
	unicode-bidi: isolate;
}

body.rtl .cb-product__price,
body.cb-is-arabic .cb-product__price {
	text-align: start;
}

body.rtl .cb-product__price .woocommerce-Price-amount,
body.cb-is-arabic .cb-product__price .woocommerce-Price-amount {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Back link chevron faces start edge in Arabic */
body.rtl .cb-back-link svg,
body.cb-is-arabic .cb-back-link svg {
	transform: scaleX(-1);
}

/* Loyalty bar: grow fill from the right in Arabic (markers already RTL via dir) */
body.rtl .cb-loyalty-bar__track,
body.cb-is-arabic .cb-loyalty-bar__track {
	transform: scaleX(-1);
}

/* Loyalty bar fills right→left in Arabic (opposite of English) */
body.rtl .cb-loyalty-bar__mark,
body.cb-is-arabic .cb-loyalty-bar__mark {
	transform: translateX(50%);
}

/* Flip chevrons / back-top sit naturally in RTL */
body.rtl .cb-back-top,
body.cb-is-arabic .cb-back-top {
	left: 16px;
	right: auto;
}

/* Reviews — text RTL, slider track LTR so carousel doesn't go blank */
body.rtl .cb-reviews,
body.cb-is-arabic .cb-reviews {
	direction: rtl;
	text-align: right;
}

body.rtl .cb-reviews__viewport,
body.rtl .cb-reviews__track,
body.rtl .cb-reviews__dots,
body.cb-is-arabic .cb-reviews__viewport,
body.cb-is-arabic .cb-reviews__track,
body.cb-is-arabic .cb-reviews__dots {
	direction: ltr;
}

body.rtl .cb-reviews__slide,
body.cb-is-arabic .cb-reviews__slide {
	direction: rtl;
	text-align: right;
}

body.rtl .cb-reviews__quote p,
body.cb-is-arabic .cb-reviews__quote p {
	text-align: right;
	unicode-bidi: plaintext;
}

body.rtl .cb-reviews__score,
body.cb-is-arabic .cb-reviews__score {
	direction: rtl;
}

body.rtl .cb-reviews__score strong,
body.cb-is-arabic .cb-reviews__score strong {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Checkout bill — logical alignment in Arabic */
body.rtl .cb-bill-table thead th,
body.cb-is-arabic .cb-bill-table thead th {
	text-transform: none;
	letter-spacing: 0;
}

body.rtl .cb-bill-table thead th.product-name,
body.rtl .cb-bill-table tbody td.product-name,
body.cb-is-arabic .cb-bill-table thead th.product-name,
body.cb-is-arabic .cb-bill-table tbody td.product-name {
	text-align: start !important;
}

body.rtl .cb-bill-table thead th.product-total,
body.rtl .cb-bill-table tbody td.product-total,
body.cb-is-arabic .cb-bill-table thead th.product-total,
body.cb-is-arabic .cb-bill-table tbody td.product-total {
	text-align: end !important;
	padding-left: 0;
	padding-inline-start: 12px;
}

body.rtl .cb-bill-line,
body.cb-is-arabic .cb-bill-line {
	text-align: start;
}

body.rtl .cb-bill-table tfoot th,
body.cb-is-arabic .cb-bill-table tfoot th {
	text-align: start !important;
}

body.rtl .cb-bill-table tfoot td,
body.cb-is-arabic .cb-bill-table tfoot td {
	text-align: end !important;
}

body.rtl .cb-bill .payment_box,
body.cb-is-arabic .cb-bill .payment_box {
	direction: rtl;
	text-align: right;
	unicode-bidi: plaintext;
}

/* Flip review carousel arrows in Arabic */
body.rtl .cb-reviews__btn svg,
body.cb-is-arabic .cb-reviews__btn svg {
	transform: scaleX(-1);
}

body.rtl .cb-reviews__btn--next svg,
body.cb-is-arabic .cb-reviews__btn--next svg {
	transform: none;
}

/* Related products arrows — same RTL flip */
body.rtl .cb-related__btn svg,
body.cb-is-arabic .cb-related__btn svg {
	transform: scaleX(-1);
}

body.rtl .cb-related__btn--next svg,
body.cb-is-arabic .cb-related__btn--next svg {
	transform: none;
}

/* Legal pages follow document dir attribute */
.cb-page .cb-legal[dir="rtl"] {
	text-align: right;
}

.cb-page .cb-legal[dir="rtl"] ul {
	padding-right: 1.2em;
	padding-left: 0;
}

@media (min-width: 900px) {
	body.rtl .cb-brand,
	body.cb-is-arabic .cb-brand {
		justify-content: var(--cb-logo-justify-desktop, flex-end);
	}
}
