/**
 * IO Widget – Form Product Select 1.3.10
 * Match Elementor form field styles; no theme button colors.
 */

.io-ps {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	direction: rtl;
	/* do not inherit button / accent colors */
	background: transparent;
	background-color: transparent;
}

.io-ps *,
.io-ps *::before,
.io-ps *::after {
	box-sizing: border-box;
}

.io-ps__value {
	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;
	border: 0 !important;
	background: transparent !important;
}

.io-ps__control {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	background: transparent;
}

/* Search = same look as Elementor form fields (text/select) */
.io-ps__search.elementor-field,
.io-ps .io-ps__search {
	width: 100%;
	margin: 0;
	padding-inline-end: 2.2em;
	/* Reset any theme button/link styles */
	appearance: none;
	-webkit-appearance: none;
	background-image: none !important;
	box-shadow: none;
	cursor: text;
	text-align: inherit;
}

.io-ps__chevron {
	position: absolute;
	inset-inline-end: 12px;
	width: 0.45em;
	height: 0.45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.45;
	pointer-events: none;
	transition: transform 0.15s ease;
	background: transparent !important;
}

.io-ps.is-open .io-ps__chevron {
	transform: rotate(-135deg);
	margin-top: 4px;
}

.io-ps__list {
	position: absolute;
	z-index: 30;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	max-height: 240px;
	overflow-x: hidden;
	overflow-y: auto;
	background: #fff !important;
	background-color: #fff !important;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	-webkit-overflow-scrolling: touch;
}

.io-ps__list[hidden] {
	display: none !important;
}

/* Option buttons: never use theme primary / Elementor button bg */
.io-ps__list .io-ps__option,
.io-ps button.io-ps__option {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	padding: 10px 14px;
	margin: 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-align: right;
	cursor: pointer;
	color: #111827 !important;
	line-height: 1.35;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.io-ps__list .io-ps__option:hover,
.io-ps__list .io-ps__option:focus,
.io-ps__list .io-ps__option.is-active,
.io-ps button.io-ps__option:hover,
.io-ps button.io-ps__option:focus {
	background: #f3f4f6 !important;
	background-color: #f3f4f6 !important;
	color: #111827 !important;
	outline: none;
	box-shadow: none !important;
}

.io-ps__list .io-ps__option.is-selected,
.io-ps button.io-ps__option.is-selected {
	background: #f3f4f6 !important;
	background-color: #f3f4f6 !important;
	color: #111827 !important;
}

.io-ps__option-sku {
	display: block;
	font-size: 0.8em;
	color: #9ca3af;
	margin-top: 2px;
}

.io-ps__empty,
.io-ps__loading {
	padding: 12px 14px;
	color: #9ca3af;
	margin: 0;
	list-style: none;
	background: transparent !important;
}

.io-ps__selected {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: transparent;
}

.io-ps__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	padding: 6px 8px 6px 10px;
	background: #f3f4f6 !important;
	background-color: #f3f4f6 !important;
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.3;
	color: #111827;
	border: none;
	box-shadow: none;
}

.io-ps__chip-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 220px;
}

.io-ps__chip-remove,
.io-ps button.io-ps__chip-remove {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(0, 0, 0, 0.08) !important;
	background-color: rgba(0, 0, 0, 0.08) !important;
	background-image: none !important;
	color: #374151 !important;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	flex: 0 0 auto;
	box-shadow: none !important;
	text-transform: none;
}

.io-ps__chip-remove:hover,
.io-ps__chip-remove:focus,
.io-ps button.io-ps__chip-remove:hover {
	background: #fee2e2 !important;
	background-color: #fee2e2 !important;
	color: #b91c1c !important;
	outline: none;
	box-shadow: none !important;
}

body.io-widget-ltr .io-ps,
html[dir="ltr"] .io-ps {
	direction: ltr;
}

body.io-widget-ltr .io-ps__option,
html[dir="ltr"] .io-ps__option {
	text-align: left;
}

@media (max-width: 767px) {
	.io-ps__list {
		max-height: 200px;
	}
	.io-ps__chip-label {
		max-width: 160px;
	}
}
