/* Vehicle Search Widget — base styles */

/* Whole form (fields, select2, button, dropdown) uses Carlito. */
.vs-vehicle-search,
.vs-vehicle-search select,
.vs-vehicle-search input,
.vs-vehicle-search .select2-container,
.vs-vehicle-search .select2-selection__rendered,
.vs-vehicle-search .vs-search-btn,
.select2-container.vs-global-dropdown,
.select2-container.vs-global-dropdown .select2-results__option,
.select2-container.vs-global-dropdown .select2-search__field {
	font-family: 'Carlito', Arial, sans-serif !important;
}

.vs-vehicle-search {
	width: 100%;
}

.vs-form-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #ffffff;
	padding: 14px;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

/* Fields grow/shrink to always fill one line, even if a field is hidden */
.vs-field {
	flex: 1 1 0;
	min-width: 140px;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------
   Fields Layout — Inline vs Stacked, set independently per device
   from Elementor: Style tab → Layout → "Fields Layout" (the little
   desktop/tablet/mobile icons at the top of that control).
   ------------------------------------------------------------------ */

/* Desktop (default, no media query — also the fallback for older markup) */
.vs-form-wrap.vs-layout-desktop-inline {
	flex-direction: row;
	flex-wrap: nowrap;
	overflow-x: auto;
}
.vs-form-wrap.vs-layout-desktop-stacked {
	flex-direction: column;
	flex-wrap: wrap;
	align-items: stretch;
	overflow-x: visible;
}
.vs-form-wrap.vs-layout-desktop-stacked .vs-field,
.vs-form-wrap.vs-layout-desktop-stacked .vs-search-btn {
	flex: 1 1 100% !important;
	width: 100%;
	min-width: 0;
}
.vs-form-wrap.vs-layout-desktop-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	overflow-x: visible;
}
.vs-form-wrap.vs-layout-desktop-grid .vs-field {
	width: 100%;
	min-width: 0;
}
.vs-form-wrap.vs-layout-desktop-grid .vs-search-btn {
	grid-column: 1 / -1;
	width: 100%;
}

/* Tablet: 768px – 1024px */
@media (max-width: 1024px) {
	.vs-form-wrap.vs-layout-tablet-inline {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		overflow-x: auto;
	}
	.vs-form-wrap.vs-layout-tablet-inline .vs-field,
	.vs-form-wrap.vs-layout-tablet-inline .vs-search-btn {
		width: auto;
		min-width: 140px;
	}
	.vs-form-wrap.vs-layout-tablet-stacked {
		flex-direction: column !important;
		flex-wrap: wrap !important;
		align-items: stretch !important;
		overflow-x: visible;
	}
	.vs-form-wrap.vs-layout-tablet-stacked .vs-field,
	.vs-form-wrap.vs-layout-tablet-stacked .vs-search-btn {
		flex: 1 1 100% !important;
		width: 100%;
		min-width: 0;
	}
	.vs-form-wrap.vs-layout-tablet-grid {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		flex-direction: unset !important;
		flex-wrap: unset !important;
		align-items: stretch !important;
		overflow-x: visible;
	}
	.vs-form-wrap.vs-layout-tablet-grid .vs-field {
		width: 100%;
		min-width: 0;
	}
	.vs-form-wrap.vs-layout-tablet-grid .vs-search-btn {
		grid-column: 1 / -1;
		width: 100%;
	}
}

/* Mobile: up to 767px */
@media (max-width: 767px) {
	.vs-form-wrap.vs-layout-mobile-inline {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		overflow-x: auto;
	}
	.vs-form-wrap.vs-layout-mobile-inline .vs-field,
	.vs-form-wrap.vs-layout-mobile-inline .vs-search-btn {
		width: auto;
		min-width: 140px;
	}
	.vs-form-wrap.vs-layout-mobile-stacked {
		flex-direction: column !important;
		flex-wrap: wrap !important;
		align-items: stretch !important;
		overflow-x: visible;
	}
	.vs-form-wrap.vs-layout-mobile-stacked .vs-field,
	.vs-form-wrap.vs-layout-mobile-stacked .vs-search-btn {
		flex: 1 1 100% !important;
		width: 100%;
		min-width: 0;
	}

	/* Grid: 2 fields per row (e.g. Year + Make on row 1, Model + Part on
	   row 2), search button on its own full-width row underneath — this
	   is the compact mobile layout shown in the reference screenshot. */
	.vs-form-wrap.vs-layout-mobile-grid {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		flex-direction: unset !important;
		flex-wrap: unset !important;
		align-items: stretch !important;
		overflow-x: visible;
	}
	.vs-form-wrap.vs-layout-mobile-grid .vs-field {
		flex: unset !important;
		width: 100%;
		min-width: 0;
	}
	.vs-form-wrap.vs-layout-mobile-grid .vs-search-btn {
		grid-column: 1 / -1;
		width: 100%;
	}
}

/* Native select styling */
.vs-field select.vs-select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-color: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 13px 44px 13px 16px;
	font-size: 15px;
	line-height: 1.3;
	color: #333333;
	cursor: pointer;
	box-sizing: border-box;
}

.vs-field select.vs-select:focus {
	outline: none;
	border-color: #c9c9c9;
}

.vs-field select.vs-select:disabled {
	background-color: #eeeeee;
	color: #8a8a8a;
	cursor: not-allowed;
}

/* Hide the placeholder ("Choose Year", "Select Your Issue", etc.) from the
   opened list of native (non type-to-search) dropdowns. It stays visible
   only as the closed-field placeholder text, not as a selectable list item. */
.vs-field select.vs-select option[value=""] {
	display: none;
}

/* Select2 styling to match the native select look */
.vs-field .select2-container {
	width: 100% !important;
}

.vs-field .select2-container--default .select2-selection--single {
	height: auto;
	display: flex;
	align-items: center;
	background-color: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 13px 44px 13px 16px;
	box-sizing: border-box;
}

.vs-field .select2-container--default .select2-selection--single .select2-selection__rendered {
	padding: 0;
	line-height: 1.3;
	font-size: 15px;
	color: #333333;
}

.vs-field .select2-container--default .select2-selection--single .select2-selection__placeholder {
	color: #333333;
}

.vs-field .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 100%;
	top: 0;
	right: 12px;
	width: 20px;
}

/* Custom field icon selected from Elementor */
.vs-field { position: relative; }
.vs-field .vs-field-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	pointer-events: none;
	font-size: 16px;
}
.vs-field .vs-field-icon svg { width: 1em; height: 1em; }
.vs-field .select2-container--default .select2-selection--single .select2-selection__arrow { display: none; }

.vs-field .select2-container--disabled .select2-selection--single {
	background-color: #eeeeee;
	color: #8a8a8a;
	cursor: not-allowed;
}

.vs-field .select2-container--disabled .select2-selection__rendered {
	color: #8a8a8a !important;
}

/* Search button */
.vs-search-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
	background-color: #e01f27;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 15px 26px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.vs-search-btn:hover {
	background-color: #b8181e;
}

.vs-search-btn .vs-btn-arrow {
	font-style: normal;
	display: inline-block;
	line-height: 1;
}

.vs-search-btn .vs-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.vs-search-btn .vs-btn-icon svg { width: 1em; height: 1em; }


/* Final icon fix: show exactly one field icon inside each field.
   Hide every Select2/native arrow so it cannot create a second icon. */
.vs-field .vs-field-icon {
	position: absolute !important;
	right: 16px !important;
	left: auto !important;
	top: 50% !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
	transition: transform 0.2s ease !important;
	z-index: 20 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	pointer-events: none !important;
}

/* Flip the chosen icon (whatever is picked in "Dropdown Icon" control)
   upside-down while the dropdown is open, instead of a hardcoded arrow. */
.vs-field.vs-field-open .vs-field-icon {
	transform: translateY(-50%) rotate(180deg) !important;
}

.vs-field .vs-field-icon svg {
	display: block !important;
	width: 1em !important;
	height: 1em !important;
}

.vs-field select.vs-select {
	background-image: none !important;
	padding-right: 44px !important;
}

.vs-field .select2-selection__arrow,
.vs-field .select2-selection__arrow b,
.vs-field .select2-container--default .select2-selection--single .select2-selection__arrow {
	display: none !important;
	visibility: hidden !important;
}

.vs-field .select2-selection--single {
	position: relative !important;
}

.vs-field .select2-selection__rendered {
	padding-right: 28px !important;
}

/* Button padding is controlled from Elementor's Button Padding control. */
.vs-search-btn {
	box-sizing: border-box !important;
}


/* Selected/highlighted dropdown option color
   (values come from the Elementor "Dropdown Style" color controls,
   forwarded here as CSS variables by vs-widget.js) */
.vs-field .select2-results__option--highlighted,
.vs-field .select2-results__option[aria-selected="true"],
.vs-field .vs-dropdown-option.is-selected,
.vs-field .vs-option.is-active {
	background-color: var(--vs-dd-highlight-bg, #EC1313) !important;
	color: var(--vs-dd-highlight-text, #FFFFFF) !important;
}

/* Dropdown always above surrounding content */
.vs-field .select2-container,
.vs-field .select2-dropdown,
.vs-field .vs-dropdown-menu {
	z-index: 100 !important;
}


/* =========================================================
   FINAL DROPDOWN FIX
   ========================================================= */

/* Select2 menu is appended to <body>, so it can sit above Elementor sections. */
.select2-container.vs-global-dropdown {
	z-index: 999999 !important;
}

.select2-container.vs-global-dropdown .select2-dropdown {
	z-index: 999999 !important;
	background: #ffffff !important;
	/* Border color matches the field's own border (forwarded live from the
	   field via vs-widget.js, since this dropdown sits on <body> and can't
	   inherit it through the normal CSS cascade). */
	border: 1px solid var(--vs-dd-border-color, #e2e2e2) !important;
}

.select2-container.vs-global-dropdown .select2-results__option {
	color: #333333;
	background: #ffffff;
}

/* Selected / keyboard-highlighted option
   (--vs-dd-highlight-bg / --vs-dd-highlight-text are set live by vs-widget.js
   from the Elementor "Dropdown Style" → color controls, per widget instance) */
.select2-container.vs-global-dropdown .select2-results__option--highlighted,
.select2-container.vs-global-dropdown .select2-results__option[aria-selected="true"] {
	background-color: var(--vs-dd-highlight-bg, #EC1313) !important;
	color: var(--vs-dd-highlight-text, #FFFFFF) !important;
}

/* Do not show the empty placeholder option in the results list. */
.select2-container.vs-global-dropdown .select2-results__option[data-select2-id$="-"] {
	display: none !important;
}

/* Search input inside the dropdown */
.select2-container.vs-global-dropdown .select2-search--dropdown {
	padding: 8px !important;
	background: #ffffff !important;
}

.select2-container.vs-global-dropdown .select2-search--dropdown .select2-search__field {
	box-sizing: border-box;
	width: 100%;
	border: 1px solid var(--vs-dd-border-color, #e2e2e2) !important;
	border-radius: 6px;
}

/* Make the results area safely scrollable without exposing content behind it. */
.select2-container.vs-global-dropdown .select2-results__options {
	max-height: 300px;
	overflow-y: auto;
}

/* Prevent the dropdown from visually inheriting section text/headings. */
.select2-container.vs-global-dropdown .select2-results,
.select2-container.vs-global-dropdown .select2-results__options,
.select2-container.vs-global-dropdown .select2-results__option {
	position: relative;
	z-index: 999999;
}


/* Never display Select2's empty/placeholder result item. */
.select2-container.vs-global-dropdown .select2-results__option[aria-label="Choose Year"],
.select2-container.vs-global-dropdown .select2-results__option[aria-label="Select Your Issue"] {
	display: none !important;
}


/* Final safety: placeholder/empty Select2 result must never be visible. */
.select2-container.vs-global-dropdown .select2-results__option[data-select2-id="select2-data-"] {
	display: none !important;
}
