/**
 * WDR — searchable inventory multi-select.
 *
 * Colours come from the Elementor Kit globals (Rule 5); fallbacks keep it legible elsewhere.
 */

/* Hidden by default so the field never flashes visible before the script runs. JS adds .is-visible.
   ⚠ If JS fails the field stays hidden — the correct failure direction for an optional field. */
.elementor-field-group.wdr-fis-group {
	display: none;
}

.elementor-field-group.wdr-fis-group.is-visible {
	/* flex, not block — keeps Elementor's column-width classes behaving as on every other field */
	display: flex;
}

/* The native <select multiple> is hidden ONLY once JS has built the picker, so with JS disabled it
   remains fully usable. */
.wdr-fis-group.wdr-fis-enhanced select[multiple],
.wdr-fis-group.wdr-fis-enhanced .select-caret-down-wrapper {
	display: none;
}

/* 🚨 `.elementor-field-group` is display:flex/wrap — an appended child becomes a flex item and
   shrinks to its content unless it claims a full row. */
.wdr-invsel {
	flex: 0 0 100%;
	width: 100%;
	border: 1px solid var( --e-global-color-8913a83, #dcdad4 );
	background: #fff;
}

.wdr-invsel-search {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid var( --e-global-color-8913a83, #dcdad4 );
	border-radius: 0;
	background: #fff;
	font-size: 14px;
	line-height: 1.4;
	color: var( --e-global-color-text, #1c1b18 );
}

.wdr-invsel-search:focus {
	outline: none;
	border-bottom-color: var( --e-global-color-primary, #14130f );
}

.wdr-invsel-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
	/* momentum scrolling inside the box on iOS rather than dragging the page */
	-webkit-overflow-scrolling: touch;
}

.wdr-invsel-row {
	border-bottom: 1px solid var( --e-global-color-8913a83, #dcdad4 );
}

.wdr-invsel-row:last-child {
	border-bottom: 0;
}

.wdr-invsel-row[hidden] {
	display: none;
}

.wdr-invsel-row label {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 10px 14px;
	margin: 0;
	cursor: pointer;
	font-size: 13.5px;
	line-height: 1.45;
	color: var( --e-global-color-text, #1c1b18 );
	transition: background .15s;
}

.wdr-invsel-row label:hover {
	background: var( --e-global-color-735b932, #f4f3f0 );
}

.wdr-invsel-row.is-checked label {
	background: var( --e-global-color-735b932, #f4f3f0 );
	font-weight: 500;
}

/* 🚨 Qualified with `.wdr-invsel-row` — a bare element/class rule ties with the theme's own
   `[type="checkbox"]` reset (0,1,0), which loads later and would win. Same trap as the
   vehicle-carousel thumbs and the upload remove button (CLAUDE.md §7). */
.wdr-invsel-row input[type="checkbox"] {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin: 2px 0 0;
	padding: 0;
	accent-color: var( --e-global-color-primary, #14130f );
	cursor: pointer;
}

.wdr-invsel-empty {
	margin: 0;
	padding: 16px 14px;
	font-size: 13px;
	color: var( --e-global-color-00335af, #8a877f );
}

.wdr-invsel-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 14px;
	border-top: 1px solid var( --e-global-color-8913a83, #dcdad4 );
	background: var( --e-global-color-735b932, #f4f3f0 );
}

.wdr-invsel-count {
	font-size: 12.5px;
	letter-spacing: .3px;
	color: var( --e-global-color-9de5eee, #56544e );
}

.wdr-invsel-bar.has-selection .wdr-invsel-count {
	color: var( --e-global-color-text, #1c1b18 );
	font-weight: 500;
}

/* Same specificity note as the checkbox above. */
.wdr-invsel-bar .wdr-invsel-clear {
	width: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-size: 12.5px;
	letter-spacing: .3px;
	color: var( --e-global-color-9de5eee, #56544e );
	text-decoration: underline;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s, color .2s;
}

.wdr-invsel-bar.has-selection .wdr-invsel-clear {
	opacity: 1;
	pointer-events: auto;
}

.wdr-invsel-bar .wdr-invsel-clear:hover,
.wdr-invsel-bar .wdr-invsel-clear:focus-visible {
	color: var( --e-global-color-primary, #14130f );
}
