/* Кнопка открытия попапа — справа по центру вертикально */
.popup-stepform-trigger {
	font-size: 25px;
	border-radius: 15px;
	color: #fff;
	background: #535aff;
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateX(50%) rotate(270deg) translateY(-50%);
	border-bottom-left-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
	border: 0;
	padding: 9px 18px;
	height: auto;
	line-height: 1.4;
	transition: filter .3s;
	z-index: 250;
	outline: none;
	cursor: pointer;
	white-space: nowrap;
}

.popup-stepform-trigger:hover,
.popup-stepform-trigger:active {
	filter: brightness(1.2);
}

/* Попап — затемнение + центрирование */
.modal-stepform {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
	opacity: 0;
	transition: visibility .3s, opacity .3s;
	z-index: 9999;
}

.modal-stepform.active {
	visibility: visible;
	opacity: 1;
}

.modal-stepform-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
}

/* Контейнер попапа */
.modal-stepform-container {
	position: relative;
	max-width: 680px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	overflow-x: hidden;
	background: #fff;
	border-radius: 30px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	transform: scale(0.95);
	transition: transform 0.3s;
	z-index: 10000;

	/* Скрываем скроллбар */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.modal-stepform-container::-webkit-scrollbar {
	display: none;
}

.modal-stepform.active .modal-stepform-container {
	transform: scale(1);
}

/* Кнопка закрытия */
.modal-stepform-close {
	position: absolute;
	top: 25px;
	right: 25px;
	width: 40px;
	height: 40px;
	fill: #fff;
	cursor: pointer;
	opacity: 0.9;
	border-radius: 50%;
	padding: 8px;
	z-index: 62;
	transition: all .3s;
}

.modal-stepform-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

/* Форма */
.calc-form {
	display: flex;
	flex-direction: column;
}

.form-sections {
	list-style: none;
	padding: 0;
	margin: 0;
	width: 100%;
}

.form-section {
	width: 100%;
}

.section-title {
	margin-bottom: 17px;
}

.section-title--field-item {
	margin-bottom: 11px;
}

.section-title p {
	font-size: 18px;
	font-weight: 500;
	color: #18181b;
	margin: 0;
}

.section-title--field-item p {
	font-size: 15px;
	font-weight: 400;
	color: #18181b;
}

/* Радио и чекбоксы */
.radio-group,
.checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.control-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.control-item input[type="radio"],
.control-item input[type="checkbox"] {
	display: none;
}

.control-item label {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1px solid #b0b3b8;
	border-radius: 50%;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	background: #fff;
	margin-bottom: 0;
}

.control-item input[type="radio"]:checked+label {
	border-color: #2861eb;
}

.control-item input[type="radio"]:checked+label::after {
	content: '';
	width: 12px;
	height: 12px;
	background: #2861eb;
	border-radius: 50%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.control-item input[type="checkbox"]+label {
	border-radius: 5px;
}

.control-item input[type="checkbox"]:checked+label {
	background: #2861eb;
	border-color: #2861eb;
}

.control-item input[type="checkbox"]:checked+label::after {
	content: "";
	background: url('/catalog/view/theme/prostore/images/icons/step-form/check.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	width: 12px;
	height: 12px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.control-text {
	font-size: 15px;
	color: #333;
	line-height: 1.4;
}

.control-text p {
	margin: 0;
}

/* Custom Select Styles */
.custom-select-wrapper {
	position: relative;
	width: 100%;
	user-select: none;
}

.custom-select {
	position: relative;
	width: 100%;
}

.custom-select__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 25px;
	background: #fff;
	border: 1px solid #dfe5ec;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.custom-select__trigger:hover {
	border-color: #2861eb;
}

.custom-select.open .custom-select__trigger {
	border-color: #2861eb;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.custom-select__selected {
	font-size: 16px;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.custom-select__selected.placeholder {
	color: #999;
}

.custom-select__arrow {
	transition: transform 0.3s ease;
}

.custom-select.open .custom-select__arrow {
	transform: rotate(180deg);
}

.custom-select__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #DFE5EC;
	border-top: none;
	border-radius: 0 0 10px 10px;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 1000;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.custom-select.open .custom-select__dropdown {
	max-height: 300px;
	opacity: 1;
	visibility: visible;
}

.custom-select__option {
	padding: 15px 25px;
	font-size: 16px;
	color: #333;
	cursor: pointer;
	transition: all 0.2s ease;
	border-bottom: 1px solid #f0f0f0;
}

.custom-select__option:last-child {
	border-bottom: none;
	border-radius: 0 0 10px 10px;
}

.custom-select__option:hover {
	color: #2861eb;
}

.custom-select__option.selected {
	color: #2861eb;
	font-weight: 500;
	position: relative;
}

/* Состояние ошибки для кастомного селекта */
.custom-select.error .custom-select__trigger {
	border-color: #ff3b30;
	background: #fff5f5;
}

/* Анимация появления опций */
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.custom-select.open .custom-select__option {
	animation: slideDown 0.2s ease forwards;
	animation-delay: calc(var(--index) * 0.05s);
	opacity: 0;
}

/* Поля ввода */
.input-control {
	width: 100%;
	padding: 20px 25px;
	border: 1px solid #dfe5ec;
	border-radius: 10px;
	font-size: 16px;
	transition: all 0.1s;
	outline: none;
	font-family: inherit;
}

.input-control:focus {
	border-color: #2861eb;
}

.input-control.error {
	border-color: #ff3b30;
	background: #fff5f5;
}

/* Строка с именем и телефоном */
.row-double {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 25px 50px 35px;
	width: 100%;
}

.row-double .field-item {
	flex: 1 1 calc(50% - 8px);
	min-width: 200px;
}

/* Кнопка отправки */
.submit-btn {
	background: #2861eb;
	border: none;
	border-radius: 10px;
	padding: 21px 32px;
	color: #fff;
	font-weight: 600;
	font-size: 16px;
	width: 100%;
	max-width: 310px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	margin-bottom: 16px;
}

.submit-btn:hover {
	background: #005bbf;
	transform: scale(1.02);
}

.submit-btn:disabled {
	background: #a0a0a0;
	cursor: not-allowed;
	transform: none;
}

/* Согласие */
.consent-text {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 480px;
	margin: 0 auto;
}

.consent-text input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
}

.consent-text label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
	cursor: pointer;
	user-select: none;
	margin-bottom: 0;
}

.consent-text label::before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 1px solid #dfe5ec;
	border-radius: 6px;
	background: #fff;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.consent-text label:hover::before {
	border-color: #2861eb;
}

.consent-text input[type="checkbox"]:checked+label::before {
	background: #2861eb;
	border-color: #2861eb;
}

.consent-text input[type="checkbox"]:checked+label::after {
	content: "";
	background: url('/catalog/view/theme/prostore/images/icons/step-form/check.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	width: 12px;
	height: 12px;
	position: absolute;
	left: 4px;
	top: 50%;
	transform: translateY(-50%);
}

.consent-text a {
	color: #666;
	text-decoration: underline;
	transition: color 0.2s;
}

.consent-text a:hover {
	text-decoration: underline;
	color: #005bbf;
}

/* Сообщение об ошибке */
.error-message {
	color: #ff3b30;
	font-size: 13px;
	margin-top: 5px;
	padding-left: 5px;
}

.field-error {
	display: block;
	width: 100%;
	color: #ff3b30;
	font-size: 13px;
	margin-top: -10px;
	margin-bottom: 10px;
	padding-left: 5px;
}

/* Разделители */
.divider {
	margin: 0 50px;
	border: 0;
	border-top: 1px solid #e9e9ed;
	opacity: 0.7;
}

/* Отступы */
.p-50-35 {
	padding: 50px 50px 35px;
}

.p-0-25 {
	padding: 0 50px 25px;
}

.p-25-25 {
	padding: 25px 50px;
}

.p-0-50 {
	padding: 0 50px 50px;
}

/* Анимации для уведомления */
@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOutRight {
	from {
		transform: translateX(0);
		opacity: 1;
	}

	to {
		transform: translateX(100%);
		opacity: 0;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Адаптивность */
@media (max-width: 991px) {
	.popup-stepform-trigger {
		font-size: 20px;
		padding: 9px 15px;
	}
}

@media (max-width: 575px) {
	.row-double {
		gap: 25px;
	}

	.section-title p {
		font-size: 17px;
		line-height: 1.2;
	}

	.section-title--field-item p {
		font-size: 15px;
	}

	.modal-stepform-container {
		width: 95%;
		border-radius: 20px;
	}

	.row-double {
		flex-direction: column;
		padding: 25px 25px 35px;
	}

	.row-double .field-item {
		flex: 1 1 100%;
	}

	.divider,
	.p-50-35,
	.p-0-25,
	.p-25-25,
	.p-0-50 {
		padding-left: 25px !important;
		padding-right: 25px !important;
	}

	.divider {
		margin: 0 25px;
	}

	.popup-stepform-trigger {
		font-size: 18px;
		padding: 9px 15px;
	}

	.consent-text {
		gap: 8px;
		max-width: 100%;
	}

	.consent-text input[type="checkbox"] {
		width: 18px;
		height: 18px;
	}

	.consent-text label {
		gap: 6px;
	}

	.consent-text label::before {
		width: 18px;
		height: 18px;
		border-radius: 4px;
	}

	.consent-text input[type="checkbox"]:checked+label::after {
		width: 10px;
		height: 10px;
		left: 4px;
	}

	.consent-text a {
		display: inline-block;
		padding: 2px 0;
	}

	/* Адаптивность для кастомного селекта */
	.custom-select__trigger {
		padding: 15px 20px;
	}

	.custom-select__option {
		padding: 12px 20px;
	}
}

@media (max-width: 480px) {
	.consent-text label {
		font-size: 12px;
		flex-wrap: wrap;
		justify-content: center;
		text-align: center;
	}

	.consent-text {
		justify-content: center;
	}

	.consent-text br {
		display: none;
	}

	.consent-text a {
		display: inline;
		white-space: nowrap;
	}
}