/* ==========================================================================
   Map Stacking — Stacked marker badges + spiderfy
   All colors reference CSS custom properties set via inline style by Core.php
   ========================================================================== */

/* --- Stacked marker badge ------------------------------------------------ */

.hrtk-stacked-marker-wrapper {
	background: transparent !important;
	border: none !important;
	width: auto !important;
	overflow: visible !important;
}

.hfse-map-badge-stacked {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--hrtk-badge-bg, #1a1a2e);
	color: var(--hrtk-badge-text, #fff);
	padding: 6px 10px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.25),
		3px 3px 0 -1px #e0e0e0,
		3px 3px 0 0 #ccc;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.hfse-map-badge-stacked:hover {
	transform: scale(1.08);
}

.hrtk-stack-count {
	background: var(--hrtk-count-bg, #e74c3c);
	border-radius: 50%;
	min-width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	padding: 0 2px;
}

/* --- Center dot (when spiderfied) ---------------------------------------- */

.hrtk-spider-center-wrapper {
	background: transparent !important;
	border: none !important;
}

.hrtk-spider-center {
	width: 12px;
	height: 12px;
	background: var(--hrtk-center-dot, #1a1a2e);
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.hrtk-spider-center:hover {
	transform: scale(1.2);
}

/* --- Spider markers ------------------------------------------------------ */

.hrtk-spider-marker {
	background: transparent !important;
	border: none !important;
}

/* Ensure spider legs render above other overlays */
.hrtk-spider-leg {
	stroke: var(--hrtk-connector, #1a1a2e);
	stroke-dasharray: 4 2;
}

.hrtk-spider-animating {
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* --- Focus highlight for grid hover on spiderfied marker ----------------- */

.hrtk-spider-marker-highlight .hfse-map-badge {
	outline: 3px solid var(--hrtk-focus, #3b82f6);
	outline-offset: 2px;
	border-radius: 20px;
}

/* --- Stacked marker focus from grid hover -------------------------------- */

.hrtk-stacked-marker-wrapper.hfse-map-badge-parent-focus .hfse-map-badge-stacked {
	outline: 3px solid var(--hrtk-focus, #3b82f6);
	outline-offset: 2px;
}

/* --- Spider popup (Leaflet popup override) ------------------------------- */

.hrtk-spider-popup .leaflet-popup-content-wrapper {
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	padding: 0;
	overflow: hidden;
}

.hrtk-spider-popup .leaflet-popup-content {
	margin: 0;
	width: 280px !important;
}

.hrtk-spider-popup .leaflet-popup-tip {
	background: #fff;
}

/* --- Spider popup property card image fix -------------------------------- */

.hrtk-spider-popup .hfse-property-infowindow-header {
	width: 100% !important;
	max-width: 100% !important;
	height: 160px;
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

.hrtk-spider-popup .hfse-property-infowindow-header img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.hrtk-spider-popup .hfse-property-infowindow-body {
	padding: 12px 16px;
}

.hrtk-spider-popup .hfse-property-title {
	font-size: 14px;
	line-height: 1.3;
}

.hrtk-spider-popup .hk-card {
	text-decoration: none;
	color: inherit;
	display: block;
}
