.bwm-map-wrapper {
	width: 100%;
}

.bwm-map {
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
}

/* Ghim ảnh chi nhánh */
.bwm-photo-marker {
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
}

.bwm-photo-marker-inner {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 3px solid #e53935;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	pointer-events: auto;
}

.bwm-photo-marker-inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bwm-photo-marker-arrow {
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 8px solid #e53935;
	margin-top: -2px;
}

.bwm-pin-dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #e53935;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	pointer-events: auto;
}

.bwm-popup {
	text-align: center;
	min-width: 140px;
}

.bwm-popup-img {
	width: 100%;
	max-width: 180px;
	height: 100px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 6px;
}

.bwm-popup-title {
	font-weight: 600;
	font-size: 14px;
	color: #222;
}

.bwm-popup-country {
	font-size: 12px;
	color: #666;
	margin-top: 2px;
}

.bwm-popup-desc {
	font-size: 12px;
	color: #555;
	margin-top: 6px;
	text-align: left;
	line-height: 1.4;
}

@media (max-width: 600px) {
	.bwm-photo-marker-inner {
		width: 32px;
		height: 32px;
		border-width: 2px;
	}
	.bwm-pin-dot {
		width: 15px;
		height: 15px;
	}
	.bwm-popup {
		min-width: 120px;
	}
	.bwm-popup-img {
		height: 80px;
	}
}

/* =========================================================================
 * Chế độ bản đồ ảnh tùy chỉnh (image mode)
 * =======================================================================*/
.bwm-img-map-wrapper {
	position: relative;
	width: 100%;
}

.bwm-img-map-inner {
	position: relative;
	width: 100%;
	line-height: 0;
}

.bwm-img-base {
	display: block;
	width: 100%;
	height: auto;
}

.bwm-img-pin {
	position: absolute;
	transform: translate(-50%, -50%);
	cursor: pointer;
	z-index: 2;
	touch-action: manipulation;
}

.bwm-img-pin:hover,
.bwm-img-pin.is-open {
	z-index: 20;
}

/* Vùng chạm rộng hơn cho ngón tay (không đổi giao diện, chỉ mở rộng hitbox) */
.bwm-img-pin::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
	z-index: 0;
}

.bwm-img-pin-ping {
	position: absolute;
	top: 0;
	left: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	opacity: 0.55;
	pointer-events: none;
	z-index: 0;
	animation: bwmPing 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes bwmPing {
	0% { transform: scale(1); opacity: 0.55; }
	100% { transform: scale(2.4); opacity: 0; }
}

.bwm-img-pin-badge {
	position: relative;
	z-index: 1;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
	border: 2.5px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	transition: transform 0.15s ease;
}

.bwm-img-pin-badge img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bwm-img-pin:hover .bwm-img-pin-badge,
.bwm-img-pin.is-open .bwm-img-pin-badge {
	transform: scale(1.15);
	z-index: 3;
}

.bwm-img-pin-tooltip {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translate(-50%, -18px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	padding: 10px;
	width: 200px;
	max-width: calc(100vw - 24px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
	z-index: 5;
	text-align: center;
	pointer-events: none;
	line-height: 1.4; /* reset vì cha có line-height:0 để bo sát ảnh */
}

.bwm-img-pin-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	width: 10px;
	height: 10px;
	background: #fff;
	transform: translate(-50%, -50%) rotate(45deg);
	box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.08);
}

.bwm-img-pin-tooltip.bwm-align-left::after {
	left: 20px;
}

.bwm-img-pin-tooltip.bwm-align-right::after {
	left: auto;
	right: 20px;
}

/* Căn lại tooltip khi ghim ở gần mép trái/phải/trên của màn hình,
   để không bị cắt hoặc tràn ra ngoài (tự động thêm bằng JS). */
.bwm-img-pin-tooltip.bwm-align-left {
	left: 0;
	transform: translate(0, -18px);
}

.bwm-img-pin-tooltip.bwm-align-right {
	left: auto;
	right: 0;
	transform: translate(0, -18px);
}

.bwm-img-pin-tooltip.bwm-flip-below {
	bottom: auto;
	top: 100%;
	transform: translate(-50%, 18px);
}

.bwm-img-pin-tooltip.bwm-flip-below.bwm-align-left {
	transform: translate(0, 18px);
}

.bwm-img-pin-tooltip.bwm-flip-below.bwm-align-right {
	transform: translate(0, 18px);
}

.bwm-img-pin-tooltip.bwm-flip-below::after {
	top: auto;
	bottom: 100%;
	box-shadow: -3px -3px 6px rgba(0, 0, 0, 0.06);
}

.bwm-img-pin.is-open .bwm-img-pin-tooltip {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.bwm-img-tooltip-photo {
	width: 100%;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 6px;
	display: block;
}

.bwm-img-tooltip-title {
	font-weight: 600;
	font-size: 13px;
	color: #222;
	line-height: 1.3;
}

.bwm-img-tooltip-country {
	font-size: 11px;
	color: #777;
	margin-top: 3px;
}

.bwm-img-tooltip-desc {
	font-size: 11px;
	color: #555;
	margin-top: 6px;
	line-height: 1.4;
	text-align: left;
}

.bwm-img-selector-box {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

.bwm-img-selector {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: auto;
	max-width: 220px;
	min-width: 0;
	padding: 8px 34px 8px 14px;
	border: 1px solid #a3572e;
	border-radius: 6px;
	background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a3572e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
	font-size: 13px;
	color: #333;
	cursor: pointer;
	touch-action: manipulation;
}

@keyframes bwmPulse {
	0% { box-shadow: 0 0 0 0 rgba(163, 87, 46, 0.55); }
	70% { box-shadow: 0 0 0 16px rgba(163, 87, 46, 0); }
	100% { box-shadow: 0 0 0 0 rgba(163, 87, 46, 0); }
}

.bwm-pulse .bwm-img-pin-badge {
	animation: bwmPulse 1.2s ease;
}

@media (max-width: 600px) {
	.bwm-img-pin-badge {
		width: 34px;
		height: 34px;
		font-size: 11px;
		border-width: 2px;
	}
	.bwm-img-pin-ping {
		width: 34px;
		height: 34px;
	}

	/* Map to hơn trên di động: tràn hết chiều rộng màn hình, không bị bó hẹp
	   bởi lề/khung nội dung của theme (bỏ qua cả max_width nếu shortcode có set). */
	.bwm-img-map-wrapper,
	.bwm-map-wrapper {
		width: 100vw !important;
		max-width: 100vw !important;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
	}

	/* Ô "Chọn địa điểm": gọn nhỏ ở góc phải, ngay dưới bản đồ. */
	.bwm-img-selector-box {
		margin-top: 8px;
		padding: 0 10px;
	}
	.bwm-img-selector {
		width: auto;
		max-width: 180px;
		font-size: 12.5px;
		padding: 7px 30px 7px 12px;
	}

	.bwm-img-pin-tooltip {
		width: 170px;
		padding: 8px;
	}
	.bwm-img-tooltip-photo {
		height: 65px;
	}
	.bwm-img-tooltip-title {
		font-size: 12px;
	}
	.bwm-img-tooltip-country,
	.bwm-img-tooltip-desc {
		font-size: 10.5px;
	}
}

@media (max-width: 380px) {
	.bwm-img-pin-badge {
		width: 30px;
		height: 30px;
	}
	.bwm-img-pin-ping {
		width: 30px;
		height: 30px;
	}
	.bwm-img-pin-tooltip {
		width: 150px;
	}
}
