/* =========================================================
   SportifyVN V14 — Bộ lọc sân thông minh theo môn
   Chỉ áp dụng cho trang /venues/ (archive sf_venue).
   Tận dụng biến :root đã có ở sportify.css / v12.
   ========================================================= */

/* ---------- Khung tổng ---------- */
.sfv14-filter {
	position: relative;
	background: #fff;
	border-bottom: 1px solid #eceff3;
}
.sfv14-searchrow { padding: 16px 0 4px; }
.sfv14-chiprow {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0 16px;
}

/* ---------- Hàng 1: search ---------- */
.sfv14-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	background: #f4f6f9;
	border: 1px solid #e2e7ee;
	border-radius: 10px;
	padding: 0 14px;
	height: 46px;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.sfv14-search:focus-within {
	border-color: var(--sf-lime, #C8F000);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(200,240,0,.25);
}
.sfv14-search svg { color: #8892a0; flex: 0 0 auto; }
.sfv14-search input[type="search"] {
	flex: 1 1 auto;
	border: 0;
	background: transparent;
	outline: 0;
	font-size: 15px;
	color: var(--sf-navy, #0B1C2C);
	height: 100%;
}
.sfv14-search input::placeholder { color: #9aa4b2; }

/* ---------- Hàng 2: chips ---------- */
.sfv14-chips {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
	flex-wrap: wrap;
	padding-bottom: 2px;
}

.sfv14-chip-wrap { position: relative; flex: 0 0 auto; }

.sfv14-chip,
.sfv14-geo {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid #dde3ec;
	background: #fff;
	color: var(--sf-navy, #0B1C2C);
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.sfv14-chip:hover,
.sfv14-geo:hover { border-color: #c4cdd9; background: #f7f9fc; }
.sfv14-chip svg,
.sfv14-geo svg { color: #4a5568; }

.sfv14-chip.is-active {
	background: var(--sf-lime, #C8F000);
	border-color: var(--sf-lime, #C8F000);
	color: var(--sf-navy, #0B1C2C);
}
.sfv14-chip.is-active svg { color: var(--sf-navy, #0B1C2C); }

.sfv14-caret {
	width: 0; height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #6b7686;
	margin-left: 2px;
}
.sfv14-chip.is-active .sfv14-caret { border-top-color: var(--sf-navy, #0B1C2C); }

.sfv14-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: #e23b3b;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.sfv14-geo.is-on {
	background: var(--sf-navy, #0B1C2C);
	border-color: var(--sf-navy, #0B1C2C);
	color: #fff;
}
.sfv14-geo.is-on svg { color: #fff; }

/* ---------- Panel nhỏ: mở rộng inline theo chiều dọc (đẩy nội dung xuống, không bị cắt) ---------- */
.sfv14-panels {
	width: 100%;
}
.sfv14-panel {
	position: static;
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	background: #fafbfd;
	border: 1px solid #e2e7ee;
	border-radius: 12px;
	margin-top: 4px;
	padding: 14px 16px;
	animation: sfv14Drop .16s ease-out;
}
.sfv14-panel .sfv14-radio,
.sfv14-panel .sfv14-check { display: inline-flex; margin: 0 18px 8px 0; }
.sfv14-panel .sfv14-inline-input { max-width: 420px; }
@keyframes sfv14Drop {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.sfv14-radio,
.sfv14-check,
.sfv14-switch {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 8px;
	font-size: 14px;
	color: #2b3444;
	cursor: pointer;
	transition: background-color .15s ease;
}
.sfv14-radio:hover,
.sfv14-check:hover,
.sfv14-switch:hover { background: #f4f6f9; }
.sfv14-radio input,
.sfv14-check input { accent-color: var(--sf-lime, #C8F000); }

.sfv14-inline-input {
	width: 100%;
	border: 1px solid #dde3ec;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 14px;
	outline: 0;
}
.sfv14-inline-input:focus { border-color: var(--sf-lime, #C8F000); }

/* ---------- Sắp xếp ---------- */
.sfv14-sort { flex: 0 0 auto; }
.sfv14-sort select {
	height: 38px;
	border: 1px solid #dde3ec;
	border-radius: 999px;
	padding: 0 14px;
	background: #fff;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--sf-navy, #0B1C2C);
	cursor: pointer;
}

/* ---------- Panel "Bộ lọc khác" ---------- */
.sfv14-more-scrim {
	position: fixed;
	inset: 0;
	background: rgba(10,20,40,.45);
	z-index: 998;
	opacity: 0;
	transition: opacity .18s ease;
}
.sfv14-more-scrim.is-open { opacity: 1; }

.sfv14-more {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	z-index: 999;
	max-width: 600px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e7ee;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(11,28,44,.2);
	transform: translateY(-8px) scale(.98);
	opacity: 0;
	transition: opacity .18s ease-out, transform .18s ease-out;
}
.sfv14-more.is-open { opacity: 1; transform: translateY(0) scale(1); }

.sfv14-more-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid #eef1f6;
}
.sfv14-more-head h3 { margin: 0; font-size: 16px; color: var(--sf-navy, #0B1C2C); }
.sfv14-more-close {
	border: 0;
	background: transparent;
	cursor: pointer;
	color: #6b7686;
	padding: 4px;
	border-radius: 8px;
	transition: background-color .15s ease;
}
.sfv14-more-close:hover { background: #f4f6f9; }

.sfv14-more-body {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px 22px;
	padding: 16px 18px;
	max-height: 60vh;
	overflow-y: auto;
}
.sfv14-more-col h4 {
	margin: 6px 0 8px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #8892a0;
	font-weight: 700;
}
.sfv14-more-col h4:first-child { margin-top: 0; }

.sfv14-more-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-top: 1px solid #eef1f6;
}
.sfv14-btn-clear {
	border: 1px solid #dde3ec;
	background: #fff;
	color: var(--sf-navy, #0B1C2C);
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .16s ease;
}
.sfv14-btn-clear:hover { background: #f4f6f9; }
.sfv14-btn-apply {
	border: 0;
	background: var(--sf-lime, #C8F000);
	color: var(--sf-navy, #0B1C2C);
	border-radius: 10px;
	padding: 10px 22px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter .16s ease;
}
.sfv14-btn-apply:hover { filter: brightness(.95); }

/* ---------- Khoảng cách real-time ---------- */
.sf-distance-label {
	display: inline-block;
	margin: 2px 0 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sf-coral, #E8724A);
}

/* ---------- Nút xoá lọc ở empty state ---------- */
.sfv14-nofound-clear {
	margin-left: 10px;
	border: 1px solid #dde3ec;
	background: #fff;
	border-radius: 8px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	color: var(--sf-navy, #0B1C2C);
}
.sfv14-nofound-clear:hover { background: #f4f6f9; }

/* ---------- Toast ---------- */
.sfv14-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%) translateY(12px);
	background: var(--sf-navy, #0B1C2C);
	color: #fff;
	padding: 12px 20px;
	border-radius: 10px;
	font-size: 14px;
	z-index: 1000;
	opacity: 0;
	transition: opacity .2s ease, transform .2s ease;
	pointer-events: none;
}
.sfv14-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
	.sfv14-more-body { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
	.sfv14-more { max-width: 92%; }
	.sfv14-more-body { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.sfv14-chiprow { flex-wrap: nowrap; }
	.sfv14-chips {
		flex: 1 1 auto;
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-bottom: 6px;
	}
	.sfv14-chips::-webkit-scrollbar { display: none; }

	/* Sidebar/panel khác: panel "Bộ lọc khác" thành drawer từ dưới lên */
	.sfv14-more {
		position: fixed;
		left: 0; right: 0; bottom: 0; top: auto;
		max-width: none;
		margin: 0;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
		max-height: 86vh;
	}
	.sfv14-more.is-open { transform: translateY(0); }
	.sfv14-more-body {
		grid-template-columns: 1fr 1fr;
		max-height: 64vh;
	}
	.sfv14-sort { display: none; }
}

@media (max-width: 480px) {
	.sfv14-search { height: 42px; }
	.sfv14-more-body { grid-template-columns: 1fr; }
	.sfv14-more-foot { flex-direction: column-reverse; }
	.sfv14-more-foot .sfv14-btn-clear,
	.sfv14-more-foot .sfv14-btn-apply { width: 100%; }
}
