/* Car Parts Finder Styles */
.car-parts-popup {
	width: 100%;
	height: 100%;
}

.car-parts-popup .label-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
}

.car-parts-popup label {
	display: block;
	font-size: 14px;
}

.car-parts-popup select {
	width: 100%;
	padding: 8px;
	margin-top: 5px;
}

#car-parts-submit {
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 40px;
	line-height: normal;
	font-size: 16px;
	width: 100%;
	margin-top: 16px;
	background-color: #000;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	transition: all 0.3s ease;
}

#car-parts-submit:hover {
	background-color: var(--e-global-color-primary);
}

#car-parts-submit {
	opacity: 0.5;
	cursor: not-allowed;
	background-color: #000;
}

.clear-filter {
	color: #dc3545 !important;
	text-decoration: underline;
	font-size: 12px;
	transition: color 0.3s ease;
}

.clear-filter:hover {
	color: #c82333;
	text-decoration: underline;
}

.car-parts-finder-form {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 2rem;
}

.car-parts-finder-form select {
	flex: 1;
	min-width: 200px;
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1rem;
}

.car-parts-finder-form select:disabled {
	background-color: #f5f5f5;
	cursor: wait;
}

/* Loading animation styles */
.car-parts-finder-form select.loading {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='2' x2='12' y2='6'%3E%3C/line%3E%3Cline x1='12' y1='18' x2='12' y2='22'%3E%3C/line%3E%3Cline x1='4.93' y1='4.93' x2='7.76' y2='7.76'%3E%3C/line%3E%3Cline x1='16.24' y1='16.24' x2='19.07' y2='19.07'%3E%3C/line%3E%3Cline x1='2' y1='12' x2='6' y2='12'%3E%3C/line%3E%3Cline x1='18' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cline x1='4.93' y1='19.07' x2='7.76' y2='16.24'%3E%3C/line%3E%3Cline x1='16.24' y1='7.76' x2='19.07' y2='4.93'%3E%3C/line%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 16px;
	padding-right: 32px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		background-position: right 8px center;
	}
	to {
		background-position: right 8px center;
		transform: rotate(360deg);
	}
}

/* Disable hover and focus states during loading */
.car-parts-finder-form select.loading:hover,
.car-parts-finder-form select.loading:focus {
	border-color: #ddd;
	outline: none;
	box-shadow: none;
}

/* Loading text style */
.car-parts-finder-form select.loading option {
	color: #666;
}

/* Disable pointer events during loading */
.car-parts-finder-form select.loading {
	pointer-events: none;
}

/* Multi-category filter — tree structure */
.karpart-widget-woocommerce ul.product-categories {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.karpart-widget-woocommerce ul.children {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 0 0 20px !important;
}

.karpart-widget-woocommerce li.cat-item {
	padding: 4px 0;
	margin: 0 !important;
}

.karpart-widget-woocommerce li.cat-item + li.cat-item {
	border-top: 1px solid #f0f0f0;
}

.karpart-widget-woocommerce ul.children li.cat-item:first-child {
	margin-top: 4px !important;
}

.cpf-cat-row {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cpf-cat-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-left: auto;
	flex-shrink: 0;
	cursor: pointer;
	user-select: none;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	color: #555;
	transition: color 0.2s ease;
}

.cpf-cat-toggle::before {
	content: "+";
}

li.cat-parent.cpf-opened > .cpf-cat-row > .cpf-cat-toggle::before {
	content: "\2212";
}

.cpf-cat-toggle:hover {
	color: #000;
}

.karpart-widget-woocommerce li.cat-parent > ul.children {
	display: none !important;
}

.karpart-widget-woocommerce li.cat-parent.cpf-opened > ul.children {
	display: block !important;
}

.cpf-cat-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 14px;
}

.cpf-cat-checkbox {
	width: 16px;
	height: 16px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--e-global-color-primary, #000);
}

.cpf-cat-row .count {
	font-size: 12px;
	color: #888;
	margin-left: 2px;
}

.cpf-cat-actions {
	display: flex;
	gap: 8px;
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #eee;
}

.cpf-cat-apply {
	flex: 1;
	padding: 8px 16px !important;
	background-color: #000 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 4px !important;
	cursor: pointer;
	font-size: 14px !important;
	text-align: center;
	transition: background-color 0.3s ease;
}

.cpf-cat-apply:hover {
	background-color: var(--e-global-color-primary, #333) !important;
}

.cpf-cat-reset {
	padding: 8px 16px !important;
	background-color: transparent !important;
	color: #dc3545 !important;
	border: 1px solid #dc3545 !important;
	border-radius: 4px !important;
	cursor: pointer;
	font-size: 14px !important;
	text-align: center;
	transition: all 0.3s ease;
}

.cpf-cat-reset:hover {
	background-color: #dc3545 !important;
	color: #fff !important;
}