/* =====================================================================
 * [tour_search] – THANH TÌM TOUR
 * Màu: chỉ dùng biến :root (--hg-primary, --hg-text, --hg-button, --green-natural)
 * ===================================================================== */
.tour-search {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	padding: 8px 8px 8px 12px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--hg-primary) 12%, transparent);
	color: var(--hg-text);
	text-align: left;
}
.tour-search * { box-sizing: border-box; }

/* ---------- Ô chọn ---------- */
.ts-field { position: relative; flex: 1 1 0; min-width: 0; }
.tour-search .ts-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 8px 14px;
	min-height: 0;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	color: var(--hg-text) !important;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.3;
	box-shadow: none !important;
	cursor: pointer;
	transition: background .15s;
}
.tour-search .ts-toggle:hover,
.ts-field.is-open .ts-toggle { background: color-mix(in srgb, var(--hg-primary) 6%, #fff) !important; }
.ts-ic { 
    flex: none; 
    width: 28px; 
    height: 28px; 
    color: var(--hg-primary); 
}
.ts-text { flex: 1 1 auto; min-width: 0; }
.ts-text b { 
    display: block; 
    color: var(--hg-primary); 
    font-size: 20px; 
    font-weight: 700; 
    line-height: 1.3; 
}
.ts-value { display: block; overflow: hidden; color: var(--hg-text); font-size: 13px; font-weight: 500; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.ts-value.is-empty { 
    color: var(--hg-text); 
    font-weight: 400;
    font-size: 16px;
}
.ts-chev { flex: none; width: 16px; height: 16px; color: color-mix(in srgb, var(--hg-text) 60%, #fff); transition: transform .2s; }
.ts-field.is-open .ts-chev { transform: rotate(180deg); }

.ts-sep { flex: none; width: 1px; height: 32px; background: color-mix(in srgb, var(--hg-text) 12%, #fff); }

/* ---------- Nút tìm ---------- */
.tour-search .ts-submit {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	min-height: 0;
	border: 0 !important;
	border-radius: 50%;
	background: var(--hg-primary) !important;
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--hg-primary) 30%, transparent) !important;
	cursor: pointer;
	transition: background .2s, transform .2s;
}
.tour-search .ts-submit:hover { background: var(--hg-button) !important; transform: scale(1.05); }
.ts-submit svg { width: 22px; height: 22px; }
.ts-submit-text { display: none; }

/* ---------- Danh sách xổ xuống ---------- */
.ts-panel {
	position: absolute;
	top: calc(100% + 14px);
	left: 0;
	width: max(100%, 320px);
	padding: 8px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px color-mix(in srgb, var(--hg-text) 18%, transparent);
	animation: ts-drop .18s ease-out;
}
.ts-panel[hidden] { display: none; }
@keyframes ts-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.tour-search .ts-filter {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0 0 6px;
	padding: 0 12px;
	border: 1px solid color-mix(in srgb, var(--hg-text) 18%, #fff) !important;
	border-radius: 10px;
	background: #fff !important;
	box-shadow: none !important;
	color: var(--hg-text);
	font-size: 14px;
}
.tour-search .ts-filter:focus { border-color: var(--hg-primary) !important; outline: none; }

.ts-list { max-height: 300px; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.ts-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--hg-text);
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}
.ts-list li:hover { background: color-mix(in srgb, var(--hg-primary) 6%, #fff); color: var(--hg-primary); }
.ts-list li.is-selected { background: color-mix(in srgb, var(--hg-primary) 10%, #fff); color: var(--hg-primary); font-weight: 600; }
.ts-list li small { flex: none; color: color-mix(in srgb, var(--hg-text) 60%, #fff); font-size: 12px; font-weight: 400; }
.ts-list li.ts-depth-1 { padding-left: 26px; }
.ts-list li.ts-depth-2 { padding-left: 40px; }
.ts-list li.ts-depth-3 { padding-left: 54px; }
.ts-list li.ts-empty { justify-content: center; color: color-mix(in srgb, var(--hg-text) 60%, #fff); cursor: default; }
.ts-list li.ts-empty:hover { background: none; }

/* Focus bằng bàn phím */
.tour-search button:focus { outline: none; }
.tour-search button:focus-visible { outline: 2px solid var(--hg-primary); outline-offset: 2px; }

/* ---------- Tablet dọc ---------- */
@media (max-width: 849px) {
	.tour-search { max-width: 640px; }
	.ts-text b { font-size: 14px; }
	.ts-panel { width: max(100%, 280px); }
}

/* ---------- Điện thoại: xếp dọc ---------- */
@media (max-width: 549px) {
	.tour-search { flex-direction: column; align-items: stretch; gap: 0; padding: 8px; border-radius: 20px; }
	.tour-search .ts-toggle { padding: 12px; border-radius: 14px; }
	.ts-sep { width: auto; height: 1px; margin: 0 12px; }
	.ts-panel { position: static; width: 100%; margin: 4px 0 6px; box-shadow: none; border: 1px solid color-mix(in srgb, var(--hg-text) 10%, #fff); }
	.ts-list { max-height: 260px; }
	.tour-search .ts-submit { width: 100%; height: 48px; margin-top: 6px; border-radius: 999px; }
	.tour-search .ts-submit:hover { transform: none; }
	.ts-submit-text { display: inline; }
}
