/**
 * B1 Moto Engine — right-to-left overrides.
 *
 * Loaded when the locale is RTL, and is enqueued AFTER it, so it
 * only needs to flip what is directional.
 *
 * Grid and flex axes reverse on their own under `direction: rtl`, so the
 * layout containers need nothing here. What does need flipping is anything
 * pinned with left/right, the select chevron's background-position, and
 * text-align.
 */

/* --- Typeface: Archivo has no Arabic glyphs -------------------------- */

.b1m,
.b1m-app {
	font-family: "IBM Plex Sans Arabic", Archivo, "Helvetica Neue", Arial, sans-serif;
}

/* Latin model names and codes keep the Latin face. */
.b1m-card__meta,
.b1m-suggest__meta {
	font-family: Archivo, "IBM Plex Sans Arabic", Arial, sans-serif;
}

/* --- Select chevron: move to the left edge, pad the other side --------- */

.b1m select.b1m-input,
.b1m-app select.b1m-input {
	padding-right: 15px !important;
	padding-left: 40px !important;
	/* The 45deg half is the LEFT edge of the triangle and the 135deg half
	   the right, so their positions swap as a pair — reversing only the
	   offsets turns the arrow into a pennant. */
	background-position: 15px 50%, 20px 50% !important;
}

/* --- Search box: icon right, clear button left ------------------------ */

.b1m-search__icon {
	left: auto;
	right: 15px;
}

.b1m input.b1m-input.b1m-input--search,
.b1m-app input.b1m-input.b1m-input--search {
	padding-left: 46px !important;
	padding-right: 44px !important;
}

.b1m-search__clear {
	right: auto;
	left: 8px;
}

/* --- Hero: the scrim must darken the side the text sits on ------------ */

.b1m-hero__scrim {
	background: linear-gradient(270deg, rgba(10, 10, 12, 0.94) 0%, rgba(10, 10, 12, 0.78) 42%, rgba(10, 10, 12, 0.15) 100%);
}

@media (max-width: 782px) {
	.b1m-hero__scrim {
		background: linear-gradient(180deg, rgba(10, 10, 12, 0.5) 0%, rgba(10, 10, 12, 0.95) 72%);
	}
}

/* --- Card chips ------------------------------------------------------- */

.b1m-chip--year,
.b1m-chip--ask {
	left: auto;
	right: 12px;
}

.b1m-chip--cat {
	right: auto;
	left: 12px;
}

/* --- Spec sheet ------------------------------------------------------- */

.b1m-sheet th,
.b1m-sheet td {
	text-align: right;
}

/* --- Numbers stay left-to-right -------------------------------------- */

/*
 * Prices, mileage and engine sizes are Latin numerals with a unit. Without
 * an explicit direction the unit jumps to the wrong side of the number
 * inside an RTL paragraph — "23,000 ج.م" renders as "ج.م 23,000".
 */
.b1m-card__price,
.b1m-single__price,
.b1m-hero__price,
.b1m-output,
.b1m-specs dd,
.b1m-suggest__price {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: right;
}

.b1m-page {
	direction: ltr;
}

/* --- Pagination arrows point the other way --------------------------- */

/* Mirroring the glyph beats swapping it with ::before, which left the
   original arrow visible behind the replacement. */
.b1m .b1m-page--prev,
.b1m-app .b1m-page--prev,
.b1m .b1m-page--next,
.b1m-app .b1m-page--next {
	transform: scaleX(-1);
}
