/* Compatara — search inside long finder lists (compatara-combo.js). */
.cpta-combo {
	position: relative;
	width: 100%;
	min-width: 0;
}

.cpta-combo > select.cpta-combo__native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* The button wears the select's own classes, so the finder's design
   applies; these are only the fallbacks for a list with no classes. */
:where(.cpta-combo__btn) {
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.cpta-combo .cpta-combo__btn {
	display: flex;
	align-items: center;
	gap: 8px;
	text-align: start;
	cursor: pointer;
	line-height: 1.3;
	padding-inline-end: 36px;
	background-image: none;
	position: relative;
	box-sizing: border-box;
	text-transform: none;
	letter-spacing: normal;
}

.cpta-combo .cpta-combo__btn::after {
	content: "";
	position: absolute;
	inset-inline-end: 14px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-inline-end: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	opacity: .55;
}

.cpta-combo .cpta-combo__btn:disabled {
	cursor: not-allowed;
}

.cpta-combo .cpta-combo__btn.is-placeholder .cpta-combo__value {
	opacity: .7;
}

.cpta-combo__value {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpta-combo__img,
.cpta-combo__list img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	flex: 0 0 auto;
	border-radius: 4px;
}

.cpta-combo__pop {
	position: absolute;
	z-index: 100000;
	inset-inline-start: 0;
	top: calc(100% + 4px);
	width: 100%;
	min-width: 220px;
	box-sizing: border-box;
	padding: 8px;
	background: #fff;
	color: #111827;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
	text-align: start;
}

.cpta-combo__pop[hidden] {
	display: none;
}

.cpta-combo .cpta-combo__search {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 40px;
	margin: 0 0 6px;
	padding: 0 12px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #f9fafb;
	color: #111827;
	font: inherit;
	font-size: 15px;
}

.cpta-combo .cpta-combo__search:focus {
	outline: 2px solid var(--cpta-c-accent, #111827);
	outline-offset: 1px;
	background: #fff;
}

.cpta-combo .cpta-combo__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 280px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cpta-combo .cpta-combo__list li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 9px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.3;
}

.cpta-combo .cpta-combo__list li[hidden] {
	display: none;
}

.cpta-combo .cpta-combo__list li.is-active,
.cpta-combo .cpta-combo__list li:hover {
	background: #f2f4f7;
}

.cpta-combo .cpta-combo__list li[aria-selected="true"] {
	font-weight: 700;
}

.cpta-combo .cpta-combo__list li[aria-selected="true"]::after {
	content: "✓";
	margin-inline-start: auto;
	color: var(--cpta-c-accent, #111827);
}

.cpta-combo__empty {
	margin: 6px 4px;
	font-size: 14px;
	color: #6b7280;
}

/* Dark finder design. */
.cpta-skin--dark .cpta-combo__pop {
	background: #111827;
	color: #f9fafb;
	border-color: #374151;
}

.cpta-skin--dark .cpta-combo .cpta-combo__search {
	background: #1f2937;
	color: #f9fafb;
	border-color: #374151;
}

.cpta-skin--dark .cpta-combo .cpta-combo__list li.is-active,
.cpta-skin--dark .cpta-combo .cpta-combo__list li:hover {
	background: #1f2937;
}

@media (prefers-reduced-motion: no-preference) {
	.cpta-combo__pop {
		animation: cpta-combo-in .12s ease-out;
	}
	@keyframes cpta-combo-in {
		from { opacity: 0; transform: translateY(-4px); }
		to { opacity: 1; transform: none; }
	}
}

.cpta-combo-lift {
	position: relative;
	z-index: 99999 !important;
}

/* The garage panel styles every button in its form as the blue "Add". */
.cpta-vehicle-form .cpta-combo .cpta-combo__btn {
	margin-top: 8px;
	min-height: 38px;
	padding: 8px;
	padding-inline-end: 32px;
	background: #fff;
	color: #212529;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 14px;
}
.cpta-vehicle-form .cpta-combo .cpta-combo__btn:disabled {
	background: #e9ecef;
	color: #6c757d;
}
.cpta-vehicle-form .cpta-combo span {
	display: inline;
	margin-top: 0;
}
