/**
 * Skeleton / loader для калькулятора на главной
 */

@keyframes home-calc-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

@keyframes home-calc-spin {
	to {
		transform: rotate(360deg);
	}
}

.xchange_calculator-hidden {
	--home-calc-shimmer: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.05) 25%,
		rgba(255, 255, 255, 0.14) 50%,
		rgba(255, 255, 255, 0.05) 75%
	);
}

/* Старый overlay premiumbox — скрыт */
.xchange_calculator-hidden .xtl_html_abs.js_loader,
.xchange_calculator-hidden .exch_ajax_wrap_abs,
.xchange_calculator-hidden .js_exchange_widget_abs {
	display: none !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

.home-calc-skeleton-block {
	border-radius: 10px;
	background: var(--home-calc-shimmer);
	background-size: 200% 100%;
	animation: home-calc-shimmer 1.1s ease-in-out infinite;
}

.home-calc-skeleton-block--field {
	height: 52px;
}

.home-calc-skeleton-block--line {
	height: 12px;
}

.home-calc-skeleton-block.w85 {
	width: 85%;
}

.home-calc-skeleton-block.w55 {
	width: 55%;
}

.home-calc-skeleton-overlay {
	position: absolute;
	inset: 0;
	z-index: 12;
	display: none;
	padding: 12px 0 0;
	border-radius: 16px;
	background: rgba(26, 28, 31, 0.82);
	backdrop-filter: blur(3px);
	pointer-events: none;
}

.home-calc-skeleton-overlay.is-active {
	display: block;
}

.home-calc-skeleton-overlay__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 8px 4px 0;
}

.home-calc-skeleton-overlay__row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: center;
}

.home-calc-skeleton-overlay__field {
	height: 52px;
	border-radius: 12px;
}

.home-calc-skeleton-overlay__select {
	width: 96px;
	height: 52px;
	border-radius: 12px;
}

/* Пересчёт суммы — skeleton целевого инпута + курс/резерв */
.xchange_calculator-hidden.is-home-calc-loading--calc .exchange-calculator {
	transition: opacity 0.15s ease;
}

.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2"] .xtl_right_col .input-field,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1"] .xtl_left_col .input-field,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2c"] .xtl_right_col .xtl_commis_wrap,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1c"] .xtl_left_col .xtl_commis_wrap {
	position: relative;
}

.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2"] .xtl_right_col .input-field::after,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1"] .xtl_left_col .input-field::after,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2c"] .xtl_right_col .xtl_commis_wrap::after,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1c"] .xtl_left_col .xtl_commis_wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--home-calc-shimmer);
	background-size: 200% 100%;
	animation: home-calc-shimmer 1.1s ease-in-out infinite;
	pointer-events: none;
}

.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2"] .xtl_right_col input.js_sum2,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1"] .xtl_left_col input.js_sum1,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum2c"] .xtl_right_col input.js_sum2c,
.xchange_calculator-hidden.is-home-calc-loading--calc[data-calc-target="sum1c"] .xtl_left_col input.js_sum1c {
	color: transparent !important;
	caret-color: var(--cash-rates-text, #fff);
}

.xchange_calculator-hidden.is-home-calc-loading--calc .exchange-info .xtl_line {
	position: relative;
	color: transparent !important;
	min-height: 14px;
}

.xchange_calculator-hidden.is-home-calc-loading--calc .exchange-info .xtl_line::after {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 72%;
	height: 12px;
	border-radius: 6px;
	transform: translateY(-50%);
	background: var(--home-calc-shimmer);
	background-size: 200% 100%;
	animation: home-calc-shimmer 1.1s ease-in-out infinite;
}

.xchange_calculator-hidden.is-home-calc-loading--calc .exchange-info .xtl_exchange_reserve::after {
	width: 48%;
}

/* Смена направления / swap — затемнение + overlay skeleton */
.xchange_calculator-hidden.is-home-calc-loading--direction .xtl_html_wrap {
	position: relative;
}

.xchange_calculator-hidden.is-home-calc-loading--direction .exchange-calculator .xtl_body,
.xchange_calculator-hidden.is-home-calc-loading--direction .exchange-calculator .footer-calk-xc {
	opacity: 0.28;
	transition: opacity 0.15s ease;
}

.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn {
	pointer-events: none;
}

.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn .xtl_change,
.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn a.xtl_change {
	opacity: 0.35;
}

.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 2px solid rgba(255, 255, 255, 0.18);
	border-top-color: #e92932;
	border-radius: 50%;
	animation: home-calc-spin 0.7s linear infinite;
}

.xchange_calculator-hidden.is-home-calc-loading--direction .exchange-center,
.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn {
	position: relative;
}

@media (prefers-reduced-motion: reduce) {
	.home-calc-skeleton-block,
	.xchange_calculator-hidden.is-home-calc-loading--calc .input-field::after,
	.xchange_calculator-hidden.is-home-calc-loading--calc .exchange-info .xtl_line::after {
		animation: none;
	}

	.xchange_calculator-hidden.is-home-calc-loading--direction .swap-btn::after {
		animation: none;
		border-top-color: rgba(255, 255, 255, 0.35);
	}
}
