/**
 * Webcodexworld Car Buying & Selling
 * "All Brands" directory (`[carbs_brand_grid]`) styles - the page chrome
 * (heading/search/count/grid) around the same `.carbs-brand-card` design
 * carbs-brands.css already defines for the homepage carousel, so a brand
 * card looks identical in both places, plus a real live listing-count pill
 * this page has the room to show.
 *
 * @package Webcodexworld Car Buying & Selling
 * @since 1.9.4
 */

.carbs-brand-grid-wrap {
	--carbs-bg-count-bg: rgba(178, 34, 24, 0.08);

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

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

.carbs-brand-grid-wrap svg {
	display: block;
	flex-shrink: 0;
}

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

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

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

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

.carbs-brand-grid-search {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	width: 100%;
	max-width: 300px;
	padding: 11px 16px;
	border: 1px solid var(--tpc-border);
	border-radius: 999px;
	background: var(--tpc-white);
	color: var(--tpc-gray);
	transition: border-color 200ms ease;
}

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

.carbs-brand-grid-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-brand-grid-search input::placeholder {
	color: var(--tpc-gray);
}

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

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

.carbs-brand-grid-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 18px;
}

/* Grid-specific fit + a bit more breathing room than the compact carousel
   tile (carbs-brands.css), since a dedicated directory page can afford it -
   and room for the real listing-count pill the carousel tile doesn't show. */
.carbs-brand-grid-card {
	width: 100%;
	height: 100%;
	padding: 26px 16px 20px;
	gap: 12px;
}

.carbs-brand-grid-card .carbs-brand-card-logo {
	height: 52px;
}

.carbs-brand-grid-card .carbs-brand-card-name {
	font-size: 14px;
	white-space: normal;
}

.carbs-brand-grid-card-count {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--carbs-bg-count-bg);
	color: var(--tpc-red);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
}

.carbs-brand-grid-card-count svg {
	flex-shrink: 0;
}

/* .carbs-brand-card sets its own `display: flex` (carbs-brands.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-brand-grid-grid .carbs-brand-card[hidden] {
	display: none;
}

.carbs-brand-grid-empty {
	text-align: center;
	color: var(--tpc-gray);
	font-size: 14px;
	padding: 40px 20px 10px;
}

@media (max-width: 560px) {

	.carbs-brand-grid-top {
		flex-direction: column;
		align-items: stretch;
	}

	.carbs-brand-grid-search {
		max-width: none;
	}

	.carbs-brand-grid-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 14px;
	}
}
