/**
 * Hero Search Widget Styles
 *
 * @package Motors77_Car_Database
 */

/* Container */
.m77-hero-widget {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	padding: 24px;
	margin-bottom: 30px;
}

.m77-hero-container {
	max-width: 800px;
	margin: 0 auto;
}

/* Header Row */
.m77-hero-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.m77-hero-title {
	font-size: 22px;
	font-weight: 600;
	margin: 0;
	color: #222;
}

/* City Selector */
.m77-city-selector {
	position: relative;
}

.m77-city-trigger {
	display: flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px dashed #ccc;
	border-radius: 20px;
	padding: 8px 14px;
	cursor: pointer;
	font-size: 14px;
	color: #333;
	transition: all 0.2s ease;
}

.m77-city-trigger:hover {
	border-color: #0073aa;
	color: #0073aa;
}

.m77-city-trigger .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.m77-city-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	width: 320px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	margin-top: 8px;
}

.m77-city-dropdown-inner {
	padding: 16px;
}

.m77-city-search input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 16px;
}

.m77-city-search input:focus {
	outline: none;
	border-color: #0073aa;
}

.m77-city-section {
	margin-bottom: 16px;
}

.m77-city-section:last-child {
	margin-bottom: 0;
}

.m77-city-section h4 {
	font-size: 12px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	margin: 0 0 10px;
}

.m77-popular-cities {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.m77-popular-city-btn {
	background: #f5f5f5;
	border: none;
	border-radius: 16px;
	padding: 6px 14px;
	font-size: 13px;
	color: #333;
	cursor: pointer;
	transition: all 0.2s ease;
}

.m77-popular-city-btn:hover {
	background: #0073aa;
	color: #fff;
}

.m77-state-select,
.m77-city-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 10px;
	cursor: pointer;
}

/* Search Row – same height for input and button, icon aligned */
.m77-hero-search-row {
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	align-items: stretch;
}

.m77-search-wrapper {
	flex: 1;
	position: relative;
}

/* Search Input – same padding both sides (no icon inside) */
.m77-hero-search-input {
	width: 100%;
	height: 48px;
	min-height: 48px;
	padding: 0 16px !important;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.m77-hero-search-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.m77-hero-search-input::placeholder {
	color: #999;
}

/* Search Button – exact 48px height to match input */
.m77-hero-search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0 24px;
	height: 48px;
	min-height: 48px;
	max-height: 48px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-sizing: border-box;
	white-space: nowrap;
	transition: background 0.2s ease;
}

.m77-hero-search-btn:hover {
	background: #005a87;
}

.m77-hero-search-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.m77-search-wrapper .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Autocomplete Results */
.m77-autocomplete-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	margin-top: 4px;
	max-height: 300px;
	overflow-y: auto;
}

/* Autocomplete Section (grouped: BRANDS, MODELS, VARIANTS) */
.m77-autocomplete-section {
	padding: 8px 0;
}

.m77-autocomplete-section:not(:last-child) {
	border-bottom: 1px solid #eee;
}

.m77-autocomplete-section-title {
	font-size: 11px;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 8px 16px 4px;
}

.m77-autocomplete-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.m77-autocomplete-item:hover,
.m77-autocomplete-item.active {
	background: #f5f8fa;
}

.m77-autocomplete-item .dashicons {
	color: #666;
}

/* Icon block */
.m77-autocomplete-icon {
	width: 36px;
	height: 36px;
	background: #f0f0f0;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.m77-autocomplete-icon .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #666;
}

.m77-autocomplete-info {
	flex: 1;
	min-width: 0;
}

.m77-autocomplete-name {
	font-size: 14px;
	font-weight: 500;
	color: #222;
}

.m77-autocomplete-meta {
	font-size: 12px;
	color: #888;
	margin-top: 2px;
}

/* Badge (BRAND / MODEL / VARIANT) */
.m77-autocomplete-badge {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	padding: 4px 8px;
	border-radius: 4px;
	flex-shrink: 0;
}

.m77-badge-brand {
	background: #e3f2fd !important;
	color: #1976d2 !important;
}

.m77-badge-model {
	background: #e8f5e9 !important;
	color: #388e3c !important;
}

.m77-badge-variant {
	background: #fff3e0 !important;
	color: #f57c00 !important;
}

/* Legacy class support */
.m77-autocomplete-label {
	flex: 1;
	font-size: 14px;
	color: #333;
}

.m77-autocomplete-type {
	font-size: 11px;
	color: #999;
	text-transform: uppercase;
	background: #f0f0f0;
	padding: 2px 8px;
	border-radius: 4px;
}

.m77-autocomplete-empty {
	padding: 16px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* Trending section in hero search dropdown */
.m77-autocomplete-trending-title {
	font-size: 11px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	padding: 10px 16px 6px;
	border-bottom: 1px solid #eee;
	margin: 0;
}

.m77-autocomplete-results .m77-autocomplete-item:first-child {
	border-top: none;
}

/* Filter Pills Row */
.m77-hero-filters-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.m77-filter-pill {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 8px 16px;
	font-size: 13px;
	color: #333;
	cursor: pointer;
	transition: all 0.2s ease;
}

.m77-filter-pill:hover {
	border-color: #0073aa;
	color: #0073aa;
}

.m77-filter-pill .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.m77-filter-pill-all {
	border-style: dashed;
}

/* Filter Modal */
.m77-filter-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.m77-filter-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.m77-filter-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.m77-filter-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
}

.m77-filter-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.m77-filter-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #666;
	padding: 4px;
}

.m77-filter-modal-close:hover {
	color: #333;
}

.m77-filter-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}

.m77-filter-modal-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-top: 1px solid #eee;
}

.m77-btn-link {
	background: none;
	border: none;
	color: #0073aa;
	font-size: 14px;
	cursor: pointer;
}

.m77-btn-link:hover {
	text-decoration: underline;
}

.m77-btn-primary {
	background: #e53935;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.m77-btn-primary:hover {
	background: #c62828;
}

body.m77-modal-open {
	overflow: hidden;
}

.m77-coming-soon {
	text-align: center;
	color: #999;
	padding: 40px 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.m77-hero-widget {
		padding: 16px;
		border-radius: 8px;
	}

	.m77-hero-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.m77-hero-title {
		font-size: 18px;
	}

	.m77-city-dropdown {
		width: 280px;
		right: -50px;
	}

	.m77-hero-search-row {
		flex-direction: column;
	}

	.m77-hero-search-btn {
		width: 100%;
		justify-content: center;
	}

	.m77-hero-search-btn .btn-text {
		display: inline;
	}

	.m77-hero-filters-row {
		justify-content: flex-start;
	}

	.m77-filter-pill span:not(.dashicons) {
		display: none;
	}

	.m77-filter-pill-all span:not(.dashicons) {
		display: inline;
	}

	.m77-filter-modal-content {
		width: 95%;
		max-height: 90vh;
	}
}

/* Hide duplicate search below Hero Widget (Hero is the single search) */
.m77-hero-widget ~ .m77-search-box,
.m77-hero-widget ~ * .m77-search-box,
.m77-container > .m77-page-search,
.m77-page-wrapper > .m77-search-box,
.m77-page-wrapper > .m77-page-search,
.m77-page-wrapper > * .m77-search-box:not(.m77-hero-search-row) {
	display: none !important;
}

/* ═══════════════════════════════════════════════════════
   FILTER MODAL
   ═══════════════════════════════════════════════════════ */

.m77-filter-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.m77-filter-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.m77-filter-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 500px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.m77-filter-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.m77-filter-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #222;
}

.m77-filter-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #666;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background 0.2s;
}

.m77-filter-modal-close:hover {
	background: #f5f5f5;
	color: #333;
}

.m77-filter-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

.m77-filter-modal-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
	gap: 12px;
}

/* Filter Sections (Accordion) */
.m77-filter-section {
	border-bottom: 1px solid #eee;
}

.m77-filter-section:last-child {
	border-bottom: none;
}

.m77-filter-section-header {
	display: flex;
	align-items: center;
	padding: 16px 20px;
	cursor: pointer;
	transition: background 0.15s ease;
	user-select: none;
}

.m77-filter-section-header:hover {
	background: #f9f9f9;
}

.m77-filter-section-title {
	flex: 1;
	font-size: 15px;
	font-weight: 500;
	color: #333;
}

.m77-filter-section-value {
	font-size: 13px;
	color: #0073aa;
	margin-right: 8px;
	max-width: 150px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.m77-filter-section-arrow {
	color: #999;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.m77-filter-section.expanded .m77-filter-section-arrow {
	transform: rotate(180deg);
}

.m77-filter-section-content {
	padding: 0 20px 20px;
}

/* Budget Slider */
.m77-budget-slider-container {
	margin-bottom: 20px;
}

.m77-range-slider {
	position: relative;
	height: 6px;
	margin: 30px 0 20px;
}

.m77-range-track {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
}

.m77-range-fill {
	position: absolute;
	top: 0;
	height: 6px;
	background: #0073aa;
	border-radius: 3px;
}

.m77-range-slider input[type="range"] {
	position: absolute;
	top: -7px;
	width: 100%;
	height: 20px;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
	margin: 0;
}

.m77-range-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	background: #0073aa;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.m77-range-slider input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	background: #0073aa;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.m77-budget-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: #888;
}

.m77-budget-inputs {
	display: flex;
	align-items: center;
	gap: 12px;
}

.m77-budget-input-group {
	display: flex;
	flex: 1;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.m77-budget-currency {
	padding: 0 8px 0 12px;
	color: #666;
	font-size: 14px;
}

.m77-budget-input-group input[type="number"] {
	flex: 1;
	width: 50px;
	padding: 10px 4px;
	border: none;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
}

.m77-budget-input-group input[type="number"]::-webkit-outer-spin-button,
.m77-budget-input-group input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.m77-budget-input-group input:focus {
	outline: none;
}

.m77-budget-input-group select {
	padding: 10px 8px;
	border: none;
	border-left: 1px solid #ddd;
	background: #f9f9f9;
	font-size: 14px;
	cursor: pointer;
	color: #333;
}

.m77-budget-separator {
	color: #999;
	font-size: 14px;
}

/* Body Type Grid */
.m77-bodytype-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.m77-bodytype-item {
	cursor: pointer;
}

.m77-bodytype-item input {
	display: none;
}

.m77-bodytype-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 12px 8px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	transition: all 0.15s ease;
}

.m77-bodytype-item:hover .m77-bodytype-box {
	border-color: #0073aa;
}

.m77-bodytype-item input:checked + .m77-bodytype-box {
	border-color: #0073aa;
	background: #e3f2fd;
}

.m77-bodytype-icon {
	font-size: 24px;
	margin-bottom: 6px;
}

.m77-bodytype-label {
	font-size: 11px;
	color: #666;
	text-align: center;
}

.m77-bodytype-item input:checked + .m77-bodytype-box .m77-bodytype-label {
	color: #0073aa;
	font-weight: 500;
}

/* Checkbox Pills */
.m77-checkbox-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.m77-checkbox-pill {
	cursor: pointer;
}

.m77-checkbox-pill input {
	display: none;
}

.m77-checkbox-pill span {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid #ddd;
	border-radius: 20px;
	font-size: 13px;
	color: #333;
	transition: all 0.15s ease;
}

.m77-checkbox-pill:hover span {
	border-color: #0073aa;
}

.m77-checkbox-pill input:checked + span {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

/* Make/Brand List */
.m77-make-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	max-height: 200px;
	overflow-y: auto;
}

.m77-make-item {
	display: flex;
	align-items: center;
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.15s;
}

.m77-make-item:hover {
	background: #f5f5f5;
}

.m77-make-item input {
	margin-right: 10px;
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: #0073aa;
}

.m77-make-item span {
	font-size: 14px;
	color: #333;
}

/* Footer Buttons */
.m77-filter-clear {
	background: none;
	border: none;
	color: #0073aa;
	font-size: 14px;
	cursor: pointer;
	padding: 12px 20px;
	border-radius: 6px;
	transition: background 0.2s;
}

.m77-filter-clear:hover {
	background: #f0f0f0;
}

.m77-filter-apply {
	background: #e53935;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 12px 32px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.m77-filter-apply:hover {
	background: #c62828;
}

/* Body locked when modal open */
body.m77-modal-open {
	overflow: hidden;
}

/* Mobile Responsive - Filter Modal */
@media (max-width: 540px) {
	.m77-filter-modal {
		padding: 0;
		align-items: flex-end;
	}

	.m77-filter-modal-content {
		border-radius: 16px 16px 0 0;
		max-height: 90vh;
		max-width: 100%;
	}

	.m77-bodytype-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.m77-make-list {
		grid-template-columns: 1fr;
	}

	.m77-budget-inputs {
		flex-direction: column;
		gap: 8px;
	}

	.m77-budget-input-group {
		width: 100%;
	}

	.m77-budget-separator {
		display: none;
	}
}
