/* BBC 搜尋優化 v1 — 僅 cloud_store_tourdate 引用 */
/* 字級對齊本頁主題關鍵字標籤實際 computed font-size（1rem → 16px） */

body:has(.bbc-search-v1) {
	overflow-x: hidden;
	max-width: 100vw;
}

.cloud_store_dm_destination_main.cloud_store_dm_destination_mainOpen {
	visibility: hidden;
	pointer-events: none;
	width: 0 !important;
	max-width: 0 !important;
	overflow: hidden !important;
}
.cloud_store_dm_destination_main.cloud_store_dm_destination_mainClose {
	visibility: visible;
	pointer-events: auto;
}

.bbc-search-v1 .bbc-dep-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.25rem 0 0.2rem;
}

.bbc-search-v1 .bbc-dep-plane {
	flex: 0 0 auto;
	width: 1.6rem;
	height: 1.6rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 0.1rem;
}
.bbc-search-v1 .bbc-dep-plane img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bbc-search-v1 .bbc-dep-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	padding: 0.35rem 0.7rem;
	border: 0;
	color: #fff;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
	border-radius: 5px;
	box-sizing: border-box;
}
/* 台北橘紅、台中綠、高雄水藍 */
.bbc-search-v1 .bbc-dep-taipei { background-color: #e85d04; }
.bbc-search-v1 .bbc-dep-taichung { background-color: #43a047; }
.bbc-search-v1 .bbc-dep-kaohsiung { background-color: #29b6f6; }
.bbc-search-v1 .bbc-dep-btn.is-active {
	box-shadow: inset 0 0 0 2px rgba(0,0,0,0.35);
	filter: brightness(0.9);
	font-weight: 700;
}

.bbc-search-v1 .bbc-search-main {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0.45rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.35rem 0;
}

.bbc-search-v1 .bbc-search-main .bbc-search-input-wrap {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	position: relative;
	background: #fff;
	border: 1px solid #c8b8a8;
	border-radius: 4px;
	box-sizing: border-box;
	min-height: 2.4rem;
}

.bbc-search-v1 .bbc-search-main .bbc-search-ico {
	position: absolute;
	left: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.55rem;
	height: 1.55rem;
	z-index: 1;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bbc-search-v1 .bbc-search-main .bbc-search-ico img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bbc-search-v1 .bbc-search-main #keyword {
	width: 100%;
	box-sizing: border-box;
	min-height: 2.4rem;
	height: 100%;
	padding: 0.45rem 2rem 0.45rem 2.35rem;
	font-size: 1rem;
	border: 0;
	background: transparent;
	color: #333;
}
.bbc-search-v1 .bbc-search-main #keyword::placeholder {
	font-size: 1rem;
	opacity: 0.75;
	color: #888;
}

/* 固定小清除鈕，避免舊 CSS 把 img 拉大 */
.bbc-search-v1 .bbc-search-main #spanKeywordX,
.bbc-search-v1 .bbc-search-main .bbc-clear-x {
	position: absolute;
	right: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	cursor: pointer;
	display: none;
	width: 1.25rem !important;
	height: 1.25rem !important;
	line-height: 1.15rem;
	text-align: center;
	font-size: 1.1rem !important;
	font-weight: 700;
	color: #6d4c41;
	background: transparent;
	border: 0;
	padding: 0;
	z-index: 2;
}
.bbc-search-v1 .bbc-search-main #spanKeywordX.is-on,
.bbc-search-v1 .bbc-search-main .bbc-clear-x.is-on {
	display: inline-block;
}
.bbc-search-v1 .bbc-search-main #spanKeywordX img {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}

.bbc-search-v1 .bbc-search-main .bbc-search-btn {
	flex: 0 0 auto;
	align-self: stretch;
	min-height: 2.4rem;
	height: auto;
	padding: 0 1rem;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: #795548;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 0 #5d4037;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.bbc-search-v1 .bbc-search-main .bbc-search-btn:active {
	transform: translateY(1px);
	box-shadow: 0 1px 0 #5d4037;
}

.bbc-search-v1 .bbc-region-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.2rem 0 0.45rem;
	position: relative;
}

/* 目的地圖示浮動於左側外側，不占用標籤橫向空間，首次載入標籤左緣可對齊搜尋欄 */
.bbc-search-v1 .bbc-region-dest-ico {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translate(-100%, -50%);
	margin-right: 0.25rem;
	width: 1.6rem;
	height: 1.6rem;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	pointer-events: none;
	box-sizing: border-box;
}
.bbc-search-v1 .bbc-region-dest-ico img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* 左右箭頭浮動覆蓋於標籤列兩側，不額外占用橫向空間 */
.bbc-search-v1 .bbc-region-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid #d7ccc8;
	background: rgba(255, 255, 255, 0.92);
	color: #5d4037;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	pointer-events: auto;
}
.bbc-search-v1 .bbc-region-arrow#bbcRegionArrowL {
	left: 0.1rem;
}
.bbc-search-v1 .bbc-region-arrow#bbcRegionArrowR {
	right: 0.1rem;
}
.bbc-search-v1 .bbc-region-arrow[hidden] {
	display: none !important;
}

.bbc-search-v1 .bbc-region-strip {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.45rem;
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
	scroll-behavior: smooth;
	/* 首次載入：左側無 padding，第一標籤對齊搜尋欄外框；右側保留可滑至箭頭後可讀 */
	padding-left: 0;
	padding-right: 1.9rem;
	scroll-padding-left: 1.9rem;
	scroll-padding-right: 1.9rem;
}

/* Tablet／Desktop：隱藏捲軸但保留橫向捲動 */
@media (min-width: 768px) {
	.bbc-search-v1 .bbc-region-strip {
		scrollbar-width: none;
		-ms-overflow-style: none;
	}
	.bbc-search-v1 .bbc-region-strip::-webkit-scrollbar {
		display: none;
		height: 0;
	}
}

/* Mobile／Tablet：兩行、左右滑；Desktop 維持單行 */
@media (max-width: 1024px) {
	.bbc-search-v1 .bbc-region-strip {
		display: grid;
		grid-auto-flow: column;
		grid-template-rows: auto auto;
		grid-auto-columns: max-content;
		align-items: center;
		column-gap: 0.45rem;
		row-gap: 0.35rem;
		overflow-x: auto;
		overflow-y: hidden;
	}
}

.bbc-search-v1 .bbc-region-tag {
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 0.4rem 0.75rem;
	border: 1px solid #b3e5fc;
	background: #e1f5fe;
	color: #01579b;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
	border-radius: 5px;
}
.bbc-search-v1 .bbc-region-tag.is-active {
	background: #0288d1;
	border-color: #0277bd;
	color: #fff;
}

.bbc-search-v1 .bbc-search-chips,
.bbc-search-v1 .bbc-search-meta,
.bbc-search-v1 .bbc-search-suggest {
	width: 100%;
	box-sizing: border-box;
	padding: 0.1rem 0 0.3rem;
	font-size: 1rem;
	color: #555;
}

.bbc-search-v1 .bbc-search-suggest:empty,
.bbc-search-v1 .bbc-search-chips:empty,
.bbc-search-v1 .bbc-search-meta:empty {
	display: none;
	padding: 0;
	margin: 0;
}

.bbc-search-v1 .bbc-no-result {
	color: #666;
	font-size: 1rem;
	padding: 0.15rem 0;
}

.bbc-search-v1 .bbc-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0.15rem 0.35rem 0.15rem 0;
	padding: 0.25rem 0.5rem;
	background: #EFEFEF;
	border: 1px solid #d3d3d3;
	border-bottom: 3px solid #c4c4c4;
	border-radius: 8px;
	color: #000;
	font-size: 1rem;
	max-width: 100%;
	box-sizing: border-box;
}
.bbc-search-v1 .bbc-chip button {
	border: 0;
	background: transparent;
	color: #5d4037;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
}
.bbc-search-v1 .bbc-chip-clear-all {
	margin-left: 0.25rem;
	color: #6d4c41;
	text-decoration: underline;
	cursor: pointer;
	background: none;
	border: 0;
	font-size: 1rem;
}

@media (max-width: 767px) {
	/* Mobile：搜尋器左右對齊下方藍色「清倉／最新／熱門」區塊（.cloud_store_dm_select 為 95%） */
	.cloud_store_dm_filterbox.bbc-search-v1 {
		width: 95%;
		max-width: none;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}
	/* Mobile：隱藏地區列左側目的地圖示及占位；Tablet／Desktop 保留 */
	.bbc-search-v1 .bbc-region-dest-ico {
		display: none !important;
		width: 0 !important;
		height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: hidden !important;
		transform: none !important;
	}
	.bbc-search-v1 .bbc-region-strip {
		scrollbar-width: thin;
	}
	.bbc-search-v1 .bbc-region-strip::-webkit-scrollbar {
		height: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bbc-search-v1 .bbc-region-strip {
		scroll-behavior: auto;
	}
}
