:host {
	display: block;
	height: calc(100vh - 200px);
}

.p-listbox {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--p-content-background, #ffffff);
	color: var(--p-content-color, #334155);
	border: 1px solid var(--p-content-border-color, #d9dee8);
	border-radius: var(--p-border-radius-md, 0.375rem);
	box-shadow: var(--p-listbox-shadow, none);
	outline: 0;
	transition:
		background 0.2s,
		color 0.2s,
		border-color 0.2s,
		box-shadow 0.2s;

	&.p-focus {
		border-color: var(--p-primary-color, #f97316);
		box-shadow: 0 0 0 1px color-mix(in srgb, var(--p-primary-color, #f97316) 20%, transparent);
	}

	&.p-disabled {
		opacity: 0.7;
		cursor: not-allowed;
	}
}

.p-listbox-list-container {
	flex: 1;
	overflow: auto;
}

.p-listbox-list {
	list-style: none;
	margin: 0;
	padding: 0.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.p-listbox-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.625rem 0.75rem;
	border-radius: calc(var(--p-border-radius-md, 0.375rem) - 1px);
	color: var(--p-content-color, #334155);
	cursor: pointer;
	user-select: none;
	outline: 0;
	transition:
		background 0.2s,
		color 0.2s;

	&:hover {
		background: var(--p-content-hover-background, #f8fafc);
		color: var(--p-content-hover-color, var(--p-content-color, #334155));
	}

	&.p-listbox-option-selected {
		background: var(--p-highlight-background, #fff7ed);
		color: var(--p-highlight-color, var(--p-primary-color, #ea580c));
		font-weight: 600;
	}

	&.am-single-select-listbox__option-locked {
		cursor: default;
	}

	&.am-single-select-listbox__option-locked:hover,
	&.am-single-select-listbox__option-locked:active {
		background: var(--p-highlight-background, #fff7ed);
		color: var(--p-highlight-color, var(--p-primary-color, #ea580c));
	}

	&.p-disabled {
		cursor: not-allowed;
	}
}

.p-listbox-empty-message {
	padding: 0.75rem;
	color: var(--p-text-muted-color, #64748b);
}

.am-single-select-listbox__label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.am-single-select-listbox__icon {
	font-size: 0.875rem;
	color: inherit;
}
