/**
 * Nafi Vehicle Filter — frontend widget (Elementor / shop).
 *
 * Accent colors resolve in order: WordPress theme.json presets → Elementor globals
 * → WooCommerce → fallbacks. Override on the widget: .nafi-vf { --nafi-vf-accent: ... }
 */

.nafi-vf {
	/* Primary / brand surface (header, CTA) */
	--nafi-vf-accent: var(
		--wp--preset--color--primary,
		var(--e-global-color-primary, var(--wc-primary, #4b6139))
	);
	/* Text/icons on accent surfaces (light text on primary header/button) */
	--nafi-vf-on-accent: var(--wp--preset--color--base, #ffffff);
	max-width: 100%;
	background: #f6f6f6;
	border: 1px solid #ddd;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.nafi-vf__header {
	background: var(--nafi-vf-accent);
	color: var(--nafi-vf-on-accent);
	padding: 16px;
}

.nafi-vf__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.1;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: inherit;
}

.nafi-vf__subtitle {
	margin: 0;
	color: color-mix(in srgb, var(--nafi-vf-on-accent) 78%, transparent);
	font-size: 16px;
	line-height:24px;
}

.nafi-vf__body {
	padding: 16px 16px;
}

.nafi-vf__section {
	margin-bottom: 22px;
}

.nafi-vf__label {
	display: block;
	margin: 0 0 12px;
	color: #5f5f5f;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.nafi-vf__fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}
.nafi-vf__field{
	position: relative;
}
.nafi-vf__field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #5e5e5e;
}

.nafi-vf__field select {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid #cdcdcd;
	border-radius: 9px;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nafi-vf__field select:focus {
	outline: none;
	border-color: #7c8f69;
	box-shadow: 0 0 0 3px rgba(124, 143, 105, 0.16);
}

.nafi-vf__field select:disabled {
	background: #f2f2f2;
	color: #888;
	cursor: not-allowed;
}

.nafi-vf__product-cat-wrap .select2-container {
	width: 100% !important;
	margin-bottom: 4px;
}

.nafi-vf__product-cat-wrap .select2-container--default .select2-selection--multiple {
	min-height: 44px;
	border: 1px solid #cdcdcd;
	border-radius: 9px;
	padding: 4px 6px;
	position: relative;
}

.nafi-vf__product-cat-wrap .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #7c8f69;
	box-shadow: 0 0 0 3px rgba(124, 143, 105, 0.16);
}

.nafi-vf__product-cat-wrap .select2-selection--multiple::before {
	content: attr(data-placeholder-label);
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #777;
	pointer-events: none;
}

.nafi-vf__product-cat-wrap .select2-selection--multiple .select2-selection__choice {
	display: none;
}

.nafi-vf__product-cat-wrap .select2-selection--multiple .select2-search--inline {
	display: none;
}

.nafi-vf__product-cat-wrap .select2-selection--multiple.nafi-vf-pc-open::before {
	display: none;
}

.nafi-vf__product-cat-wrap .select2-selection--multiple.nafi-vf-pc-open .select2-search--inline {
	display: inline-block;
}

.nafi-vf__product-cat-wrap .select2-search--inline .select2-search__field {
	min-width: 180px !important;
}

.nafi-vf__product-cat-wrap .select2-results__option {
	white-space: normal;
	word-break: break-word;
}

.nafi-vf__field small {
	display: block;
	font-size: 12px;
	line-height: 1.35;
	color: #747474;
	min-height: 16px;
	position: absolute;
	top: 85%;
	z-index: 999;
	background: #F6F6F6;
	padding: 2px;
	border-radius: 5px;
}

.nafi-vf__product-cat-wrap .nafi-vf__product-cat-desc {
	position: static;
	z-index: auto;
	background: transparent;
	padding: 0;
	border-radius: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	min-height: 20px;
}

.nafi-vf__product-cat-selected-label {
	font-weight: 700;
	color: #5f5f5f;
}

.nafi-vf__product-cat-chip {
	display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 5px;
    border: 1px solid #d7dccf;
    border-radius: 999px;
    background: #fff;
    color: #4a4a4a;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.3;
	font-weight: 400;
}

.nafi-vf__product-cat-chip:hover {
	border-color: #b9c2af;
	background: #f9faf7;
}

.nafi-vf__product-cat-chip-remove {
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
}

.nafi-vf__actions {
	margin-top: 18px;
}

.nafi-vf__btn {
	display: block;
	width: 100%;
	padding: 16px;
	border: 0;
	border-radius: 9px;
	background: var(--nafi-vf-accent);
	color: var(--nafi-vf-on-accent);
	font-weight: 700;
	font-size: 30px;
	text-transform: uppercase;
	cursor: pointer;
	transition: filter 0.2s ease, transform 0.2s ease;
	margin-top: 0;
}

.nafi-vf__btn:hover {
	filter: brightness(0.92);
	transform: translateY(-1px);
}

.nafi-vf__extra {
	display: block;
}

.nafi-vf__extra .nafi-vf__field {
	max-width: calc(50% - 6px);
}

.nafi-vf.is-loading .nafi-vf__fields {
	opacity: 0.72;
}

.nafi-vf.is-loading .nafi-vf__product-cat-wrap,
.nafi-vf.is-loading .nafi-vf__product-cat-wrap .select2-container {
	opacity: 1 !important;
}

.select2-dropdown.nafi-vf-pc-dd {
	z-index: 9999 !important;
}

@media (max-width: 1024px) {
	.nafi-vf__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 992px) {
	.nafi-vf__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));

	}
}
@media (max-width: 767px) {
	.nafi-vf__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));

	}

	.nafi-vf__extra .nafi-vf__field {
		max-width: 100%;
	}

	.nafi-vf__title {
		font-size: 26px;
	}

	.nafi-vf__subtitle {
		font-size: 16px;
	}

	.nafi-vf__btn {
		font-size: 22px;
	}

}
@media (max-width: 580px) {
	.nafi-vf__fields {
		grid-template-columns: repeat(1, minmax(0, 1fr));

	}
}

