/* =============================================================================
 * WooFilterX — vnwfx utility & component CSS (dùng chung admin + frontend)
 * Mọi class đều có tiền tố vnwfx-. Phong cách iOS, màu chủ đạo #56AB2F.
 * ========================================================================== */

:root {
	--vnwfx-primary: #56AB2F;
	--vnwfx-primary-dark: #468f26;
	--vnwfx-primary-soft: rgba(86, 171, 47, 0.12);
	--vnwfx-primary-ring: rgba(86, 171, 47, 0.35);
	--vnwfx-ink: #1c1c1e;
	--vnwfx-ink-soft: #6b7280;
	--vnwfx-line: #e5e7eb;
	--vnwfx-bg: #f5f5f7;
	--vnwfx-card: #ffffff;
	--vnwfx-radius: 14px;
	--vnwfx-radius-sm: 10px;
	--vnwfx-radius-lg: 20px;
	--vnwfx-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
	--vnwfx-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset cục bộ trong phạm vi vnwfx-root để không đụng theme. */
.vnwfx-root,
.vnwfx-root * {
	box-sizing: border-box;
}
.vnwfx-root {
	color: var(--vnwfx-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* ----- Layout ----- */
.vnwfx-flex { display: flex; }
.vnwfx-flex-grow { flex: 1; }
.vnwfx-block { display: block; }
.vnwfx-flex-col { flex-direction: column; }
.vnwfx-flex-wrap { flex-wrap: wrap; }
.vnwfx-items-center { align-items: center; }
.vnwfx-justify-between { justify-content: space-between; }
.vnwfx-justify-center { justify-content: center; }
.vnwfx-gap-1 { gap: 4px; }
.vnwfx-gap-2 { gap: 8px; }
.vnwfx-gap-3 { gap: 12px; }

/* ----- Spacing ----- */
.vnwfx-p-2 { padding: 8px; }
.vnwfx-p-3 { padding: 12px; }
.vnwfx-p-4 { padding: 16px; }
.vnwfx-p-5 { padding: 20px; }
.vnwfx-px-3 { padding-left: 12px; padding-right: 12px; }
.vnwfx-px-4 { padding-left: 16px; padding-right: 16px; }
.vnwfx-py-2 { padding-top: 8px; padding-bottom: 8px; }
.vnwfx-mt-2 { margin-top: 8px; }
.vnwfx-mt-3 { margin-top: 12px; }
.vnwfx-mt-4 { margin-top: 16px; }
.vnwfx-mb-2 { margin-bottom: 8px; }
.vnwfx-mb-3 { margin-bottom: 12px; }
.vnwfx-mb-4 { margin-bottom: 16px; }
.vnwfx-m-0 { margin: 0; }

/* ----- Typography ----- */
.vnwfx-text-xs { font-size: 12px; }
.vnwfx-text-sm { font-size: 13px; }
.vnwfx-text-lg { font-size: 18px; }
.vnwfx-text-xl { font-size: 22px; }
.vnwfx-font-medium { font-weight: 500; }
.vnwfx-font-semibold { font-weight: 600; }
.vnwfx-font-bold { font-weight: 700; }
.vnwfx-text-primary { color: var(--vnwfx-primary); }
.vnwfx-text-muted { color: var(--vnwfx-ink-soft); }
.vnwfx-text-center { text-align: center; }
.vnwfx-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }

/* ----- Color / Surface ----- */
.vnwfx-bg-soft { background: var(--vnwfx-primary-soft); }

/* ----- Border / Radius ----- */
.vnwfx-rounded { border-radius: var(--vnwfx-radius-sm); }
.vnwfx-border { border: 1px solid var(--vnwfx-line); }
.vnwfx-border-t { border-top: 1px solid var(--vnwfx-line); }

/* ----- Icon ----- */
.vnwfx-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.vnwfx-icon-spinner { animation: vnwfx-spin 0.8s linear infinite; }
@keyframes vnwfx-spin { to { transform: rotate(360deg); } }

/* ----- Card (iOS) ----- */
.vnwfx-card {
	background: var(--vnwfx-card);
	border-radius: var(--vnwfx-radius);
	box-shadow: var(--vnwfx-shadow-sm);
}

/* ----- Button (iOS) ----- */
.vnwfx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: var(--vnwfx-radius-sm);
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.18s var(--vnwfx-ease);
	background: #fff;
	color: var(--vnwfx-ink);
	line-height: 1.2;
	text-decoration: none;
}
.vnwfx-btn:active { transform: scale(0.95); }
.vnwfx-btn-primary {
	background: var(--vnwfx-primary);
	color: #fff;
	box-shadow: 0 2px 8px var(--vnwfx-primary-ring);
}
.vnwfx-btn-primary:hover { background: var(--vnwfx-primary-dark); }
.vnwfx-btn-ghost { background: transparent; border-color: var(--vnwfx-line); }
.vnwfx-btn-ghost:hover { background: var(--vnwfx-bg); }
.vnwfx-btn-sm { padding: 6px 10px; font-size: 13px; }
.vnwfx-btn-icon { padding: 7px; border-radius: 50%; transition: background 0.18s var(--vnwfx-ease), transform 0.12s var(--vnwfx-ease), color 0.18s var(--vnwfx-ease); }
.vnwfx-btn-icon:hover { background: var(--vnwfx-bg); color: var(--vnwfx-primary-dark); }
.vnwfx-btn-icon:active { transform: scale(0.85); }

/* ----- Chip (active filter) ----- */
.vnwfx-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--vnwfx-primary-soft);
	color: var(--vnwfx-primary-dark);
	font-size: 13px;
	font-weight: 500;
}
.vnwfx-chip button {
	display: inline-flex;
	border: 0;
	background: none;
	cursor: pointer;
	color: inherit;
	padding: 0;
	margin: 0;
}

/* ----- iOS Toggle Switch ----- */
.vnwfx-switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 28px;
	flex-shrink: 0;
}
.vnwfx-switch input { opacity: 0; width: 0; height: 0; }
.vnwfx-switch-slider {
	position: absolute;
	inset: 0;
	background: #d1d1d6;
	border-radius: 999px;
	transition: background 0.25s var(--vnwfx-ease);
	cursor: pointer;
}
.vnwfx-switch-slider::before {
	content: "";
	position: absolute;
	height: 24px;
	width: 24px;
	left: 2px;
	top: 2px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.25s var(--vnwfx-ease);
}
.vnwfx-switch input:checked + .vnwfx-switch-slider { background: var(--vnwfx-primary); }
.vnwfx-switch input:checked + .vnwfx-switch-slider::before { transform: translateX(18px); }

/* ----- Checkbox (iOS) ----- */
.vnwfx-check {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 4px;
	cursor: pointer;
	border-radius: 8px;
	transition: background 0.15s var(--vnwfx-ease);
}
.vnwfx-check:hover { background: var(--vnwfx-bg); }
.vnwfx-check-box {
	width: 22px;
	height: 22px;
	border-radius: 7px;
	border: 2px solid var(--vnwfx-line);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
	transition: all 0.15s var(--vnwfx-ease);
}
.vnwfx-check input { position: absolute; opacity: 0; pointer-events: none; }
.vnwfx-check input:checked + .vnwfx-check-box {
	background: var(--vnwfx-primary);
	border-color: var(--vnwfx-primary);
}
.vnwfx-check input:focus-visible + .vnwfx-check-box { box-shadow: 0 0 0 3px var(--vnwfx-primary-ring); }
.vnwfx-check-box .vnwfx-icon { opacity: 0; transform: scale(0.6); transition: all 0.15s var(--vnwfx-ease); }
.vnwfx-check input:checked + .vnwfx-check-box .vnwfx-icon { opacity: 1; transform: scale(1); }
.vnwfx-check-label { flex: 1; font-size: 14px; }
.vnwfx-check-count { color: var(--vnwfx-ink-soft); font-size: 13px; }

/* ----- Range slider (giá) ----- */
/* @wfx:pro-start */
.vnwfx-range { position: relative; height: 36px; margin: 8px 0; }
.vnwfx-range-track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--vnwfx-line);
	border-radius: 999px;
	transform: translateY(-50%);
}
.vnwfx-range input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 36px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.vnwfx-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--vnwfx-primary);
	box-shadow: var(--vnwfx-shadow-sm);
	cursor: pointer;
	pointer-events: auto;
}
.vnwfx-range input[type="range"]::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--vnwfx-primary);
	box-shadow: var(--vnwfx-shadow-sm);
	cursor: pointer;
	pointer-events: auto;
}

.vnwfx-price-field {
	flex: 1;
	min-width: 0;
}

.vnwfx-price-field span {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--vnwfx-muted);
	margin-bottom: 4px;
}

.vnwfx-price-field input {
	width: 100%;
	border: 1px solid var(--vnwfx-line);
	border-radius: var(--vnwfx-radius-sm);
	padding: 8px 10px;
}

.vnwfx-price-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.vnwfx-price-preset {
	border: 1px solid var(--vnwfx-line);
	background: #fff;
	border-radius: var(--vnwfx-radius-sm);
	padding: 9px 14px;
	color: var(--vnwfx-ink);
	cursor: pointer;
	transition: border-color 0.15s var(--vnwfx-ease), box-shadow 0.15s var(--vnwfx-ease), color 0.15s var(--vnwfx-ease);
}

.vnwfx-price-preset:hover,
.vnwfx-price-preset.is-active {
	border-color: var(--vnwfx-primary);
	color: var(--vnwfx-primary);
	box-shadow: 0 0 0 3px var(--vnwfx-primary-ring);
}

/* ----- Color swatch ----- */
.vnwfx-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.vnwfx-swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--vnwfx-line);
	cursor: pointer;
	position: relative;
	transition: transform 0.15s var(--vnwfx-ease);
}
.vnwfx-swatch:hover { transform: scale(1.1); }
.vnwfx-swatch.is-active { box-shadow: 0 0 0 2px var(--vnwfx-primary); }
.vnwfx-swatch.is-active::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	mix-blend-mode: difference;
}

/* ----- Star rating ----- */
.vnwfx-stars { display: inline-flex; gap: 2px; color: #f5a623; }
.vnwfx-stars .vnwfx-icon { fill: currentColor; stroke: none; }
.vnwfx-stars-empty { color: var(--vnwfx-line); }
/* @wfx:pro-end */

/* ----- Accordion ----- */
.vnwfx-acc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 12px 4px;
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	color: var(--vnwfx-ink);
}
.vnwfx-acc-head .vnwfx-icon-chevron { transition: transform 0.25s var(--vnwfx-ease); }
.vnwfx-acc-head[aria-expanded="false"] .vnwfx-icon-chevron { transform: rotate(-90deg); }
.vnwfx-acc-body { overflow: hidden; }

/* ----- Skeleton loading ----- */
.vnwfx-skeleton {
	background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
	background-size: 200% 100%;
	animation: vnwfx-shimmer 1.4s infinite;
	border-radius: 8px;
}
@keyframes vnwfx-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ----- Empty state ----- */
.vnwfx-empty {
	text-align: center;
	padding: 48px 20px;
	color: var(--vnwfx-ink-soft);
}
.vnwfx-empty .vnwfx-icon { opacity: 0.4; margin-bottom: 12px; }

/* ----- Scrollbar gọn ----- */
.vnwfx-scroll { max-height: 260px; overflow-y: auto; }
.vnwfx-scroll::-webkit-scrollbar { width: 6px; }
.vnwfx-scroll::-webkit-scrollbar-thumb { background: var(--vnwfx-line); border-radius: 999px; }

/* ----- Fade transition (Vue) ----- */
.vnwfx-fade-enter-active, .vnwfx-fade-leave-active { transition: opacity 0.2s var(--vnwfx-ease); }
.vnwfx-fade-enter-from, .vnwfx-fade-leave-to { opacity: 0; }
