/**
 * 飯店品牌地圖（[seascape_brand_map]）。
 *
 * 版面殼、側欄、飯店列、pin、卡牌、控制鈕、全螢幕與 RWD 全部沿用 resort-map.css
 * （根元素 .ss-rmap.ss-rmap--brand）；這裡只放品牌頁特有的部件：
 * 國家數量泡泡、品牌／國家清單、麵包屑與返回、三層面板切換、圖例、卡牌多一列連結。
 * 色票比照 MLE 轉機路線圖：海藍、金、青。
 */

.ss-rmap--brand {
	--ss-bmap-sea: #3B82BD;
	--ss-bmap-gold: #C9A24B;
	--ss-bmap-teal: #38A6A5;
	--ss-bmap-ink: var(--wp--preset--color--accent-700, #0C2544);
}

/* ---------- 三層面板：由根元素 data-level 決定，JS 執行前不會閃現整份飯店清單 ---------- */

.ss-rmap--brand .ss-bmap__level {
	display: none;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.ss-rmap--brand[data-level="brands"] .ss-bmap__level--brands,
.ss-rmap--brand[data-level="country-brands"] .ss-bmap__level--brands,
.ss-rmap--brand[data-level="countries"] .ss-bmap__level--countries,
.ss-rmap--brand[data-level="hotels"] .ss-bmap__level--hotels {
	display: flex;
}

/* ---------- 側欄頭：返回、總數、列表連結 ---------- */

.ss-bmap__head {
	display: flex;
	flex-direction: column;
}

.ss-bmap__back {
	align-self: flex-start;
	margin: 10px 16px 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--accent, #163C63);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
}

.ss-bmap__back:hover,
.ss-bmap__back:focus-visible {
	text-decoration: underline;
}

.ss-bmap__back[hidden] {
	display: none;
}

.ss-rmap--brand .ss-rmap__sidehead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.ss-bmap__archivelink {
	flex-shrink: 0;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent, #163C63);
	text-decoration: none;
}

.ss-bmap__archivelink:hover {
	text-decoration: underline;
}

.ss-bmap__archivelink[hidden] {
	display: none;
}

.ss-bmap__sidetitle {
	font-weight: 700;
	color: var(--ss-bmap-ink);
}

/* ---------- 品牌清單 ---------- */

.ss-bmap__brands,
.ss-bmap__countries {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ss-bmap__brand,
.ss-bmap__countrybtn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 10px 16px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--gray-100, #F2F5F8);
	background: #fff;
	color: var(--wp--preset--color--text, #15222E);
	font: inherit;
	font-size: 0.88rem;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ss-bmap__brand:hover,
.ss-bmap__brand:focus-visible,
.ss-bmap__countrybtn:hover,
.ss-bmap__countrybtn:focus-visible {
	background: var(--wp--preset--color--gray-100, #F2F5F8);
}

.ss-bmap__brand.is-active {
	background: var(--wp--preset--color--accent-100, #EAF0F7);
	box-shadow: inset 3px 0 0 var(--ss-bmap-gold);
}

.ss-bmap__brandname {
	min-width: 0;
	font-weight: 600;
}

.ss-bmap__brandcount,
.ss-bmap__countrycount {
	flex-shrink: 0;
	min-width: 2.4em;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--wp--preset--color--sand, #F8F3E7);
	color: var(--ss-bmap-ink);
	font-size: 0.75rem;
	font-weight: 700;
	text-align: center;
}

.ss-bmap__allhotels {
	display: block;
	width: calc(100% - 32px);
	margin: 10px 16px 4px;
	padding: 9px 12px;
	border: 1px solid var(--wp--preset--color--accent, #163C63);
	border-radius: 8px;
	background: #fff;
	color: var(--wp--preset--color--accent, #163C63);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
}

.ss-bmap__allhotels:hover,
.ss-bmap__allhotels:focus-visible {
	background: var(--wp--preset--color--accent-100, #EAF0F7);
}

.ss-bmap__allhotels[hidden],
.ss-bmap__brands li[hidden] {
	display: none;
}

.ss-bmap__note {
	margin: 0;
	padding: 10px 16px;
	border-top: 1px solid var(--wp--preset--color--gray-300, #E1E5EA);
	color: var(--wp--preset--color--gray, #5A6672);
	font-size: 0.75rem;
	line-height: 1.5;
}

/* ---------- 飯店清單：國家標題在子目的地標題之上 ---------- */

.ss-bmap__country {
	content-visibility: auto;
	contain-intrinsic-size: auto 480px;
}

.ss-bmap__country[hidden] {
	display: none;
}

.ss-bmap__countryhead {
	position: sticky;
	top: 0;
	z-index: 3;
	margin: 0;
	padding: 9px 16px;
	font-size: 0.92rem;
	font-weight: 700;
	color: #fff;
	background: var(--ss-bmap-ink);
}

.ss-bmap__countryhead span {
	margin-left: 4px;
	font-size: 0.78rem;
	font-weight: 400;
	opacity: 0.85;
}

.ss-rmap--brand[data-level="hotels"] .ss-bmap__countryhead {
	display: none;
}

/* ---------- 麵包屑（浮在地圖左上，只有按鈕可點） ---------- */

.ss-bmap__crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 4px;
	margin: 4px 0 0;
	font-size: 0.8rem;
	line-height: 1.4;
	color: var(--ss-bmap-ink);
}

.ss-bmap__crumb-item {
	pointer-events: auto;
}

.ss-bmap__crumb button.ss-bmap__crumb-item {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--accent, #163C63);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ss-bmap__crumb-item.is-current {
	font-weight: 700;
}

.ss-bmap__crumb-sep {
	color: var(--wp--preset--color--gray, #5A6672);
}

.ss-rmap--brand.is-raster .ss-bmap__crumb,
.ss-rmap--brand.is-raster .ss-bmap__crumb-sep {
	color: var(--ss-bmap-ink);
}

/* ---------- 國家數量泡泡 ---------- */

.leaflet-pane.ss-bmap-bubble-pane {
	z-index: 640;
}

.ss-bmap-bubble {
	background: none;
	border: 0;
}

.ss-bmap-bubble__in {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	width: 100%;
	height: 100%;
	padding: 4px;
	box-sizing: border-box;
	border: 1.5px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	/* 半透明海藍：底圖與其他泡泡透得過去，外圈再加一層更淡的光暈當量感。 */
	background: rgba(59, 130, 189, 0.55);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0 0 6px rgba(59, 130, 189, 0.18), 0 2px 8px rgba(12, 37, 68, 0.25);
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ss-bmap-bubble__count {
	font-size: 1em;
	font-weight: 800;
	line-height: 1;
}

.ss-bmap-bubble.is-large .ss-bmap-bubble__in {
	font-size: 1.05rem;
	box-shadow: 0 0 0 9px rgba(59, 130, 189, 0.16), 0 2px 10px rgba(12, 37, 68, 0.25);
}

.ss-bmap-bubble:hover .ss-bmap-bubble__in,
.ss-bmap-bubble:focus .ss-bmap-bubble__in,
.ss-bmap-bubble:focus-visible .ss-bmap-bubble__in {
	background: rgba(56, 166, 165, 0.78);
	box-shadow: 0 0 0 8px rgba(56, 166, 165, 0.22), 0 2px 10px rgba(12, 37, 68, 0.3);
	transform: scale(1.06);
}

.ss-bmap-bubble.is-active .ss-bmap-bubble__in {
	background: rgba(201, 162, 75, 0.85);
	box-shadow: 0 0 0 8px rgba(201, 162, 75, 0.22), 0 2px 10px rgba(12, 37, 68, 0.3);
}

/* 國家名放在圈內：白字、比數字小一號；超過四個字再縮一級。 */
.ss-bmap-bubble__name {
	max-width: 100%;
	overflow: hidden;
	color: rgba(255, 255, 255, 0.95);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.1;
	white-space: nowrap;
	text-overflow: ellipsis;
	pointer-events: none;
}

.ss-bmap-bubble__name.is-long {
	font-size: 0.54rem;
	letter-spacing: 0;
}

/* 機場：徽章在國家層就出現，代碼與名稱文字放到最大（maxZoom）才顯示。 */
.ss-rmap--brand:not(.has-visible-airport-labels) .ss-rmap-landmark--airport .ss-rmap-landmark__label {
	display: none;
}

/* ---------- 浮水印與機場：樣式沿用 resort-map.css，這裡只補品牌圖的差異 ---------- */

/* 世界圖的浮水印比海島圖小一號，格子密度才不會搶過泡泡。 */
.ss-rmap--brand .ss-rmap-watermark__text {
	font-size: 0.95rem;
}

/* ---------- 切換到詳細地圖的浮動按鈕（底部置中） ---------- */

.ss-bmap__handoff {
	position: absolute;
	left: 50%;
	bottom: 1.1rem;
	z-index: 655;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.55rem 1rem 0.55rem 0.8rem;
	border-radius: 999px;
	background: var(--ss-bmap-gold, #C9A24B);
	color: var(--ss-bmap-ink);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(12, 37, 68, 0.28);
	transform: translateX(-50%);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.ss-bmap__handoff:hover,
.ss-bmap__handoff:focus-visible {
	background: #d8b45f;
	color: var(--ss-bmap-ink);
	transform: translateX(-50%) translateY(-2px);
}

.ss-bmap__handoff[hidden] {
	display: none;
}

.ss-bmap__handoff-icon {
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--ss-bmap-sea, #3B82BD);
	box-shadow: 0 0 0 2px rgba(12, 37, 68, 0.18);
}

/* ---------- 圖例（左下，取代海島圖層開關） ---------- */

.ss-bmap__legend {
	position: absolute;
	left: 1rem;
	bottom: 1rem;
	z-index: 650;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 8px rgba(12, 37, 68, 0.15);
	color: var(--ss-bmap-ink);
	font-size: 0.75rem;
	pointer-events: none;
}

.ss-bmap__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.ss-bmap__legend-bubble {
	width: 14px;
	height: 14px;
	border: 1.5px solid #fff;
	border-radius: 50%;
	background: rgba(59, 130, 189, 0.55);
	box-shadow: 0 0 0 3px rgba(59, 130, 189, 0.18);
}

.ss-bmap__legend-pin {
	width: 10px;
	height: 10px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--wp--preset--color--accent, #163C63);
	box-shadow: 0 1px 3px rgba(12, 37, 68, 0.3);
}

/* ---------- 卡牌品牌變體：多一列海島地圖連結（resort-map.css 的固定高度不動） ---------- */

.ss-rmap-popup.ss-rmap-popup--brand {
	height: auto;
	grid-template-rows: 100px 18px 26px 17px auto;
	padding-bottom: 8px;
}

.ss-rmap-popup__maplink {
	display: inline-block;
	margin-inline: 10px;
	font-size: 0.72rem;
	font-weight: 600;
	color: #9A7418;
	text-decoration: none;
}

.ss-rmap-popup__maplink:hover {
	text-decoration: underline;
}

/* ---------- RWD ---------- */

@media (max-width: 1024px) {
	.ss-bmap__brands,
	.ss-bmap__countries {
		max-height: none;
		overflow: visible;
	}

	.ss-bmap__countryhead {
		position: static;
	}
}

@media (max-width: 640px) {
	.ss-rmap--brand .ss-rmap__float {
		flex-direction: column;
		align-items: flex-start;
		row-gap: 2px;
	}

	.ss-bmap__crumb {
		font-size: 0.72rem;
	}

	.ss-bmap__legend {
		left: 0.6rem;
		bottom: 0.6rem;
		gap: 0.6rem;
		padding: 0.3rem 0.6rem;
		font-size: 0.68rem;
	}

	/* 手機：圖例在左下，切換鈕改到圖例上方避免重疊。 */
	.ss-bmap__handoff {
		bottom: 3rem;
		font-size: 0.78rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ss-bmap-bubble__in,
	.ss-bmap__brand,
	.ss-bmap__countrybtn {
		transition: none;
	}
}
