/**
 * KTK — модалка выбора города (#modal-city), на всех страницах включая главную.
 */

#modal-city.modal {
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: none;
	width: 100%;
	height: 100%;
	padding: 16px;
	box-sizing: border-box;
	background: rgba(2, 20, 47, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

#modal-city.modal.open {
	display: flex;
}

#modal-city .modal__wrapper {
	position: relative;
	width: 100%;
	max-width: 920px;
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 32px 28px 28px;
	box-sizing: border-box;
	background: #ffffff;
	color: #02142f;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(4, 35, 86, 0.18);
}

#modal-city .modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: #eef1f5;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

#modal-city .modal__close::before {
	content: "×";
	font-size: 26px;
	line-height: 1;
	font-weight: 400;
	color: #042356;
}

#modal-city .modal__close:hover {
	background: #e66003;
}

#modal-city .modal__close:hover::before {
	color: #ffffff;
}

#modal-city .modal__content {
	text-align: left;
}

#modal-city .modal__content_head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding-right: 48px;
}

#modal-city .modal__title {
	display: block;
	margin: 0;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 700;
	color: #042356;
}

#modal-city .form-group-search {
	position: relative;
	flex: 1 1 280px;
	max-width: 360px;
	margin: 0;
}

#modal-city .css-search {
	display: block;
	width: 100%;
	height: 44px;
	padding: 0 44px 0 16px;
	box-sizing: border-box;
	border: 1px solid #dbdbdb;
	border-radius: 12px;
	background-color: #ffffff;
	background-image: url("../img/search.svg");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px 18px;
	outline: none;
	color: #02142f;
	font-family: "Inter", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#modal-city .css-search::placeholder {
	color: #4b4b4b;
	opacity: 1;
}

#modal-city .css-search:focus {
	border-color: #042356;
	box-shadow: 0 0 0 3px rgba(4, 35, 86, 0.12);
}

#modal-city .form-group-search .btn-reset {
	position: absolute;
	top: 50%;
	right: 38px;
	display: none;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #eef1f5;
	transform: translateY(-50%);
	cursor: pointer;
	transition: background 0.15s ease;
}

#modal-city .form-group-search .btn-reset:hover {
	background: #dbdbdb;
}

#modal-city .form-group-search .css-search:not(:placeholder-shown) + .btn-reset {
	display: flex;
	align-items: center;
	justify-content: center;
}

#modal-city .form-group-search .btn-reset .modal__icon {
	display: none;
}

#modal-city .form-group-search .btn-reset::before {
	content: "×";
	font-size: 18px;
	line-height: 1;
	color: #042356;
}

#modal-city .city__modal-form {
	width: 100%;
	margin-top: 28px;
	columns: 3;
	column-gap: 32px;
}

#modal-city .city__modal-block {
	break-inside: avoid;
	margin: 0 0 20px;
	page-break-inside: avoid;
}

#modal-city .city__modal-block > span {
	display: block;
	margin-bottom: 8px;
	font-size: 16px;
	line-height: 1.2;
	font-weight: 700;
	color: #042356;
}

#modal-city .city__modal-block ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

#modal-city .city__modal-block ul li {
	margin: 0 0 4px;
	padding: 0;
}

#modal-city .city__modal-block ul li a {
	display: inline-block;
	padding: 2px 0;
	color: #4b4b4b;
	font-size: 14px;
	line-height: 1.4;
	font-weight: 400;
	text-decoration: none;
	transition: color 0.15s ease;
}

#modal-city .city__modal-block ul li a:hover {
	color: #e66003;
}

#modal-city .city__modal-block ul li a.not-search {
	opacity: 0.22;
	pointer-events: none;
}

@media (max-width: 992px) {
	#modal-city .modal__wrapper {
		padding: 24px 20px 20px;
		max-height: calc(100vh - 24px);
	}

	#modal-city .modal__content_head {
		flex-direction: column;
		align-items: stretch;
		padding-right: 0;
	}

	#modal-city .modal__title {
		font-size: 20px;
		padding-right: 40px;
	}

	#modal-city .form-group-search {
		max-width: none;
		flex: 1 1 auto;
	}

	#modal-city .city__modal-form {
		columns: 2;
		column-gap: 24px;
		margin-top: 20px;
	}
}

@media (max-width: 576px) {
	#modal-city.modal {
		padding: 12px;
	}

	#modal-city .modal__wrapper {
		padding: 20px 16px 16px;
		border-radius: 14px;
	}

	#modal-city .city__modal-form {
		columns: 1;
	}

	#modal-city .modal__close {
		top: 12px;
		right: 12px;
		width: 36px;
		height: 36px;
	}
}
