/* Общий слой карты новой версии (метки, инлайн-карточка, маркер «Вы»).
   Вёрстка контейнера/высоты карты — на стороне страницы, тут только сами объекты карты. */

.pk-map-marker {
	transform: translate(-50%, -100%);
	cursor: pointer;
	white-space: nowrap;
}

.pk-map-marker__price {
	display: inline-block;
	padding: 4px 6px;
	/* Полупрозрачный #54B8F0 по макету. Без backdrop-filter: размытие живого канваса карты
	   пересчитывается на каждый кадр для каждой метки и роняет FPS при пане/зуме */
	background: rgba(84, 184, 240, .8);
	color: #fff;
	font-family: var(--font-HelveticaNeue);
	font-size: 14px;
	font-weight: 400;
	line-height: 140%;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* Хвостик плашки вниз к точке — треугольником, чтобы полупрозрачный фон не накладывался на плашку */
.pk-map-marker__price::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -5px;
	width: 12px;
	height: 5px;
	background: rgba(84, 184, 240, .8);
	transform: translateX(-50%);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.pk-map-marker:hover {
	z-index: 5;
}

/* Кластер каталога: тёмная плашка из desktop/mobile-макетов.
   Острие привязывает плашку к координате, а увеличенная невидимая зона помогает попасть пальцем. */
.pk-map-cluster {
	position: relative;
	transform: translate(-50%, -100%);
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 3px 9px 3px 3px;
	background: #2e2f33;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .24);
	color: #fff;
	font-family: var(--font-HelveticaNeue);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
	animation: pk-map-cluster-in .18s ease-out both;
}

.pk-map-cluster::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -7px;
	width: 14px;
	height: 8px;
	background: #2e2f33;
	transform: translateX(-50%);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	transition: background-color .16s ease;
}

/* Невидимая зона не меняет макет, но даёт минимум 44px для тапа. */
.pk-map-cluster::after {
	content: "";
	position: absolute;
	inset: -7px -4px -10px;
}

.pk-map-cluster__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 4px;
	background: #f7f7f8;
	border-radius: 7px;
	color: #2e2f33;
	font-weight: 700;
}

.pk-map-cluster__price {
	padding-left: 6px;
	color: #fff;
	font-weight: 400;
	line-height: 1.2;
}

.pk-map-cluster:hover,
.pk-map-cluster:focus-visible {
	background: #202125;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
	outline: 2px solid rgba(255, 255, 255, .95);
	outline-offset: 2px;
}

.pk-map-cluster:hover::before,
.pk-map-cluster:focus-visible::before,
.pk-map-cluster.is-active::before {
	background: #202125;
}

.pk-map-cluster:hover,
.pk-map-cluster.is-active {
	transform: translate(-50%, -100%) scale(1.04);
}

/* Одиночная точка — ценник без ложного счётчика «1». */
.pk-map-cluster--single {
	padding-left: 9px;
}

@keyframes pk-map-cluster-in {
	from { opacity: 0; transform: translate(-50%, calc(-100% + 4px)) scale(.96); }
	to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

.pk-map-cluster-list-wrap {
	transform: translate(-50%, -100%);
	padding-bottom: 16px;
}

.pk-map-cluster-list {
	position: relative;
	width: min(340px, 84vw);
	max-height: min(390px, 70vh);
	padding: 18px 8px 8px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
	font-family: var(--font-HelveticaNeue);
	overflow: hidden;
}

.pk-map-cluster-list__title {
	padding: 0 34px 10px 8px;
	color: var(--black-light);
	font-size: 16px;
	font-weight: 700;
}

.pk-map-cluster-list__items {
	max-height: min(320px, 58vh);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.pk-map-cluster-list__item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 8px;
	border-radius: 10px;
	color: var(--black-light);
	text-decoration: none;
}

.pk-map-cluster-list__item:hover,
.pk-map-cluster-list__item:focus-visible {
	background: rgba(84, 184, 240, .12);
}

.pk-map-cluster-list__address {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.pk-map-cluster-list__price {
	flex: 0 0 auto;
	color: #279fdf;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}

.pk-map-cluster-list__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gray-middle);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 767.98px) {
	.pk-map-cluster {
		min-height: 40px;
		padding: 4px 10px 4px 4px;
		border-radius: 10px;
		font-size: 17px;
	}

	.pk-map-cluster__count {
		min-width: 32px;
		height: 32px;
		padding: 0 5px;
		border-radius: 9px;
		font-size: 16px;
	}

	.pk-map-cluster__price {
		padding-left: 8px;
	}

	.pk-map-cluster--single {
		padding-left: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pk-map-cluster {
		animation: none;
		transition: none;
	}
}

.pk-map-pin {
	position: relative;
	transform: translate(-50%, -100%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: #2e2f33;
	border-radius: 50%;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}

/* Острие пина */
.pk-map-pin::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -6px;
	z-index: -1;
	width: 18px;
	height: 18px;
	background: #2e2f33;
	transform: translateX(-50%) rotate(45deg);
	border-radius: 0 0 4px 0;
}

.pk-map-pin__icon {
	display: block;
	width: 20px;
	height: 31px;
}

.pk-map-user {
	transform: translate(-50%, -100%);
}

.pk-map-user__label {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: #ef7d4e;
	color: #fff;
	font-family: var(--font-HelveticaNeue);
	font-size: 16px;
	font-weight: 300;
	line-height: 1;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.pk-map-user__label::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -4px;
	z-index: -1;
	width: 16px;
	height: 16px;
	background: #ef7d4e;
	transform: translateX(-50%) rotate(45deg);
	border-radius: 0 0 3px 0;
}

/* Акцентный пин выбранного в поиске адреса */
.pk-map-selected {
	transform: translate(-50%, -100%);
	white-space: nowrap;
}

.pk-map-selected__label {
	position: relative;
	display: inline-block;
	padding: 4px 10px;
	background: #ef7d4e;
	color: #fff;
	font-family: var(--font-HelveticaNeue);
	font-size: 14px;
	font-weight: 400;
	line-height: 140%;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.pk-map-selected__label::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -4px;
	z-index: -1;
	width: 8px;
	height: 8px;
	background: #ef7d4e;
	transform: translateX(-50%) rotate(45deg);
	border-radius: 1px;
}

.pk-map-card-wrap {
	transform: translate(-50%, -100%);
	padding-bottom: 16px;
}

.pk-map-card {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 23em;
	max-width: 80vw;
	background: #fff;
	border-radius: 1em;
	overflow: hidden;
	box-shadow: 0 0.4em 1.6em rgba(0, 0, 0, .18);
	cursor: pointer;
	font-family: var(--font-HelveticaNeue);
	font-size: clamp(13px, 1.6vh, 16px);
	opacity: 0;
	transform: translateY(0.4em) scale(0.96);
	transform-origin: bottom center;
	transition: opacity .45s ease, transform .45s ease;
}

/* Плавное появление карточки */
.pk-map-card.is-open {
	opacity: 1;
	transform: none;
}

.pk-map-card__img {
	flex: 0 0 8.5em;
	align-self: stretch;
	min-height: 6.3em;
}

.pk-map-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pk-map-card__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.7em;
	padding: 0.9em 2.2em 0.9em 1.1em;
}

.pk-map-card__addr {
	font-family: var(--font-HelveticaNeue);
	font-size: 1em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--black-light);
}

.pk-map-card__price {
	align-self: flex-start;
	padding: 0.5em 0.9em;
	background: var(--black-light);
	color: #fff;
	font-family: var(--font-primary);
	font-size: 0.875em;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -0.01em;
	text-align: center;
	border-radius: 0.6em;
	text-decoration: none;
}

.pk-map-card__close {
	position: absolute;
	top: 0.5em;
	right: 0.6em;
	width: 1.4em;
	height: 1.4em;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gray-middle);
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
}

.pk-map-card__close:hover {
	color: var(--black-light);
}
