/*
 * Language switcher placement, and direction corrections for translated pages.
 */

/*
 * GTranslate's floating widget is configured `bottom_left` in the plugin
 * settings, which is a database value and therefore not deployable — so it is
 * repositioned here instead. Top of the page reads as a site-level control;
 * bottom-left reads as a support badge and collides with the WhatsApp button.
 */
/*
 * The element that actually carries the fixed positioning is an inner div
 * identified only by a generated id (gt-wrapper-NNNNNNNN) — the
 * .gtranslate_wrapper element around it has no height and styling it does
 * nothing. Both are targeted so the rule survives markup changes.
 *
 * Sits below the header rather than level with it: the cart occupies one top
 * corner and the burger the other, so neither is free. Inset far enough to
 * land inside the hero card rather than straddling its rounded corner.
 */
/*
 * Sits in the header band itself, alongside the cart.
 *
 * inset-inline-END, not start: the cart lives on the physical left in this RTL
 * layout and on the physical right once translated to LTR, and the logical
 * property follows it either way — so the pair stays together in both
 * directions instead of ending up on opposite sides of the page.
 */
.gtranslate_wrapper,
.gtranslate_wrapper > div,
div[id^='gt-wrapper-'] {
	position: fixed !important;
	z-index: 400 !important;
	inset-block-start: 12px !important;
	inset-block-end: auto !important;
	inset-inline-start: auto !important;
	/* Clears the cart icon and its counter badge. */
	inset-inline-end: 92px !important;
}

@media (min-width: 1025px) {
	.gtranslate_wrapper,
	.gtranslate_wrapper > div,
	div[id^='gt-wrapper-'] {
		inset-block-start: 24px !important;
		inset-inline-end: 118px !important;
	}
}

/*
 * .gt_float_switcher is the container for BOTH the closed control
 * (.gt-selected) and the expanded list (.gt_options). A pill radius here looked
 * right while closed and stretched into an oval the moment the list opened —
 * so the radius belongs on the container as a modest corner, clipped with
 * overflow, and never as a pill.
 *
 * The plugin hard-codes 20px type, which a transform only disguises. Setting
 * the size directly keeps the control crisp instead of scaling a bitmap of it.
 */
.gt_float_switcher {
	border-radius: 12px !important;
	overflow: hidden !important;
	font-family: var(--rb-font, inherit) !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
	box-shadow: 0 3px 14px rgba(42, 28, 15, 0.16) !important;
}

.gt_float_switcher .gt-selected,
.gt_float_switcher .gt-selected .gt-current-lang {
	border-radius: 0 !important;
	font-size: 13px !important;
	padding-block: 7px !important;
}

/*
 * The plugin slides the list in from translateY(-30px) over 0.8s on
 * cubic-bezier(0.3, 1.1, 0.4, 1.1). Control points above 1 overshoot, so the
 * menu springs past its resting position and bounces back — far too much
 * movement for a four-item language list. Replaced with a short fade.
 */
.gt_float_switcher .gt_options {
	border-radius: 0 !important;
	box-shadow: none !important;
	transform: none !important;
	transition: opacity 160ms ease !important;
}

.gt_float_switcher .gt_options.gt-open {
	transform: none !important;
}

.gt_float_switcher {
	transition: none !important;
}

/* The chevron flip is fine; it was just slow enough to read as part of the roll. */
.gt_float_switcher .gt-selected .gt-current-lang s {
	transition: transform 160ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
	.gt_float_switcher .gt_options,
	.gt_float_switcher .gt-selected .gt-current-lang s {
		transition: none !important;
	}
}

.gt_float_switcher .gt_options a {
	font-size: 13px !important;
	padding: 7px 12px !important;
	line-height: 1.4 !important;
}

/* The plugin's flags are sized for a much larger control. */
.gt_float_switcher img {
	width: 18px !important;
	height: auto !important;
}

/*
 * Direction corrections once i18n-dir.js flips the document to LTR.
 *
 * The theme still loads its RTL stylesheets — those are chosen server-side and
 * cannot be swapped from the client — so components whose mirroring is baked
 * into that CSS need straightening individually. These are the ones that read
 * as broken rather than merely unusual.
 */
.rb-ltr .rb-hero__content,
.rb-ltr .rb-hero__eyebrow,
.rb-ltr .rb-hero__title,
.rb-ltr .rb-hero__lede {
	text-align: left;
}

.rb-ltr .rb-hero__actions {
	justify-content: flex-start;
}

.rb-ltr .wd-nav,
.rb-ltr .wd-nav > li > a {
	direction: ltr;
}

.rb-ltr .elementor-heading-title,
.rb-ltr .wd-entities-title {
	direction: ltr;
}

/* Latin text needs looser tracking than the Persian defaults allow. */
.rb-ltr h1,
.rb-ltr h2 {
	letter-spacing: 0;
}
