/* ==========================================================================
   NIZAM — RTL ADJUSTMENTS
   Loaded only when dir="rtl". Most of the layout already uses logical
   properties (inset-inline, margin-inline, padding-inline), so this file only
   fixes the things that cannot be expressed logically: directional glyphs,
   transforms, gradients and third-party defaults.
   ========================================================================== */

[dir="rtl"] body { font-family: var(--nz-font-arabic); }

/* Arabic sits better with slightly looser lines and no negative tracking. */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .nz-h1, [dir="rtl"] .nz-h2, [dir="rtl"] .nz-h3,
[dir="rtl"] .nz-display {
	letter-spacing: 0;
	line-height: 1.35;
}
[dir="rtl"] .nz-display { line-height: 1.28; }
[dir="rtl"] .nz-lead, [dir="rtl"] p { line-height: 1.85; }

/* ---- directional glyphs ------------------------------------------------ */
/* Arrows point the way the reader is going, not the way the icon was drawn. */
[dir="rtl"] .bi-arrow-right::before  { content: "\F12F"; } /* -> becomes <- */
[dir="rtl"] .bi-arrow-left::before   { content: "\F138"; }
[dir="rtl"] .bi-chevron-right::before { content: "\F285"; }
[dir="rtl"] .bi-chevron-left::before  { content: "\F284"; }
[dir="rtl"] .bi-box-arrow-right::before { content: "\F1C3"; }
[dir="rtl"] .bi-box-arrow-left::before  { content: "\F1C6"; }

/* Icons that must never flip: brand marks, clocks, media controls. */
[dir="rtl"] .nz-no-flip { transform: none !important; }

/* ---- transforms that logical properties cannot reach ------------------- */
[dir="rtl"] .nz-quote__avatar { transform: translateX(50%); }
[dir="rtl"] .nz-plan__badge   { transform: translateX(50%); }
[dir="rtl"] .btn:hover .nz-arrow,
[dir="rtl"] .nz-link:hover .nz-arrow { transform: translateX(-3px); }

/* ---- gradients: mirror the sweep -------------------------------------- */
[dir="rtl"] .nz-cta { background: linear-gradient(235deg, var(--nz-brand-700) 0%, var(--nz-brand) 52%, #17968C 100%); }
[dir="rtl"] .nz-progress__bar,
[dir="rtl"] .nz-bar { background: linear-gradient(270deg, var(--nz-brand), #35A99F); }
[dir="rtl"] .nz-mark::after { background: linear-gradient(270deg, rgba(212, 160, 23, .42), rgba(212, 160, 23, .22)); }
[dir="rtl"] .nz-error__code { background: linear-gradient(225deg, var(--nz-brand), var(--nz-accent)); -webkit-background-clip: text; background-clip: text; }

/* ---- the wash sits on the mirrored side ------------------------------- */
[dir="rtl"] .nz-section--wash::before {
	background:
		radial-gradient(60rem 32rem at 88% -8%,  rgba(15, 118, 110, .09), transparent 62%),
		radial-gradient(48rem 30rem at 8% 4%,    rgba(212, 160, 23, .10), transparent 60%),
		radial-gradient(44rem 30rem at 50% 108%, rgba(109, 74, 199, .07), transparent 62%);
}
[dir="rtl"] .nz-cta::before {
	background:
		radial-gradient(30rem 20rem at 18% -10%, rgba(212, 160, 23, .30), transparent 62%),
		radial-gradient(26rem 20rem at 92% 116%, rgba(255, 255, 255, .16), transparent 60%);
}

/* ---- Bootstrap components that assume LTR ----------------------------- */
[dir="rtl"] .dropdown-menu-end { --bs-position: start; }
[dir="rtl"] .accordion-button::after { margin-inline-start: auto; margin-inline-end: 0; }
[dir="rtl"] .form-check { padding-inline-start: 1.5em; padding-inline-end: 0; }
[dir="rtl"] .form-check .form-check-input { float: right; margin-inline-start: -1.5em; margin-inline-end: 0; }
[dir="rtl"] .modal-header .btn-close { margin: -.5rem auto -.5rem -.5rem; }
[dir="rtl"] .offcanvas-header .btn-close { margin-inline-start: 0; margin-inline-end: auto; }

/* ---- data that stays LTR even in Arabic -------------------------------- */
/* Phone numbers, emails, URLs, code and OTP boxes read left-to-right. */
[dir="rtl"] .nz-ltr,
[dir="rtl"] .nz-otp,
[dir="rtl"] .nz-article pre,
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="password"] {
	direction: ltr;
	text-align: left;
}
[dir="rtl"] input[type="email"]::placeholder,
[dir="rtl"] input[type="tel"]::placeholder { text-align: right; }

/* Prices keep the numeral group together with the symbol trailing. */
[dir="rtl"] .nz-plan__price { direction: ltr; justify-content: flex-end; }
[dir="rtl"] .nz-stat__value,
[dir="rtl"] .nz-metric__value,
[dir="rtl"] .nz-mock-stat__value { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .nz-stat,
[dir="rtl"] .nz-metric__value { text-align: center; }
[dir="rtl"] .nz-metric__value { text-align: start; }

/* ---- step connector runs the other way -------------------------------- */
@media (min-width: 992px) {
	[dir="rtl"] .nz-steps--line > [class*="col-"]::after { inset-inline-start: auto; inset-inline-end: 50%; }
}

/* ---- tables ------------------------------------------------------------ */
[dir="rtl"] .nz-table__actions { justify-content: flex-start; }
[dir="rtl"] .nz-table--stack tbody td { text-align: start; }
[dir="rtl"] .nz-table--stack tbody td::before { text-align: end; }

/* ---- toast stack anchors to the mirrored corner ------------------------ */
[dir="rtl"] .nz-toast { border-inline-start: 3px solid var(--nz-a); border-inline-end: 1px solid var(--nz-line); }

/* ---- app store buttons keep their Latin names LTR ---------------------- */
[dir="rtl"] .nz-store__name { direction: ltr; text-align: right; }
