/* Bald Branch Maps — structure only. Colours, type and spacing come from Elementor controls. */

.bbm {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--bbm-gap, 16px);
}

/* ---------- Layout ---------- */

.bbm__layout {
	display: flex;
	flex-direction: column;
	gap: var(--bbm-gap, 16px);
	min-width: 0;
}
.bbm--list-left .bbm__layout { flex-direction: row; }
.bbm--list-right .bbm__layout { flex-direction: row-reverse; }
.bbm--list-below .bbm__layout { flex-direction: column-reverse; }

.bbm__map-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	isolation: isolate;
}
.bbm__map {
	width: 100%;
	height: var(--bbm-map-h, 520px);
	z-index: 0;
}

.bbm__list-wrap {
	flex: 0 0 var(--bbm-list-w, 320px);
	max-width: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	max-height: var(--bbm-list-mh, 360px);
}
.bbm--list-left .bbm__list-wrap,
.bbm--list-right .bbm__list-wrap {
	max-height: var(--bbm-map-h, 520px);
}

@media (max-width: 767px) {
	.bbm--list-left .bbm__layout,
	.bbm--list-right .bbm__layout { flex-direction: column-reverse; }
	.bbm--list-left .bbm__list-wrap,
	.bbm--list-right .bbm__list-wrap {
		flex-basis: auto;
		max-height: var(--bbm-list-mh, 360px);
	}
}

/* ---------- Search ---------- */

.bbm__search {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 8px;
	box-sizing: border-box;
}
.bbm__search-input {
	flex: 1 1 200px;
	min-width: 0;
	margin: 0;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}
.bbm--search-overlay .bbm__search {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1050;
	max-width: calc(100% - 24px);
}
@media (max-width: 767px) {
	.bbm--search-overlay .bbm__search { left: 12px; width: auto !important; }
}
.bbm.is-loading .bbm-btn--search,
.bbm.is-loading .bbm-btn--locate {
	opacity: .6;
	pointer-events: none;
}

.bbm__message:empty { display: none; }

/* ---------- Buttons ---------- */

.bbm .bbm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
	white-space: nowrap;
	box-sizing: border-box;
	transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s;
}
.bbm .bbm-btn__icon { display: inline-flex; line-height: 1; }
.bbm .bbm-btn svg { width: 1em; height: 1em; fill: currentColor; }

/* ---------- Markers / pins ---------- */

.bbm .bbm-marker {
	background: none;
	border: 0;
	width: 0;
	height: 0;
}

.bbm .bbm-pin,
.bbm .bbm-pin:hover,
.bbm .bbm-pin:focus {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	min-height: 0;
	border-radius: 0;
}
.bbm .bbm-pin {
	position: absolute;
	left: 0;
	top: 0;
	display: block;
	width: 34px;
	line-height: 0;
	cursor: pointer;
	transform: translate(-50%, -100%);
	transform-origin: 50% 100%;
	transition: transform .15s ease;
}
.bbm .bbm-pin--branch:hover,
.bbm .bbm-pin--branch:focus-visible,
.bbm .bbm-pin--branch.is-active {
	transform: translate(-50%, -100%) scale(var(--bbm-pin-scale, 1.12));
}
.bbm .bbm-pin:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.bbm .bbm-pin__svg { display: block; width: 100%; height: auto; overflow: visible; }
.bbm .bbm-pin__body { transition: fill .15s; }
.bbm .bbm-pin__icon {
	position: absolute;
	left: 50%;
	top: 35%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	font-size: 14px;
	pointer-events: none;
}
.bbm .bbm-pin__icon svg { width: 1em; height: 1em; }

.bbm .bbm-pin__img { display: block; width: 100%; height: auto; max-width: none; }
.bbm .bbm-pin__img--active { display: none; }
.bbm .bbm-pin.is-active .bbm-pin__img--active { display: block; }
.bbm .bbm-pin.is-active .bbm-pin__img:not(.bbm-pin__img--active):has(+ .bbm-pin__img--active) { display: none; }

.bbm .bbm-pin--user {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	cursor: default;
	box-sizing: border-box;
}
.bbm .bbm-pin--user::after {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	background: var(--bbm-user-pulse, #2563eb);
	opacity: .35;
	animation: bbm-pulse 2s ease-out infinite;
	z-index: -1;
}
@keyframes bbm-pulse {
	0% { transform: scale(1); opacity: .35; }
	100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.bbm .bbm-pin--user::after { animation: none; }
	.bbm .bbm-pin { transition: none; }
}

/* ---------- Popup ---------- */

.bbm__popup-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1100;
}
.bbm-popup {
	position: absolute;
	left: 0;
	top: 0;
	width: 290px;
	max-width: calc(100% - 24px);
	box-sizing: border-box;
	pointer-events: auto;
	transform: translate(-50%, calc(-100% - var(--bbm-popup-offset, 12px) - var(--bbm-arrow, 8px)));
	animation: bbm-pop .16s ease-out;
}
.bbm-popup[hidden] { display: none; }
@keyframes bbm-pop {
	from { opacity: 0; margin-top: 6px; }
	to { opacity: 1; margin-top: 0; }
}
.bbm-popup__inner {
	position: relative;
	overflow: hidden;
	border-radius: inherit;
	max-height: calc(var(--bbm-map-h, 520px) - 60px);
	overflow-y: auto;
}
.bbm-popup__arrow {
	position: absolute;
	left: 50%;
	top: 100%;
	width: 0;
	height: 0;
	transform: translateX(-50%);
	border-style: solid;
	border-color: var(--bbm-popup-bg, #fff) transparent transparent transparent;
	border-width: var(--bbm-arrow, 8px) var(--bbm-arrow, 8px) 0 var(--bbm-arrow, 8px);
}

.bbm .bbm-popup__close,
.bbm .bbm-popup__close:hover,
.bbm .bbm-popup__close:focus {
	border: 0;
	box-shadow: none;
	padding: 0;
	min-height: 0;
}
.bbm .bbm-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: color .15s, background-color .15s;
}
.bbm .bbm-popup__close svg { width: 1em; height: 1em; display: block; }

.bbm-popup__media img {
	display: block;
	width: 100%;
	height: 140px;
	object-fit: cover;
	max-width: none;
}
.bbm-popup__title { margin: 0 0 10px; padding-right: 28px; }
.bbm-popup__media + .bbm-popup__body .bbm-popup__title { padding-right: 0; }
.bbm-popup__rows { display: flex; flex-direction: column; gap: 6px; }
.bbm-popup__row { display: flex; align-items: flex-start; gap: 8px; }
.bbm-popup__icon {
	flex: 0 0 auto;
	display: inline-flex;
	justify-content: center;
	line-height: 1.5;
}
.bbm-popup__icon svg { width: 1em; height: 1em; margin-top: .25em; }
.bbm-popup__desc { margin-top: 10px; }
.bbm-popup__desc > :last-child { margin-bottom: 0; }
.bbm-popup__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- List ---------- */

.bbm__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bbm__item { margin: 0; padding: 0; }
.bbm__item[hidden] { display: none; }
.bbm .bbm__item-btn,
.bbm .bbm__item-btn:hover,
.bbm .bbm__item-btn:focus {
	color: inherit;
	box-shadow: none;
}
.bbm .bbm__item-btn {
	display: block;
	width: 100%;
	margin: 0;
	text-align: left;
	font: inherit;
	white-space: normal;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color .15s, border-color .15s;
}
.bbm__item-name,
.bbm__item-address,
.bbm__item-distance { display: block; }
.bbm__item-name { font-weight: 600; }
.bbm__item-distance:empty { display: none; }
.bbm__item-distance { margin-top: 4px; }

/* Leaflet: keep theme image rules off map tiles */
.bbm .leaflet-container img { max-width: none !important; }
.bbm .leaflet-container { font: inherit; }
