/**
 * Right-to-left overrides for Arabic, Persian, Hebrew, Urdu and other RTL languages.
 * Loaded only on RTL language versions, after the theme stylesheet.
 *
 * The theme is built with logical flex/grid layout, so most columns mirror
 * automatically. This file fixes the remaining physical properties
 * (left/right offsets, borders, paddings, gradients, floats, icons).
 */

/* ---------- Typography ---------- */
[dir="rtl"] {
	--display: 'Segoe UI', Tahoma, 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Geeza Pro', Arial, sans-serif;
	--body: 'Segoe UI', Tahoma, 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Geeza Pro', Arial, sans-serif;
}

[dir="rtl"] body { letter-spacing: 0; }

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .section-title,
[dir="rtl"] .hero h1,
[dir="rtl"] .hero .hero__title,
[dir="rtl"] .page-hero h1,
[dir="rtl"] .product-hero h1 {
	letter-spacing: 0;
}

/* Arabic script needs more vertical room than the condensed Latin display face. */
[dir="rtl"] .hero h1,
[dir="rtl"] .hero .hero__title,
[dir="rtl"] .page-hero h1,
[dir="rtl"] .section-title,
[dir="rtl"] .cta-band h2,
[dir="rtl"] .quote-band blockquote {
	line-height: 1.18;
}

[dir="rtl"] .hero__lead,
[dir="rtl"] .section-sub,
[dir="rtl"] .page-hero__sub,
[dir="rtl"] .product-hero__summary {
	line-height: 1.95;
}

/* Keep model numbers, phone numbers and e-mail addresses readable left-to-right. */
[dir="rtl"] .hero__stat strong,
[dir="rtl"] .stats-band__item strong,
[dir="rtl"] .product-spec-chip strong,
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"] {
	direction: ltr;
	unicode-bidi: isolate;
}

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

/* ---------- Global lists and accessibility ---------- */
[dir="rtl"] ul,
[dir="rtl"] ol {
	padding-left: 0;
	padding-right: 1.2em;
}

[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol {
	padding-left: 0;
	padding-right: 1.3em;
}

/* Critical: the off-canvas skip link otherwise creates a 9999px overflow on the left. */
[dir="rtl"] .skip-link {
	left: auto;
	right: -9999px;
}

[dir="rtl"] .skip-link:focus {
	left: auto;
	right: 12px;
}

/* The contact form honeypot is parked off-canvas the same way. */
[dir="rtl"] .hp-field {
	left: auto;
	right: -9999px;
}

/* ---------- Directional icons ---------- */
[dir="rtl"] .btn svg,
[dir="rtl"] .link-arrow svg,
[dir="rtl"] .app-card__arrow svg,
[dir="rtl"] .explore-card__go svg,
[dir="rtl"] .product-cat-card__arrow svg {
	transform: scaleX(-1);
}

[dir="rtl"] .btn:hover svg,
[dir="rtl"] .link-arrow:hover svg {
	transform: scaleX(-1) translateX(4px);
}

/* ---------- Header and navigation ---------- */
[dir="rtl"] .main-nav .sub-menu {
	left: auto;
	right: 0;
}

[dir="rtl"] .main-nav > ul > li > a::after {
	transform-origin: right center;
}

[dir="rtl"] .nav-toggle {
	margin-left: 0;
	margin-right: auto;
}

@media (max-width: 1024px) {
	[dir="rtl"] .main-nav {
		left: 0;
		right: auto;
		transform: translateX(-100%);
		box-shadow: 20px 0 60px rgba(6, 16, 28, .2);
	}

	[dir="rtl"] .main-nav .sub-menu {
		padding: 0 14px 10px 0;
	}
}

/* ---------- Hero ---------- */
/* The Arabic fallback face is wider than Barlow Condensed: allow the hero to grow
   instead of letting the copy collide with the absolutely positioned stats bar. */
[dir="rtl"] .hero {
	height: auto;
	min-height: 780px;
}

[dir="rtl"] .hero__inner {
	min-height: 780px;
	padding-bottom: 200px;
}

[dir="rtl"] .hero h1,
[dir="rtl"] .hero .hero__title {
	font-size: clamp(44px, 5.6vw, 78px);
	line-height: 1.12;
}

[dir="rtl"] .hero__slide::after {
	background:
		linear-gradient(270deg, rgba(6, 16, 28, .9) 0%, rgba(6, 16, 28, .62) 48%, rgba(6, 16, 28, .18) 100%),
		linear-gradient(0deg, rgba(6, 16, 28, .86) 0%, rgba(6, 16, 28, 0) 42%);
}

[dir="rtl"] .hero__ui {
	right: auto;
	left: 32px;
}

[dir="rtl"] .hero__scroll {
	right: auto;
	left: 34px;
}

[dir="rtl"] .hero__stat {
	padding-right: 0;
	padding-left: 24px;
}

[dir="rtl"] .hero__stat + .hero__stat {
	padding-left: 0;
	padding-right: 32px;
}

[dir="rtl"] .hero__stat + .hero__stat::before {
	left: auto;
	right: 0;
}

[dir="rtl"] .hero__stat strong span {
	margin-left: 0;
	margin-right: 2px;
}

@media (max-width: 900px) {
	[dir="rtl"] .hero,
	[dir="rtl"] .hero__inner {
		min-height: 0;
	}

	[dir="rtl"] .hero__inner {
		padding-bottom: 80px;
	}
}

@media (max-width: 640px) {
	[dir="rtl"] .hero__inner {
		padding-bottom: 40px;
	}

	[dir="rtl"] .hero__stat + .hero__stat:nth-child(3) {
		padding-right: 0;
	}
}

/* ---------- Home sections ---------- */
[dir="rtl"] .stats-band__item {
	padding-right: 0;
	padding-left: 26px;
}

[dir="rtl"] .cap-card {
	border-right: 0;
	border-left: 1px solid rgba(255, 255, 255, .1);
}

[dir="rtl"] .cap-card:last-child {
	border-left: 0;
}

[dir="rtl"] .cap-card::before {
	transform-origin: right center;
}

@media (max-width: 900px) {
	[dir="rtl"] .cap-card:nth-child(2) {
		border-left: 0;
	}
}

@media (max-width: 640px) {
	[dir="rtl"] .cap-card,
	[dir="rtl"] .cap-card:last-child {
		border-left: 0;
	}
}

[dir="rtl"] .media-stack {
	padding: 0 34px 34px 0;
}

[dir="rtl"] .media-stack::before {
	left: 34px;
	right: 0;
}

[dir="rtl"] .media-stack__badge {
	right: auto;
	left: 0;
}

[dir="rtl"] .manufacture-media__caption {
	left: auto;
	right: 0;
}

@media (max-width: 640px) {
	[dir="rtl"] .media-stack {
		padding: 0 20px 26px 0;
	}

	[dir="rtl"] .media-stack::before {
		left: 20px;
		right: 0;
	}
}

/* ---------- Partners ---------- */
[dir="rtl"] .partners__label {
	border-right: 0;
	border-left: 1px solid var(--line);
	padding-right: 0;
	padding-left: 36px;
}

[dir="rtl"] .partners__rail {
	animation-direction: reverse;
}

@media (max-width: 900px) {
	[dir="rtl"] .partners__label {
		border-left: 0;
		padding-left: 0;
	}
}

/* ---------- Content / prose ---------- */
[dir="rtl"] .prose blockquote {
	padding: 4px 28px 4px 0;
	border-left: 0;
	border-right: 3px solid var(--red);
}

[dir="rtl"] .form-alert {
	border-left: 0;
	border-right: 3px solid var(--red);
}

[dir="rtl"] .form-alert--success {
	border-right-color: #2e7d4f;
}

[dir="rtl"] .page-hero::after {
	background: linear-gradient(270deg, rgba(6, 16, 28, .92) 0%, rgba(6, 16, 28, .55) 60%, rgba(6, 16, 28, .35) 100%);
}

[dir="rtl"] .cta-band::after {
	background: linear-gradient(270deg, rgba(6, 16, 28, .96) 0%, rgba(6, 16, 28, .78) 55%, rgba(6, 16, 28, .55) 100%);
}

[dir="rtl"] .quote-band::after {
	background: linear-gradient(270deg, rgba(6, 16, 28, .95) 0%, rgba(6, 16, 28, .7) 60%, rgba(6, 16, 28, .35) 100%);
}

[dir="rtl"] .map-strip {
	background-image: radial-gradient(circle at 12% 20%, rgba(216, 31, 42, .09), transparent 40%);
}

/* ---------- Timeline ---------- */
[dir="rtl"] .timeline__item {
	padding: 0 0 46px 56px;
}

[dir="rtl"] .timeline__item:nth-child(even) {
	margin-left: 0;
	margin-right: 50%;
	padding: 0 56px 46px 0;
}

[dir="rtl"] .timeline__item::after {
	right: auto;
	left: -5px;
}

[dir="rtl"] .timeline__item:nth-child(even)::after {
	left: auto;
	right: -4px;
}

[dir="rtl"] .timeline__item:nth-child(even) .timeline__text {
	margin-left: 0;
	margin-right: auto;
}

[dir="rtl"] .timeline__item:nth-child(even) .timeline__year {
	text-align: right;
}

@media (max-width: 640px) {
	[dir="rtl"] .timeline__item,
	[dir="rtl"] .timeline__item:nth-child(even) {
		padding: 0 30px 40px 0;
	}

	[dir="rtl"] .timeline__item::after,
	[dir="rtl"] .timeline__item:nth-child(even)::after {
		left: auto;
		right: 0;
	}

	[dir="rtl"] .timeline__item:nth-child(even) .timeline__text {
		margin-right: 0;
	}
}

/* ---------- Article navigation ---------- */
[dir="rtl"] .article-nav a:last-child {
	text-align: left;
}

/* ---------- Floats ---------- */
[dir="rtl"] .alignleft {
	float: right;
	margin: 6px 0 20px 28px;
}

[dir="rtl"] .alignright {
	float: left;
	margin: 6px 28px 20px 0;
}

/* ---------- Products ---------- */
[dir="rtl"] .product-hero::after {
	background: linear-gradient(270deg, rgba(6, 16, 28, .97) 0%, rgba(6, 16, 28, .86) 55%, rgba(6, 16, 28, .62) 100%);
}

[dir="rtl"] .product-spec-chip {
	padding: 0 0 0 26px;
	margin-right: 0;
	margin-left: 26px;
	border-right: 0;
	border-left: 1px solid rgba(255, 255, 255, .12);
}

[dir="rtl"] .product-spec-chip:last-child {
	border-left: 0;
	margin-left: 0;
	padding-left: 0;
}

[dir="rtl"] .spec-table th,
[dir="rtl"] .spec-table td {
	text-align: right;
}

[dir="rtl"] .product-hero__badge {
	left: auto;
	right: 0;
}

[dir="rtl"] .product-card__cat {
	left: auto;
	right: 12px;
}

[dir="rtl"] .product-cat-card__arrow {
	right: auto;
	left: 0;
}

@media (max-width: 640px) {
	[dir="rtl"] .product-spec-chip {
		padding-left: 16px;
		margin-left: 16px;
	}
}

/* ---------- Fixed elements ---------- */
[dir="rtl"] .to-top {
	right: auto;
	left: 26px;
}

[dir="rtl"] .lightbox__close {
	right: auto;
	left: 28px;
}
