/* ==========================================================================
   Der Meister — English / Arabic layer
   1. Language visibility (.dm-l spans)
   2. Arabic typography
   3. Right-to-left mirroring (only what the base CSS does not already
      handle with logical properties)
   ========================================================================== */

/* ------------------------------------------------ 1. language visibility */

html:not([data-dm-lang="ar"]) .dm-l--ar,
html[data-dm-lang="ar"] .dm-l--en {
	display: none !important;
}

/* --------------------------------------------------- 2. Arabic typography */

html[dir="rtl"] body,
html[dir="rtl"] body * {
	font-family: "Cairo", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

html[dir="rtl"] body {
	line-height: 1.75;
}

html[dir="rtl"] body .dm-bank__iban {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace !important;
}

/* Phone numbers, emails, IBANs, SKUs and prices stay left-to-right inside
   Arabic text so digits and symbols do not get scrambled. */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"],
html[dir="rtl"] .dm-bank__iban,
html[dir="rtl"] .dm-cart-row__sku,
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"] {
	direction: ltr;
	unicode-bidi: isolate;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"] {
	text-align: right;
}

/* ---------------------------------------------------- 3. RTL mirroring */

/* ---- header ---- */

html[dir="rtl"] .dm-search__input {
	padding: 11px 20px 11px 46px;
}

html[dir="rtl"] .dm-nav__caret,
html[dir="rtl"] .dm-nav__list ul.sub-menu,
html[dir="rtl"] .dm-nav__sub {
	text-align: right;
}

@media (max-width: 1024px) {
	html[dir="rtl"] .dm-nav__list ul.sub-menu,
	html[dir="rtl"] .dm-nav__sub {
		padding: 0 16px 8px 0;
	}
}

/* ---- toolbar search (products page) ---- */

html[dir="rtl"] .dm-toolbar__search input {
	padding: 11px 16px 11px 44px;
}

/* ---- home hero ---- */

html[dir="rtl"] .dm-hero__slide::before {
	background: linear-gradient(270deg, rgba(0,0,0,.92) 15%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.15) 100%);
}

html[dir="rtl"] .dm-hero__nav--prev { left: auto; right: 18px; }
html[dir="rtl"] .dm-hero__nav--next { right: auto; left: 18px; }
html[dir="rtl"] .dm-hero__dots { left: auto; right: 56px; }

@media (max-width: 700px) {
	html[dir="rtl"] .dm-hero__dots { right: 22px; }
}

/* Arrows point the other way. */
html[dir="rtl"] .dm-hero__nav svg,
html[dir="rtl"] .dm-gallery__nav svg,
html[dir="rtl"] .dm-products__back svg {
	transform: scaleX(-1);
}

/* ---- product cards / badges ---- */

html[dir="rtl"] .dm-card__badge { left: auto; right: 10px; }

/* ---- order steps (home + how-to-order): dashed connector and number ---- */

html[dir="rtl"] .dm-order__step::after,
html[dir="rtl"] .dm-osteps__step::after { right: auto; left: -8px; }

html[dir="rtl"] .dm-order__num,
html[dir="rtl"] .dm-osteps__num { right: auto; left: -14px; }

/* ---- single product ---- */

html[dir="rtl"] .dm-gallery__badges { left: auto; right: 14px; }
html[dir="rtl"] .dm-gallery__nav--prev { left: auto; right: 12px; }
html[dir="rtl"] .dm-gallery__nav--next { right: auto; left: 12px; }
html[dir="rtl"] .dm-gallery__expand { right: auto; left: 14px; }

html[dir="rtl"] .review-rating-field__stars { flex-direction: row; }

/* ---- cart ---- */

html[dir="rtl"] .dm-cart-table th,
html[dir="rtl"] .dm-cart-table td,
html[dir="rtl"] .dm-specs th,
html[dir="rtl"] .dm-specs td {
	text-align: right;
}

/* The hidden printable order card is positioned off-screen with `left`;
   keep it that way, but make its content read right-to-left. */
html[dir="rtl"] .dm-print-card {
	direction: rtl;
}

/* ---- notices ---- */

html[dir="rtl"] .dm-notice,
html[dir="rtl"] .notice {
	text-align: right;
}

/* ---- toast ---- */

html[dir="rtl"] .cart-toast {
	inset-inline-end: auto;
	inset-inline-start: var(--dm-space-6);
}
