/* RF_002: локальные оверрайды поверх css/leaflet/v1/ */

/* иконка ZoomBox (раньше className fa-search-plus у ZoomBox 0.7) */
.fa-search-plus {
	background-image: url('/i/leaflet/zoom-object.png');
}

/* линейку влево — не перекрывать attribution / Street View */
.leaflet-bottom .leaflet-control-scale {
	margin-right: 50px;
}

/*
 * Leaflet 1.9 ставит .leaflet-touch на десктопах с тачскрином — «толстые» кнопки
 * и рамка 4px. Zoomslider визуально схлопывается относительно 0.7. Вернём десктопный вид.
 */
.leaflet-touch .leaflet-control-zoomslider {
	border: none;
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}
.leaflet-touch .leaflet-control-zoomslider a {
	width: 26px;
	height: 26px;
	line-height: 26px;
}
.leaflet-touch .leaflet-control-zoomslider a:hover {
	width: 26px;
	line-height: 26px;
}
.leaflet-touch .leaflet-control-zoomslider-in {
	font-size: 18px;
	line-height: 26px;
}
.leaflet-touch .leaflet-control-zoomslider-out {
	font-size: 22px;
	line-height: 26px;
}
.leaflet-touch .leaflet-control-zoomslider-knob {
	width: 12px;
	margin-left: -6px;
}

/*
 * Маркеры/балуны регионов: L.divIcon с className my-div-icon и HTML «как popup».
 * В 1.9 у .leaflet-popup больше margin/padding и tip absolute — балуны раздуваются
 * и перекрываются пустотой. Метрики как в Leaflet 0.7.
 */
.my-div-icon {
	background: transparent !important;
	border: none !important;
}
/* мигалка списка (point.gif 25×25): adaptive img{max-width:100%} сжимает, как фото в балуне */
.leaflet-marker-icon.map-blinker img {
	max-width: none;
	width: 25px;
	height: 25px;
	display: block;
}
.my-div-icon .leaflet-popup {
	position: relative;
	margin-bottom: 0;
}
.my-div-icon .leaflet-popup-content {
	margin: 3px 6px;
	line-height: 1.4;
	font-size: inherit;
}
.my-div-icon .leaflet-popup-tip-container {
	position: relative;
	left: auto;
	margin-left: auto;
	margin-top: 0;
}

/*
 * Метка региона на мелком масштабе (boards.map.js regionLayout): своя «подсказка» вместо разметки
 * .leaflet-popup - у той в 1.9 хвостик с зазором и съезжает при разной ширине подписи.
 * Иконка привязана острием хвостика (iconAnchor 0,0), пузырь - над ним, хвостик в 20px от левого края.
 */
/* пины плоскостей (boards.map.js boardLayout): квадрат публичных баз, выбранный - зелёный */
.map-sq {
	width: 5px;
	height: 5px;
	border: 1px solid #666;
	box-shadow: 0 0 0 1px #fff;
	background: #d00;
	margin: -9px 0 0 -4px; /* точка привязки */
}
.map-sq.map-sq-on {
	background: #5fe35d;
}
/* пин со значком: точка привязки - низ значка (только маркер карты, .map-ui-pin есть и вне карт) */
.leaflet-marker-icon.map-ui-pin {
	margin: -18px 0 0 -12px;
	border-radius: 24px; /* круг для тени цвета медиаплана */
}
/* цветной квадрат вместо значка (кабинет, просмотр кампании) */
.map-pin-sq {
	position: absolute;
	top: 8px;
	left: 9px;
	width: 7px;
	height: 7px;
}
/* просмотр кампании: принята / отклонена */
.leaflet-marker-icon.map-pin-a,
.leaflet-marker-icon.map-pin-d {
	border: 5px solid green;
	margin: -23px 0 0 -17px; /* с рамкой: точка привязки та же */
}
.leaflet-marker-icon.map-pin-d {
	border-color: red;
}

/* стрелки направлений на пине (boards.map.js dirsLayout) */
svg.map-ui-dir {
	fill: #d42020;
	stroke: #8a0d0d;
	stroke-width: .6;
}

/* иконка без своего квадрата: кликабельна только подпись, соседнее острие её не перекрывает */
.leaflet-marker-icon:has(.map-reg) {
	width: 0 !important;
	height: 0 !important;
	overflow: visible !important;
}
.map-reg {
	position: absolute;
	left: 0;
	top: 0;
}
.map-reg-b {
	position: absolute;
	bottom: 7px;
	left: -20px;
	padding: 4px 8px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.4);
	white-space: nowrap;
	line-height: 1.3;
	cursor: pointer;
}
.map-reg-b:after {
	content: '';
	position: absolute;
	left: 13px;
	/* заходит на метку на 1px: при дробном масштабе экрана на стыке не просвечивает тень метки */
	bottom: -6px;
	border: 7px solid transparent;
	border-bottom: 0;
	border-top-color: #fff;
	filter: drop-shadow(0 2px 1px rgba(0,0,0,0.25));
}

/*
 * Фото площадок в балуне (map.xsl: таблица «фото | описание», у описания width:100%).
 * В мобильной версии main_adaptive.css даёт img { max-width: 100% } — ячейка с фото
 * сжимается до нуля и картинки не видно.
 */
.leaflet-popup-content .map-lst img {
	max-width: none;
}

/*
 * Правый верхний угол: порядок не зависит от того, когда контрол добавлен (boards.map.js добавляет свои раньше
 * слоёв из pm.leaflet.js): полный экран, слои, отступ, моё местоположение, pegman (pegman скрывается на части
 * масштабов - пусть он внизу, тогда остальные не прыгают)
 */
.leaflet-top.leaflet-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}
.leaflet-top.leaflet-right .leaflet-control-layers {
	order: 1;
}
.leaflet-top.leaflet-right .leaflet-control-mypos {
	order: 2;
	margin-top: 24px;
}
.leaflet-top.leaflet-right .leaflet-control-pegman {
	order: 3;
}

/* Street View pegman — под layers (topright), стиль как у кнопки слоёв */
.leaflet-streetview-pick,
.leaflet-streetview-pick .leaflet-interactive {
	cursor: crosshair !important;
}
/*
 * Раскрытый список слоёв: в потоке оставляем размер кнопки,
 * сам list — absolute поверх pegman (не сдвигает его вниз).
 * (на topright бывает ещё «layers»-кнопка геолокации без list — не задеваем)
 */
.leaflet-top.leaflet-right .leaflet-control-layers {
	z-index: 1000;
}
.leaflet-top.leaflet-right .leaflet-control-layers.leaflet-control-layers-expanded {
	height: 36px;
	width: 36px;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	overflow: visible !important;
}
.leaflet-touch .leaflet-top.leaflet-right .leaflet-control-layers.leaflet-control-layers-expanded {
	/* .leaflet-touch .leaflet-bar / toggle ≈ 48×48 с учётом рамки */
	height: 48px;
	width: 48px;
}
.leaflet-top.leaflet-right .leaflet-control-layers-expanded .leaflet-control-layers-list {
	position: absolute;
	right: 0;
	top: 0;
	z-index: 1100;
	display: block;
	background: #fff;
	padding: 6px 10px 6px 6px;
	border-radius: 5px;
	box-shadow: 0 1px 5px rgba(0,0,0,.4);
	min-width: 148px;
}
.leaflet-top.leaflet-right .leaflet-control-layers-expanded label {
	white-space: nowrap;
}
.leaflet-control-pegman {
	margin-top: 10px !important;
	clear: both;
	z-index: 900;
}
.leaflet-control-pegman-hidden {
	display: none !important;
}
.leaflet-control-pegman-btn {
	display: block;
	width: 36px !important;
	height: 36px !important;
	background: #fff url('/i/leaflet/pegman.svg') center center / 22px 32px no-repeat !important;
	cursor: grab;
	text-decoration: none;
	border-radius: 4px;
}
.leaflet-touch .leaflet-control-pegman-btn {
	width: 44px !important;
	height: 44px !important;
	background-size: 24px 34px !important;
}
.leaflet-control-pegman-btn:hover {
	background-color: #f4f4f4 !important;
}
.leaflet-control-pegman-btn.active,
.leaflet-control-pegman-btn.dragging {
	background-color: #e8f0fe !important;
	box-shadow: 0 0 0 2px #1a73e8;
	cursor: grabbing;
}
.leaflet-pegman-ghost {
	position: fixed;
	z-index: 10000;
	width: 28px;
	height: 40px;
	background: url('/i/leaflet/pegman.svg') center bottom / 28px 40px no-repeat;
	pointer-events: none;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
/* синие линии покрытия SV поверх подложки (только в режиме выбора) */
.leaflet-sv-coverage {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 450;
	pointer-events: none;
	overflow: hidden;
}
.leaflet-sv-coverage .gm-style {
	background: transparent !important;
}
.leaflet-streetview-toast {
	position: absolute;
	z-index: 1100;
	left: 50%;
	bottom: 48px;
	transform: translateX(-50%);
	max-width: 80%;
	padding: 8px 14px;
	background: rgba(33,33,33,.88);
	color: #fff;
	font: 13px/1.3 Arial, sans-serif;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0,0,0,.3);
	pointer-events: none;
	white-space: nowrap;
}

/* Панорама поверх контейнера карты (в т.ч. fullscreen) */
.leaflet-streetview-pane {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	background: #000;
}
.leaflet-streetview-canvas {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
}
/* крестик в стеке TOP_RIGHT Google (над fullscreen) — белая кнопка 40×40 как у gm */
.leaflet-streetview-close {
	display: block;
	width: 40px;
	height: 40px;
	margin: 10px 10px 0 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: #fff;
	box-shadow: rgba(0, 0, 0, .3) 0 1px 4px -1px;
	cursor: pointer;
	font: 28px/40px Arial, sans-serif;
	color: #666;
	text-align: center;
}
.leaflet-streetview-close:hover {
	color: #333;
	background: #f8f8f8;
}
/* левая адресная плашка SV — шире, чтобы ссылка не ломалась */
.leaflet-streetview-pane .gm-iv-address {
	width: auto !important;
	min-width: 280px;
	max-width: min(420px, calc(100% - 100px));
}
.leaflet-streetview-pane .gm-iv-address-description,
.leaflet-streetview-pane .gm-iv-address-link {
	width: auto !important;
	max-width: none !important;
	white-space: nowrap;
}

/* Places Search — узкий TOP_CENTER, свой белый input (не GMP Material) */
.leaflet-control-places {
	position: absolute;
	z-index: 1000;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	clear: none;
	float: none;
	width: 280px;
	max-width: calc(100% - 160px);
}
/* два класса: перебить input[type="text"] адаптивного CSS (main_adaptive.css) */
.leaflet-control-places .leaflet-control-places-input {
	display: block;
	width: 100%;
	height: 28px;
	padding: 0 8px;
	border: 1px solid #ccc;
	border-radius: 2px;
	background: #fff;
	color: #333;
	font: 14px/28px Arial, sans-serif;
	box-sizing: border-box;
	box-shadow: 0 2px 4px rgba(0,0,0,.2);
	transition: none;
}
.leaflet-control-places-drop {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	margin-top: 2px;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 2px;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
	max-height: 220px;
	overflow-y: auto;
	z-index: 1001;
}
.leaflet-control-places-item {
	padding: 6px 8px;
	font: 13px/1.3 Arial, sans-serif;
	color: #333;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.leaflet-control-places-item:hover {
	background: #f0f0f0;
}
