/**
 * Webcodexworld Car Buying & Selling
 * Quick Search (`[carbs_quick_search]`) styles - a dark tabbed hero widget
 * sitting on top of a white filter-form panel, redirecting into the
 * `[carbs_car_listing]` page on submit.
 *
 * @package Webcodexworld Car Buying & Selling
 * @since 1.3.1
 */

.carbs-qs-wrap {
	--carbs-qs-dark-soft: var(--tpc-navy-soft);
	--carbs-qs-accent-soft: #ffb27a;
	--carbs-qs-surface-soft: var(--tpc-surface-soft);
	--carbs-qs-radius: 16px;
	--carbs-qs-radius-sm: 10px;

	max-width: 1140px;
	margin: 24px auto;
	font-family: var(--tpc-font-body);
	color: var(--tpc-black);
}

.carbs-qs-wrap *,
.carbs-qs-wrap *::before,
.carbs-qs-wrap *::after {
	box-sizing: border-box;
}

.carbs-qs-heading {
	margin: 0 0 16px;
	font-family: var(--tpc-font-heading);
	font-size: 24px;
	font-weight: 700;
	color: var(--tpc-black);
	text-align: center;
}

/* ---------- Hero overlap ----------
 * Opt-in (the shortcode's `overlap` attribute, "yes" by default) - pulls
 * the widget up so it sits partly over the bottom of whatever full-width
 * hero/cover block comes immediately before it on the page, per the
 * reference design. `position: relative` + a z-index is required so the
 * widget paints above the cover block: a Gutenberg cover block is itself
 * `position: relative`, and per normal CSS stacking order a positioned
 * element paints above an earlier, non-positioned sibling regardless of
 * source order - without this the pulled-up widget would render behind
 * the hero image instead of on top of it.
 * The pull-up amount is reduced at narrower widths (see the breakpoints
 * below) so it never climbs high enough to cover the hero's own heading
 * or call-to-action buttons on shorter, stacked mobile layouts.
 */

.carbs-qs-wrap.carbs-qs-overlap {
	position: relative;
	z-index: 5;
	margin-top: -140px;
}

/* ---------- Outer dark card ---------- */

.carbs-qs-card {
	background: var(--tpc-dark);
	border-radius: var(--carbs-qs-radius);
	padding: 10px 10px 20px;
}

/* ---------- Tab row ---------- */

.carbs-qs-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 8px;
}

.carbs-qs-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.carbs-qs-tab:hover {
	color: var(--tpc-white);
	background: rgba(255, 255, 255, 0.06);
}

.carbs-qs-tab.is-active {
	background: var(--carbs-qs-dark-soft, #16223c);
	color: var(--tpc-white);
}

.carbs-qs-tab-icon {
	display: inline-flex;
	font-size: 14px;
	color: inherit;
}

.carbs-qs-tab-icon svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.carbs-qs-tab-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tpc-red);
	margin-left: 2px;
}

.carbs-qs-tab-advanced {
	margin-left: auto;
}

/* ---------- White panel ---------- */

.carbs-qs-panel {
	background: var(--tpc-white);
	border-radius: var(--carbs-qs-radius);
	padding: 20px;
}

.carbs-qs-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.carbs-qs-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.carbs-qs-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--tpc-gray);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.carbs-qs-field select {
	width: 100%;
	padding: 11px 34px 11px 12px;
	border: 1px solid var(--tpc-border);
	border-radius: var(--carbs-qs-radius-sm);
	background: var(--carbs-qs-surface-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' width='12' height='8'%3E%3Cpath fill='%236B7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
	appearance: none;
	-webkit-appearance: none;
	font-size: 14px;
	font-weight: 500;
	color: var(--tpc-black);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.carbs-qs-field select:focus {
	outline: none;
	border-color: var(--tpc-red);
	box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.12);
}

/* ---------- Actions ---------- */

.carbs-qs-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 22px;
}

.carbs-qs-search-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 36px;
	border: 0;
	border-radius: 999px;
	background: var(--tpc-red);
	color: var(--tpc-white);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	transition: background 0.15s ease, transform 0.15s ease;
}

.carbs-qs-search-btn:hover {
	background: var(--tpc-red);
	transform: translateY(-1px);
}

.carbs-qs-reset-btn {
	border: 0;
	background: transparent;
	color: var(--tpc-gray);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.carbs-qs-reset-btn:hover {
	color: var(--tpc-black);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.carbs-qs-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.carbs-qs-wrap.carbs-qs-overlap {
		margin-top: -100px;
	}
}

@media (max-width: 560px) {
	.carbs-qs-grid {
		grid-template-columns: 1fr;
	}

	.carbs-qs-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.carbs-qs-tab-advanced {
		margin-left: 0;
	}

	.carbs-qs-actions {
		flex-direction: column;
		gap: 12px;
	}

	.carbs-qs-search-btn {
		width: 100%;
		justify-content: center;
	}

	.carbs-qs-wrap.carbs-qs-overlap {
		margin-top: -60px;
	}
}
