/*
 * vrt.geocity — стили виджета и модального окна (по макету ВРТ v1.2).
 * Цвета, шрифт, радиус и z-index берутся из настроек модуля через CSS-переменные.
 */
:root {
	--vrt-gc-action: #F8C41A;
	--vrt-gc-link: #0066FF;
	--vrt-gc-surface: #F6F6F6;
	--vrt-gc-text: #000000;
	--vrt-gc-muted: #6B6B6B;
	--vrt-gc-line: #E6E6E6;
	--vrt-gc-font: 'Gilroy', Arial, sans-serif;
	--vrt-gc-radius: 10px;
	--vrt-gc-radius-sm: 8px;
	--vrt-gc-z: 10050;
}

/* ---------- Строка «Ваш город» ---------- */

.vrt-geocity {
	position: relative;
	display: inline-block;
	min-width: 220px;
	font-family: var(--vrt-gc-font);
	font-size: 16px;
	color: var(--vrt-gc-text);
}

.vrt-geocity.is-loading::before {
	content: '';
	display: block;
	width: 240px;
	max-width: 100%;
	height: 18px;
	margin-top: 3px;
	border-radius: var(--vrt-gc-radius-sm);
	background: linear-gradient(90deg, var(--vrt-gc-surface) 0%, #ECECEC 50%, var(--vrt-gc-surface) 100%) 0 0 / 200% 100%;
	animation: vrt-gc-shimmer 1.4s linear infinite;
}

.vrt-gc-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 12px;
	row-gap: 2px;
	font-weight: 500;
}

.vrt-gc-bar__icon {
	flex: none;
	margin-right: -4px;
}

.vrt-gc-bar__city {
	font-weight: 700;
}

.vrt-gc-bar__question {
	color: var(--vrt-gc-muted);
}

.vrt-gc-bar__change {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: var(--vrt-gc-link);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	cursor: pointer;
}

.vrt-gc-bar__change:hover {
	text-decoration-thickness: 2px;
}

/* ---------- Плашка подтверждения ---------- */

.vrt-gc-confirm {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	z-index: calc(var(--vrt-gc-z) - 1);
	width: 235px;
	padding: 20px;
	border-radius: var(--vrt-gc-radius);
	background: #fff;
	box-shadow: 0 12px 40px rgba(39, 4, 143, .14), 0 2px 6px rgba(0, 0, 0, .06);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity .2s ease, transform .2s ease;
}

.vrt-gc-confirm::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 24px;
	width: 12px;
	height: 12px;
	background: #fff;
	transform: rotate(45deg);
}

.vrt-gc-confirm.is-visible {
	opacity: 1;
	transform: none;
}

.vrt-gc-confirm__title {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 500;
}

.vrt-gc-confirm__actions {
	display: flex;
	gap: 8px;
}

.vrt-gc-btn {
	flex: 1 1 auto;
	height: 45px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--vrt-gc-radius-sm);
	font: 700 14px/1 var(--vrt-gc-font);
	color: var(--vrt-gc-text);
	cursor: pointer;
	transition: filter .15s ease, background-color .15s ease;
}

.vrt-gc-btn--primary {
	background: var(--vrt-gc-action);
}

.vrt-gc-btn--primary:hover {
	filter: brightness(.95);
}

.vrt-gc-btn--ghost {
	background: var(--vrt-gc-surface);
}

.vrt-gc-btn--ghost:hover {
	background: #ECECEC;
}

/* ---------- Модальное окно ---------- */

.vrt-gc-lock {
	overflow: hidden;
	padding-right: var(--vrt-gc-scrollbar, 0);
}

.vrt-gc-modal {
	position: fixed;
	inset: 0;
	z-index: var(--vrt-gc-z);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 6vh 16px;
	font-family: var(--vrt-gc-font);
	color: var(--vrt-gc-text);
}

.vrt-gc-modal[hidden] {
	display: none;
}

.vrt-gc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 12, 46, .45);
	opacity: 0;
	transition: opacity .2s ease;
}

.vrt-gc-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1100px;
	max-height: 88vh;
	padding: 32px 40px 24px;
	border-radius: var(--vrt-gc-radius);
	background: #fff;
	box-shadow: 0 24px 80px rgba(39, 4, 143, .18);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .2s ease, transform .2s ease;
}

.vrt-gc-modal.is-open .vrt-gc-modal__overlay,
.vrt-gc-modal.is-open .vrt-gc-modal__dialog {
	opacity: 1;
	transform: none;
}

.vrt-gc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.vrt-gc-modal__title {
	margin: 0;
	font-size: 24px;
	line-height: 1.2;
	font-weight: 700;
}

.vrt-gc-modal__close {
	flex: none;
	display: grid;
	place-items: center;
	width: 45px;
	height: 45px;
	padding: 0;
	border: 0;
	border-radius: var(--vrt-gc-radius-sm);
	background: var(--vrt-gc-surface);
	color: var(--vrt-gc-text);
	cursor: pointer;
	transition: background-color .15s ease;
}

.vrt-gc-modal__close:hover {
	background: var(--vrt-gc-action);
}

.vrt-gc-search {
	position: relative;
	flex: none;
	margin-bottom: 8px;
	color: var(--vrt-gc-muted);
}

.vrt-gc-search svg {
	position: absolute;
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
	pointer-events: none;
}

.vrt-gc-search__input {
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	padding: 0 16px 0 48px;
	border: 1px solid transparent;
	border-radius: var(--vrt-gc-radius-sm);
	background: var(--vrt-gc-surface);
	font: 500 16px/1 var(--vrt-gc-font);
	color: var(--vrt-gc-text);
	outline: none;
	transition: border-color .15s ease, background-color .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.vrt-gc-search__input::placeholder {
	color: var(--vrt-gc-muted);
}

.vrt-gc-search__input:focus {
	border-color: var(--vrt-gc-link);
	background: #fff;
}

.vrt-gc-modal__body {
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0 -8px;
	padding: 0 8px;
}

.vrt-gc-modal__dialog.is-busy .vrt-gc-modal__body {
	min-height: 120px;
	background: linear-gradient(90deg, #fff 0%, var(--vrt-gc-surface) 50%, #fff 100%) 0 0 / 200% 100%;
	animation: vrt-gc-shimmer 1.4s linear infinite;
	border-radius: var(--vrt-gc-radius-sm);
}

/* Регионы */

.vrt-gc-region {
	border-bottom: 1px solid var(--vrt-gc-line);
}

.vrt-gc-region__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 18px 0;
	border: 0;
	background: none;
	font: 600 18px/1.2 var(--vrt-gc-font);
	color: var(--vrt-gc-text);
	text-align: left;
	cursor: pointer;
}

.vrt-gc-region__toggle:hover {
	color: var(--vrt-gc-link);
}

.vrt-gc-region__caret {
	flex: none;
	transition: transform .2s ease;
}

.vrt-gc-region__toggle[aria-expanded="true"] .vrt-gc-region__caret {
	transform: rotate(180deg);
}

.vrt-gc-region__cities {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 0 20px;
}

.vrt-gc-region__cities[hidden] {
	display: none;
}

.vrt-gc-chip {
	padding: 12px 18px;
	border: 0;
	border-radius: var(--vrt-gc-radius-sm);
	background: var(--vrt-gc-surface);
	font: 500 15px/1 var(--vrt-gc-font);
	color: var(--vrt-gc-text);
	cursor: pointer;
	transition: background-color .15s ease;
}

.vrt-gc-chip:hover {
	background: #ECECEC;
}

.vrt-gc-chip.is-current {
	background: var(--vrt-gc-action);
	font-weight: 700;
}

/* Результаты поиска */

.vrt-gc-results {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.vrt-gc-results[hidden] {
	display: none;
}

.vrt-gc-results__city {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 14px 16px;
	border: 0;
	border-radius: var(--vrt-gc-radius-sm);
	background: none;
	font: 600 17px/1.2 var(--vrt-gc-font);
	color: var(--vrt-gc-text);
	text-align: left;
	cursor: pointer;
}

.vrt-gc-results__city:hover,
.vrt-gc-results__city.is-active {
	background: var(--vrt-gc-surface);
}

.vrt-gc-results__city.is-current {
	box-shadow: inset 4px 0 0 var(--vrt-gc-action);
}

.vrt-gc-results__city mark {
	background: none;
	color: var(--vrt-gc-link);
}

.vrt-gc-results__region {
	flex: none;
	font-size: 14px;
	font-weight: 500;
	color: var(--vrt-gc-muted);
}

.vrt-gc-message {
	margin: 16px 0;
	font-size: 16px;
	line-height: 1.4;
	color: var(--vrt-gc-muted);
}

/* Фокус с клавиатуры */

.vrt-geocity button:focus-visible,
.vrt-gc-modal button:focus-visible {
	outline: 2px solid var(--vrt-gc-link);
	outline-offset: 2px;
}

/* ---------- Адаптив ---------- */

@media (max-width: 600px) {
	.vrt-geocity {
		font-size: 14px;
		min-width: 0;
	}

	.vrt-gc-bar__question {
		display: none;
	}

	.vrt-gc-confirm {
		position: fixed;
		top: auto;
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
	}

	.vrt-gc-confirm::before {
		display: none;
	}

	.vrt-gc-modal {
		padding: 0;
		align-items: stretch;
	}

	.vrt-gc-modal__dialog {
		max-height: none;
		height: 100%;
		padding: 20px 16px 12px;
		border-radius: 0;
	}

	.vrt-gc-modal__title {
		font-size: 20px;
	}

	.vrt-gc-region__toggle {
		font-size: 16px;
		padding: 16px 0;
	}
}

@keyframes vrt-gc-shimmer {
	to {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vrt-geocity *,
	.vrt-gc-modal *,
	.vrt-geocity.is-loading::before {
		animation: none !important;
		transition: none !important;
	}
}
