/**
 * Border Port Map - 前台样式
 *
 * 类名前缀统一 bpm-，与 travel-map-nav（travel- 前缀）互不干扰，
 * 同页并存多个地图时也不会样式打架。
 */

.border-port-map-wrap {
	position: relative;
	max-width: 100%;
	overflow: hidden;        /* 父容器负责裁剪瓦片圆角 */
	border-radius: 14px;
}

.border-port-map {
	width: 100%;
	height: min(92vh, 1150px);
	min-height: 520px;
	border-radius: 14px;
	overflow: visible;       /* 子层允许标签溢出，避免边缘省标被裁 */
	z-index: 0;
}

/* ============ 顶部工具条 ============ */

.bpm-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	justify-content: space-between;
	padding: 10px 4px;
}

.bpm-line-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bpm-line-btn {
	border: 1px solid #d8dee9;
	background: #fff;
	color: #334155;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.18s ease;
}

.bpm-line-btn:hover {
	border-color: #1d4ed8;
	color: #1d4ed8;
}

.bpm-line-btn.is-active {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}

.bpm-toolbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bpm-status {
	font-size: 12px;
	color: #64748b;
}

.bpm-back-btn {
	border: 1px solid #d8dee9;
	background: #fff;
	color: #334155;
	font-size: 12px;
	font-weight: 600;
	padding: 7px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.18s ease;
}

.bpm-back-btn:hover {
	border-color: #1d4ed8;
	color: #1d4ed8;
}

/* ============ 空数据提示 ============ */

.bpm-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: min(92vh, 1150px);
	min-height: 520px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
}

.bpm-empty p {
	max-width: 420px;
	text-align: center;
	color: #475569;
	font-size: 14px;
	line-height: 1.8;
}

/* ============ 省份聚合圆标（圆点 + 下方胶囊） ============ */

.bpm-province-icon {
	background: transparent;
	border: none;
}

.bpm-province {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: transparent;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.bpm-province:hover {
	transform: scale(1.08);
	filter: drop-shadow(0 6px 14px rgba(29, 78, 216, 0.45));
	z-index: 600;        /* 悬停时压过其他省标，避开互相遮挡 */
}

.bpm-province-badge {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 24px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(29, 78, 216, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.bpm-province-name {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.1;
	color: #0f172a;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid #cbd5e1;
	padding: 2px 7px;
	border-radius: 999px;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ============ 口岸点位 ============ */

.bpm-port-icon {
	background: transparent;
	border: none;
}

.bpm-port-dot {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	border: 2.5px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.bpm-port-icon:hover .bpm-port-dot {
	transform: scale(1.35);
}

/* ============ 弹窗卡片 ============ */

.border-port-map .leaflet-popup-content-wrapper {
	border-radius: 14px;
	padding: 0;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.border-port-map .leaflet-popup-content {
	margin: 0;
}

.border-port-map .leaflet-popup-close-button {
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #475569;
	font-size: 18px;
	line-height: 1;
}

.bpm-popup {
	padding: 14px;
	width: 300px;
	box-sizing: border-box;
}

.bpm-popup-ph {
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

.bpm-popup-ph-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 56px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

.bpm-popup-title {
	margin: 10px 0 6px;
	font-size: 18px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.3;
}

.bpm-popup-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.bpm-chip {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	line-height: 1.4;
}

.bpm-chip-province {
	background: #e0f2fe;
	color: #0369a1;
}

.bpm-chip-route {
	background: #ede9fe;
	color: #6d28d9;
}

.bpm-chip-type {
	background: #fee2e2;
	color: #b91c1c;
}

.bpm-popup-loc {
	font-size: 12px;
	color: #64748b;
	margin: 0 0 6px;
}

.bpm-popup-summary {
	font-size: 13px;
	color: #334155;
	line-height: 1.7;
	margin: 0 0 12px;
}

.bpm-popup-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
}

.bpm-popup-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 9px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.15s ease;
}

.bpm-popup-btn-primary {
	background: #1d4ed8;
	color: #fff;
}

.bpm-popup-btn-primary:hover {
	background: #1e40af;
	color: #fff;
}

/* 行程猫 v1.6.0：「♡ 想去」按钮（想去 → 打卡 → 详情） */
.bpm-wish-btn {
	border: 1px solid #d6336c;
	background: #fff;
	color: #d6336c;
	cursor: pointer;
}

.bpm-wish-btn:hover {
	background: #d6336c;
	color: #fff;
}

.bpm-wish-btn.is-done {
	border-color: #d6336c;
	background: #fce7f0;
	color: #c2255c;
}

.bpm-wish-btn.is-done:hover {
	background: #c2255c;
	color: #fff;
}

.bpm-popup-btn-disabled {
	background: #f1f5f9;
	color: #94a3b8;
	cursor: default;
}

.bpm-popup-tag-hint {
	font-size: 11px;
	color: #94a3b8;
}

/* ============ 移动端：弹窗改底部抽屉 ============ */

@media (max-width: 640px) {
	.border-port-map {
		height: 60vh;
		min-height: 400px;
	}

	.bpm-toolbar {
		padding: 8px 2px;
	}

	.bpm-line-btn {
		font-size: 12px;
		padding: 7px 11px;
	}

	/* 抽屉：吸底、全宽、保留标题可滚动 */
	.border-port-map .leaflet-popup {
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		margin: 0 !important;
		transform: none !important;
		width: 100% !important;
		max-height: 62vh;
	}

	.border-port-map .leaflet-popup-content-wrapper {
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.2);
	}

	.border-port-map .leaflet-popup-content {
		width: 100% !important;
		max-height: 56vh;
		overflow-y: auto;
	}

	.bpm-popup {
		width: auto;
	}
}

/* ============ 0.2.0 D-1：弹窗实用信息 ============ */

.bpm-popup-facts {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0 0 10px;
	padding: 8px 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 12px;
	color: #334155;
}

.bpm-popup-facts span {
	display: flex;
	gap: 6px;
	line-height: 1.6;
}

.bpm-popup-facts b {
	color: #64748b;
	font-weight: 600;
	flex: none;
}

.bpm-popup-note {
	margin: 0 0 10px;
	padding: 8px 10px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	font-size: 12px;
	color: #92400e;
	line-height: 1.7;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ============ 0.2.0 D-2：口岸打卡按钮 ============ */

.bpm-checkin-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	border: 1px solid #e11d48;
	background: #fff;
	color: #e11d48;
	font-size: 13px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.bpm-checkin-btn:hover {
	background: #fff1f2;
}

.bpm-checkin-btn:disabled {
	cursor: wait;
	opacity: .7;
}

.bpm-checkin-btn.is-done {
	border-color: #16a34a;
	background: #16a34a;
	color: #fff;
	cursor: default;
	opacity: 1;
}

/* ============ 轻提示 ============ */

.bpm-toast {
	position: fixed;
	right: 16px;
	bottom: 24px;
	z-index: 99999;
	max-width: 320px;
	padding: 10px 16px;
	background: #16a34a;
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s;
	pointer-events: none;
}

.bpm-toast.show {
	opacity: 1;
	transform: translateY(0);
}

.bpm-toast.err {
	background: #dc2626;
}
