/**
 * Webcodexworld Car Buying & Selling
 * "All Dealers" directory (`[carbs_dealers_listing]`) styles - the page
 * chrome (heading/search/count/grid) around the same `.carbs-dealer-card`
 * design carbs-dealers.css already defines for the homepage carousel, so a
 * dealer card looks identical in both places.
 *
 * @package Webcodexworld Car Buying & Selling
 * @since 1.9.0
 */

.carbs-dealers-listing-wrap {
	max-width: 1280px;
	margin: 32px auto;
	padding: 0 20px;
	font-family: var(--tpc-font-body);
	font-weight: 400;
	color: var(--tpc-black);
}

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

.carbs-dealers-listing-wrap svg {
	display: block;
	flex-shrink: 0;
}

/* ---------- Header ---------- */

.carbs-dealers-listing-top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.carbs-dealers-listing-heading {
	margin: 0 0 6px;
	font-family: var(--tpc-font-heading);
	font-size: 30px;
	font-weight: 700;
	color: var(--tpc-black);
}

.carbs-dealers-listing-subheading {
	margin: 0;
	font-size: 14.5px;
	color: var(--tpc-gray);
}

.carbs-dealers-listing-search {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	width: 100%;
	max-width: 320px;
	padding: 11px 16px;
	border: 1px solid var(--tpc-border);
	border-radius: 999px;
	background: var(--tpc-white);
	color: var(--tpc-gray);
}

.carbs-dealers-listing-search:focus-within {
	border-color: var(--tpc-red);
}

.carbs-dealers-listing-search input {
	flex: 1 1 auto;
	min-width: 0;
	border: none;
	outline: none;
	background: none;
	font-family: inherit;
	font-size: 13.5px;
	color: var(--tpc-black);
}

.carbs-dealers-listing-search input::placeholder {
	color: var(--tpc-gray);
}

.carbs-dealers-listing-count {
	margin: 4px 0 22px;
	font-size: 13px;
	color: var(--tpc-gray);
}

/* ---------- Grid ---------- */

.carbs-dealers-listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

/* Grid-specific fit for the shared .carbs-dealer-card - the carousel
   version relies on Swiper's slide width; here the grid column controls
   width instead, so just make sure the card fills its cell. */
.carbs-dealers-listing-grid .carbs-dealer-card {
	width: 100%;
	height: 100%;
}

/* .carbs-dealer-card sets its own `display: flex` (carbs-dealers.css), which
   would otherwise win over the browser's default `[hidden]{display:none}`
   UA-stylesheet rule at equal specificity - this makes the search filter's
   `card.hidden = true` actually hide the card. */
.carbs-dealers-listing-grid .carbs-dealer-card[hidden] {
	display: none;
}

.carbs-dealers-listing-empty,
.carbs-dealers-listing-empty-state {
	text-align: center;
	color: var(--tpc-gray);
	font-size: 14px;
}

.carbs-dealers-listing-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 60px 20px;
	border: 1px dashed var(--tpc-border);
	border-radius: 16px;
}

.carbs-dealers-listing-empty-state svg {
	width: 40px;
	height: 40px;
	color: var(--tpc-light-gray);
}

@media (max-width: 560px) {

	.carbs-dealers-listing-top {
		flex-direction: column;
		align-items: stretch;
	}

	.carbs-dealers-listing-search {
		max-width: none;
	}
}
