/**
 * Searchable currency combobox (progressive enhancement over the native
 * <select> — see assets/js/currency-select.js). Uses the same fixed
 * --tp-input-* tokens as every other form control so it reads
 * identically regardless of the surrounding page's light/dark theme.
 */

.tp-currency-select {
	position: relative;
}

.tp-currency-select__input {
	width: 100%;
	cursor: text;
}

.tp-currency-select__listbox {
	position: absolute;
	top: 100%;
	inset-inline-start: 0;
	inset-inline-end: 0;
	margin: 0.25rem 0 0;
	padding: 0.25rem;
	list-style: none;
	max-height: 280px;
	overflow-y: auto;
	background: var(--tp-input-bg);
	color: var(--tp-input-text);
	border: 1px solid var(--tp-input-border);
	border-radius: var(--tp-radius-sm);
	box-shadow: var(--tp-shadow-elevated);
	z-index: 50;
}

.tp-currency-select__listbox[hidden] {
	display: none;
}

.tp-currency-select__listbox li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.7rem;
	border-radius: 6px;
	font-size: 0.95rem;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tp-currency-select__listbox li.is-active {
	background: var(--tp-input-hover-bg);
}

.tp-currency-select__listbox li.is-selected {
	font-weight: 700;
}

.tp-currency-select__listbox li.is-selected::after {
	content: "✓";
	color: var(--tp-input-border-focus);
	flex-shrink: 0;
}

/* Mobile: keep the listbox from ever forcing the page to scroll
   horizontally, and keep text large enough that iOS Safari doesn't
   zoom the page in when the field is focused. */
@media (max-width: 480px) {
	.tp-currency-select__input {
		font-size: 16px;
	}
	.tp-currency-select__listbox {
		max-height: 45vh;
	}
}
