.mdh-places-map {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 12px;
	font-family: system-ui, -apple-system, sans-serif;
}

.mdh-places-map__viewport {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.mdh-places-map__loading {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 1rem;
	background: rgba(255, 255, 255, 0.85);
	color: #555;
	text-align: center;
	transition: opacity 0.2s ease;
}

.mdh-places-map.is-ready .mdh-places-map__loading {
	opacity: 0;
	pointer-events: none;
}

.mdh-places-map__spinner {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	border: 3px solid rgba(59, 130, 246, 0.25);
	border-bottom-color: #3b82f6;
	animation: mdh-spin 0.8s linear infinite;
}

@keyframes mdh-spin {
	to { transform: rotate(360deg); }
}

/* Desktop sidebar (праворуч) */
.mdh-places-map__sidebar {
	position: absolute;
	top: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 1000;
	width: 20rem;
	max-width: calc(100% - 2rem);
	display: none;
	flex-direction: column;
	border-radius: 1rem;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.3);
	transition: transform 0.3s ease;
}

@media (min-width: 768px) {
	.mdh-places-map__sidebar { display: flex; }
	.mdh-places-map__sidebar.is-closed { transform: translateX(calc(100% + 1rem)); }
	.mdh-places-map__sheet { display: none; }
}

.mdh-places-map__sidebar-header {
	padding: 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mdh-places-map__sidebar-header h2 {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mdh-places-map__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 0.375rem;
	font-size: 0.9rem;
}

.mdh-places-map__close:hover { background: rgba(0, 0, 0, 0.06); }

.mdh-places-map__filters,
.mdh-places-map__sheet-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0 1rem 1rem;
}

.mdh-places-map__sheet-filters { flex-wrap: nowrap; overflow-x: auto; padding: 0.5rem 1rem; }

.mdh-places-map__filter {
	border: none;
	cursor: pointer;
	padding: 0.3rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.72rem;
	font-weight: 600;
	white-space: nowrap;
	background: rgba(0, 0, 0, 0.06);
	color: #444;
}

.mdh-places-map__filter.is-active { color: #fff; background: #111827; }

.mdh-places-map__list, .mdh-places-map__sheet-list {
	flex: 1;
	overflow-y: auto;
	padding: 0.25rem;
}

.mdh-places-map__item {
	width: 100%;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	text-align: left;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0.6rem 0.75rem;
	border-radius: 0.75rem;
}

.mdh-places-map__item:hover { background: rgba(0, 0, 0, 0.05); }

.mdh-places-map__item-icon {
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
	object-fit: contain;
}

.mdh-places-map__item-dot {
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	flex-shrink: 0;
	margin-top: 0.35rem;
}

.mdh-places-map__item-title {
	margin: 0;
	font-size: 0.85rem;
	font-weight: 600;
}

.mdh-places-map__item-excerpt {
	margin: 0.15rem 0 0;
	font-size: 0.75rem;
	color: #6b7280;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mdh-places-map__sidebar-footer {
	padding: 0.75rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
}

.mdh-places-map__sidebar-footer a {
	font-size: 0.75rem;
	color: #3b82f6;
	font-weight: 600;
	text-decoration: none;
}

.mdh-places-map__open {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 1000;
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.85);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 600;
}

/*
 * BUG FIX: this rule used to be unconditional 'display: none;' with no override for the
 * un-hidden state, so removing the 'hidden' attribute via view.js (after closing the sidebar)
 * never actually showed the button — the desktop reopen affordance was permanently dead. The
 * :not([hidden]) override (higher specificity than the bare class) restores it.
 */
.mdh-places-map__open:not([hidden]) {
	display: flex;
}

/* Mobile bottom sheet */
.mdh-places-map__sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.75rem;
	z-index: 1000;
}

.mdh-places-map__sheet-handle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: none;
	cursor: pointer;
	padding: 0.5rem 0;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 1rem 1rem 0 0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mdh-places-map__sheet-grip {
	width: 2.5rem;
	height: 0.25rem;
	border-radius: 9999px;
	background: #d1d5db;
}

.mdh-places-map__sheet-count {
	font-size: 0.72rem;
	color: #6b7280;
	font-weight: 600;
}

.mdh-places-map__sheet-body {
	max-height: 0;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.92);
	transition: max-height 0.3s ease;
}

.mdh-places-map__sheet.is-open .mdh-places-map__sheet-body { max-height: 50vh; }

@media (min-width: 768px) {
	.mdh-places-map__sheet { display: none; }
}
