/* Корневой контейнер: flex-row — контент слева, изображение справа на всю высоту.
   overflow: visible — изображение может выходить за границы для эффекта объёма. */
.BorrowCalculator {
	display: flex;
	align-items: stretch;
	background: transparent;
	border-radius: 20px;
	margin: 20px;
	overflow: visible;
	position: relative;
}

/* ─── Левая часть: заголовок + карточка ────────────────────── */
.BorrowCalculator__Content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 10px;
	min-width: 0;
}

.BorrowCalculator__Heading {
	font-family: AvenirNextCyr-Bold, Arial, sans-serif;
	font-size: 24px;
	color: #0b0b0b;
	margin: 0 0 20px 0;
}

/* Белая карточка калькулятора */
.BorrowCalculator__Card {
	display: flex;
	align-items: center;
	gap: 30px;
	background: #ffffff;
	border-radius: 20px;
	padding: 24px 28px;
	box-shadow:
		0 4px 6px rgb(0 0 0 / 4%),
		0 10px 30px rgb(0 0 0 / 10%);
}

/* ─── Секция инпутов ────────────────────────────────────────── */
.BorrowCalculator__InputsSection {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-content: flex-start;
}

.BorrowCalculator__InputWrapper {
	background: #f0f0f6;
	border-radius: 14px;
	padding: 10px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-sizing: border-box;
}

.BorrowCalculator__InputWrapper_sum {
	flex-basis: 100%;
}

.BorrowCalculator__InputWrapper_period {
	flex: 1;
	min-width: 120px;
}

.BorrowCalculator__InputWrapper_percents {
	flex: 1;
	min-width: 120px;
}

.BorrowCalculator__InputLabel {
	font-family: AvenirNextCyr-Medium, Arial, sans-serif;
	font-size: 14px;
	color: #6c757d;
	cursor: text;
}

.BorrowCalculator__InputRow {
	display: flex;
	align-items: center;
	gap: 8px;
}

.BorrowCalculator__Input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	font-family: AvenirNextCyr-Bold, Arial, sans-serif;
	font-size: 20px;
	color: #0b0b0b;
	min-width: 0;
	-moz-appearance: textfield;
}

.BorrowCalculator__Input::-webkit-outer-spin-button,
.BorrowCalculator__Input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.BorrowCalculator__SideBadge {
	display: inline-flex;
	align-items: center;
	font-family: AvenirNextCyr-Medium, Arial, sans-serif;
	font-size: 15px;
	color: #5a5a78;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ─── Секция результатов ────────────────────────────────────── */
.BorrowCalculator__ResultSection {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 16px;
	min-width: 240px;
	flex-shrink: 0;
}

.BorrowCalculator__ResultRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.BorrowCalculator__ResultLabel {
	font-family: AvenirNextCyr-Medium, Arial, sans-serif;
	font-size: 18px;
	color: #3c3e43;
}

.BorrowCalculator__ResultValue {
	font-family: AvenirNextCyr-Bold, Arial, sans-serif;
	font-size: 18px;
	color: #0b0b0b;
	white-space: nowrap;
}

.BorrowCalculator__ResultCurrency {
	font-family: AvenirNextCyr-Bold, Arial, sans-serif;
}

.BorrowCalculator__Button {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	border-radius: 14px;
	background: #795fd0;
	color: #fff;
	font-family: AvenirNextCyr-Medium, Arial, sans-serif;
	font-size: 18px;
	text-decoration: none;
	transition: background-color 0.3s;
	margin-top: 4px;
}

.BorrowCalculator__Button:hover {
	background-color: #7a3cb8;
}

/* ─── Декоративное изображение (+25%, выходит за границы виджета) ── */
.BorrowCalculator__ImageSection {
	flex-shrink: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 425px;
	overflow: visible;
	margin-top: -28px;
	margin-bottom: -8px;
	/* Без боковых отступов — изображение вплотную к краю */
	padding: 0;
}

.BorrowCalculator__Image {
	width: auto;
	height: 100%;
	max-height: 375px;
	object-fit: contain;
	object-position: bottom center;
	pointer-events: none;
	user-select: none;
}

/* ─── Адаптив 1100px: уменьшаем изображение ────────────────── */
@media (max-width: 1100px) and (min-width: 1001px) {
	.BorrowCalculator__ImageSection {
		width: 300px;
	}

	.BorrowCalculator__Image {
		max-height: 290px;
	}
}

/* ─── Адаптив 1000px: скрываем картинку, карточка вертикальная ─ */
@media (max-width: 1000px) {
	.BorrowCalculator__ImageSection {
		display: none;
	}

	.BorrowCalculator__Card {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.BorrowCalculator__ResultSection {
		min-width: unset;
	}
}

/* ─── Адаптив 768px: мобильный лейаут ──────────────────────── */
@media (max-width: 768px) {
	.BorrowCalculator {
		margin: 10px;
		border-radius: 16px;
	}

	.BorrowCalculator__Content {
		padding: 0px;
	}

	.BorrowCalculator__Heading {
		font-size: 20px;
		margin-bottom: 14px;
	}

	.BorrowCalculator__Card {
		padding: 16px;
		border-radius: 16px;
		gap: 12px;
	}

	/* Все инпуты на всю ширину */
	.BorrowCalculator__InputsSection {
		flex-direction: column;
	}

	.BorrowCalculator__InputWrapper_sum,
	.BorrowCalculator__InputWrapper_period,
	.BorrowCalculator__InputWrapper_percents {
		flex-basis: 100%;
		flex: none;
		width: 100%;
		min-width: unset;
		box-sizing: border-box;
	}

	.BorrowCalculator__Input {
		font-size: 18px;
	}

	.BorrowCalculator__ResultSection {
		gap: 12px;
	}

	.BorrowCalculator__ResultLabel,
	.BorrowCalculator__ResultValue {
		font-size: 16px;
	}

	.BorrowCalculator__Button {
		height: 52px;
		font-size: 16px;
		border-radius: 12px;
	}
}
