/**
 * ThemeREX Auto Dealer — Frontend Styles
 *
 * Mobile-first responsive CSS using BEM naming and custom properties.
 *
 * @package ThemeREX\AutoDealer
 * @version 1.0.0
 */

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
	--trx-ad-color-primary: #1a56db;
	--trx-ad-color-primary-hover: #1e429f;
	--trx-ad-color-success: #0e9f6e;
	/* 4.9:1 on #fff text — WCAG AA for the small status badges. */
	--trx-ad-color-warning: #a16207;
	--trx-ad-color-danger: #e02424;
	--trx-ad-color-info: #3f83f8;
	--trx-ad-color-text: #1f2937;
	/* WCAG AA: secondary must hit ≥ 4.5:1 on the badge background (#f3f4f6). gray-700 gives 8.9:1. */
	--trx-ad-color-text-secondary: #374151;
	/* WCAG AA: muted must hit ≥ 4.5:1 on the placeholder background (#f9fafb). gray-600 gives 7.3:1. */
	--trx-ad-color-text-muted: #4b5563;
	--trx-ad-color-bg: #ffffff;
	--trx-ad-color-bg-alt: #f9fafb;
	--trx-ad-color-bg-badge: #f3f4f6;
	--trx-ad-color-border: #e5e7eb;
	--trx-ad-color-shadow: rgba(0, 0, 0, 0.08);
	--trx-ad-color-whatsapp: #25d366;
	--trx-ad-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--trx-ad-radius: 8px;
	--trx-ad-radius-sm: 4px;
	--trx-ad-radius-lg: 12px;
	--trx-ad-spacing-xs: 4px;
	--trx-ad-spacing-sm: 8px;
	--trx-ad-spacing-md: 16px;
	--trx-ad-spacing-lg: 24px;
	--trx-ad-spacing-xl: 32px;
	--trx-ad-spacing-2xl: 48px;
	--trx-ad-transition: 0.2s ease;
	--trx-ad-max-width: 1280px;
}

/* ==========================================================================
   Base
   ========================================================================== */

.trx-ad-archive,
.trx-ad-single {
	font-family: var(--trx-ad-font-family);
	color: var(--trx-ad-color-text);
	line-height: 1.6;
	max-width: var(--trx-ad-max-width);
	margin: 0 auto;
	padding: var(--trx-ad-spacing-md);
}

/* Inside an Elementor-built layout (theme-builder skins/templates) the
   Elementor container above already constrains width and provides page
   padding — drop ours to avoid double gutters (tester feedback #14). */
.elementor .trx-ad-archive,
.elementor .trx-ad-single {
	max-width: none;
	padding: 0;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.trx-ad-breadcrumbs {
	margin-bottom: var(--trx-ad-spacing-lg);
	font-size: 0.875rem;
}

.trx-ad-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--trx-ad-spacing-xs);
	list-style: none;
	padding: 0;
	margin: 0;
}

.trx-ad-breadcrumbs__item {
	display: flex;
	align-items: center;
	gap: var(--trx-ad-spacing-xs);
}

.trx-ad-breadcrumbs__item:not(:last-child)::after {
	content: "\203A";
	color: var(--trx-ad-color-text-muted);
	margin-left: var(--trx-ad-spacing-xs);
}

.trx-ad-breadcrumbs__link {
	color: var(--trx-ad-color-primary);
	text-decoration: none;
	transition: color var(--trx-ad-transition);
}

.trx-ad-breadcrumbs__link:hover {
	color: var(--trx-ad-color-primary-hover);
	text-decoration: underline;
}

.trx-ad-breadcrumbs__current {
	color: var(--trx-ad-color-text-secondary);
}

/* ==========================================================================
   Archive
   ========================================================================== */

.trx-ad-archive__header {
	margin-bottom: var(--trx-ad-spacing-lg);
}

.trx-ad-archive__title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 var(--trx-ad-spacing-sm) 0;
}

.trx-ad-archive__count {
	color: var(--trx-ad-color-text-secondary);
	font-size: 0.9375rem;
	margin: 0;
}

.trx-ad-archive__grid {
	display: grid;
	/* Mobile-first: stack to 1col regardless of --trx-ad-grid-cols. */
	grid-template-columns: 1fr;
	gap: var(--trx-ad-spacing-lg);
}

@media (min-width: 640px) {
	.trx-ad-archive__grid {
		/* Tablet: cap at 2 cols even if the block requests more (cards
		   would crush below ~340px), but honour 1col requests. */
		grid-template-columns: repeat(min(2, var(--trx-ad-grid-cols, 2)), 1fr);
	}
}

@media (min-width: 1024px) {
	.trx-ad-archive__grid {
		/* Desktop: honour whatever the block (or archive) asked for.
		   Falls back to 3 when --trx-ad-grid-cols isn't set. */
		grid-template-columns: repeat(var(--trx-ad-grid-cols, 3), 1fr);
	}
}

.trx-ad-archive__pagination {
	margin-top: var(--trx-ad-spacing-2xl);
	display: flex;
	justify-content: center;
}

.trx-ad-archive__pagination .nav-links {
	display: flex;
	gap: var(--trx-ad-spacing-xs);
	align-items: center;
	flex-wrap: wrap;
}

.trx-ad-archive__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--trx-ad-spacing-sm);
	border: 1px solid var(--trx-ad-color-border);
	border-radius: var(--trx-ad-radius-sm);
	color: var(--trx-ad-color-text);
	text-decoration: none;
	font-size: 0.875rem;
	transition: all var(--trx-ad-transition);
}

.trx-ad-archive__pagination .page-numbers:hover {
	border-color: var(--trx-ad-color-primary);
	color: var(--trx-ad-color-primary);
}

.trx-ad-archive__pagination .page-numbers.current {
	background: var(--trx-ad-color-primary);
	border-color: var(--trx-ad-color-primary);
	color: #fff;
}

.trx-ad-archive__no-results {
	text-align: center;
	padding: var(--trx-ad-spacing-2xl) var(--trx-ad-spacing-md);
	color: var(--trx-ad-color-text-secondary);
}

.trx-ad-archive__no-results h2 {
	font-size: 1.25rem;
	margin-bottom: var(--trx-ad-spacing-sm);
}

/* ==========================================================================
   Vehicle Card
   ========================================================================== */

.trx-ad-card {
	background: var(--trx-ad-color-bg);
	border: 1px solid var(--trx-ad-color-border);
	border-radius: var(--trx-ad-radius);
	overflow: hidden;
	transition: box-shadow var(--trx-ad-transition), transform var(--trx-ad-transition);
	position: relative;
}

.trx-ad-card:hover {
	box-shadow: 0 4px 20px var(--trx-ad-color-shadow);
	transform: translateY(-2px);
}

.trx-ad-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.trx-ad-card__image {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--trx-ad-color-bg-alt);
}

.trx-ad-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.trx-ad-card:hover .trx-ad-card__img {
	transform: scale(1.03);
}

.trx-ad-card__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--trx-ad-color-text-muted);
	gap: var(--trx-ad-spacing-sm);
	font-size: 0.8125rem;
}

/* All card badges live in one flex row pinned to the top-start corner of the
   media box, wrapping onto extra rows when needed. The row stops short of the
   top-end corner (inset-inline-end) so badges can never collide with the
   absolutely-positioned favorite/compare buttons in .trx-ad-card__actions
   (UAT session 40: the FEATURED badge used to share the top-end inset with
   the actions and rendered underneath them). */
.trx-ad-card__badges {
	position: absolute;
	top: var(--trx-ad-spacing-sm);
	inset-inline-start: var(--trx-ad-spacing-sm);
	inset-inline-end: 84px; /* actions width (68px) + inset (8px) + gap */
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	pointer-events: none;
	z-index: 1;
}

.trx-ad-card__badge {
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 8px;
	border-radius: var(--trx-ad-radius-sm);
	color: #fff;
	line-height: 1.3;
}

.trx-ad-card__badge--condition {
	background: var(--trx-ad-color-primary);
}

.trx-ad-card__badge--condition.trx-ad-card__badge--new {
	background: var(--trx-ad-color-success);
}

.trx-ad-card__badge--condition.trx-ad-card__badge--certified {
	background: var(--trx-ad-color-info);
}

.trx-ad-card__badge--status {
	background: var(--trx-ad-color-warning);
}

.trx-ad-card__badge--status.trx-ad-card__badge--sold {
	background: var(--trx-ad-color-danger);
}

.trx-ad-card__badge--featured {
	background: #f59e0b;
	/* Dark-on-amber: 6.9:1 (white-on-amber was 2.2:1, WCAG fail). */
	color: #451a03;
}

.trx-ad-card__body {
	padding: var(--trx-ad-spacing-md);
}

.trx-ad-card__title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-sm) 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.trx-ad-card__price {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--trx-ad-color-primary);
	margin-bottom: var(--trx-ad-spacing-md);
}

.trx-ad-card__price-original {
	text-decoration: line-through;
	color: var(--trx-ad-color-text-muted);
	font-size: 0.9375rem;
	font-weight: 400;
	margin-right: var(--trx-ad-spacing-sm);
}

.trx-ad-card__price-sale {
	color: var(--trx-ad-color-danger);
}

.trx-ad-card__price-text {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--trx-ad-color-text-secondary);
}

.trx-ad-card__specs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--trx-ad-spacing-sm);
	list-style: none;
	padding: 0;
	margin: 0;
}

.trx-ad-card__spec {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.8125rem;
	color: var(--trx-ad-color-text-secondary);
	background: var(--trx-ad-color-bg-badge);
	padding: 3px 8px;
	border-radius: var(--trx-ad-radius-sm);
}

.trx-ad-card__spec svg {
	flex-shrink: 0;
	color: var(--trx-ad-color-text-muted);
}

.trx-ad-card__actions {
	display: flex;
	gap: var(--trx-ad-spacing-xs);
	position: absolute;
	top: var(--trx-ad-spacing-sm);
	inset-inline-end: var(--trx-ad-spacing-sm);
	z-index: 2;
}

.trx-ad-card__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	color: var(--trx-ad-color-text-secondary);
	cursor: pointer;
	transition: all var(--trx-ad-transition);
	padding: 0;
}

.trx-ad-card__action:hover {
	background: #fff;
	color: var(--trx-ad-color-primary);
	box-shadow: 0 2px 8px var(--trx-ad-color-shadow);
}

/* Active state: same shape for both action buttons. The pill flips to a
   solid fill in the brand color (red for favorite, blue for compare) so a
   user can see at a glance which cards they've saved/queued. */
.trx-ad-card__action.is-active {
	color: #fff;
	box-shadow: 0 2px 8px var(--trx-ad-color-shadow);
}
.trx-ad-card__action.is-active svg {
	fill: currentColor;
	stroke: currentColor;
}
/* Favorite active: a filled RED heart on the light pill — the conventional
   "saved" cue. Previously the whole button flipped to a solid red disc, which
   testers read as an error/destructive state and which flashed an intermediate
   colour while the background transitioned on toggle-off (UAT #15). Keeping the
   pill light means only the heart colour changes, so there's no flicker. */
.trx-ad-card__action--favorite.is-active {
	background: rgba(255, 255, 255, 0.95);
	color: var(--trx-ad-color-danger);
}
.trx-ad-card__action--favorite.is-active:hover {
	background: #fff;
	color: var(--trx-ad-color-danger);
	filter: none;
}
.trx-ad-card__action--compare.is-active {
	background: var(--trx-ad-color-primary);
}
.trx-ad-card__action--compare.is-active:hover {
	background: var(--trx-ad-color-primary);
	color: #fff;
	filter: brightness(0.92);
}

/* ==========================================================================
   Single Vehicle
   ========================================================================== */

.trx-ad-single__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--trx-ad-spacing-xl);
}

/*
 * `min-width: 0` lets grid items shrink below their intrinsic content
 * width. Without it, the Swiper's flex wrapper (whose min-content is the
 * sum of all slide widths × infinity due to `width:100%` on each slide)
 * explodes the 1fr track to ~33M pixels.
 */
.trx-ad-single__layout > * { min-width: 0; }

@media (min-width: 1024px) {
	.trx-ad-single__layout {
		grid-template-columns: 1fr 360px;
	}
}

/* Gallery */

.trx-ad-single__gallery {
	margin-bottom: var(--trx-ad-spacing-lg);
}

.trx-ad-single__gallery-main {
	border-radius: var(--trx-ad-radius-lg);
	overflow: hidden;
	background: var(--trx-ad-color-bg-alt);
	aspect-ratio: 16 / 10;
}

.trx-ad-single__gallery-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.trx-ad-single__gallery-thumbs {
	display: flex;
	gap: var(--trx-ad-spacing-sm);
	margin-top: var(--trx-ad-spacing-sm);
	overflow-x: auto;
	padding-bottom: var(--trx-ad-spacing-xs);
	-webkit-overflow-scrolling: touch;
}

.trx-ad-single__gallery-thumb {
	flex-shrink: 0;
	width: 80px;
	height: 56px;
	border-radius: var(--trx-ad-radius-sm);
	overflow: hidden;
	border: 2px solid transparent;
	cursor: pointer;
	padding: 0;
	background: var(--trx-ad-color-bg-alt);
	transition: border-color var(--trx-ad-transition);
}

.trx-ad-single__gallery-thumb:hover,
.trx-ad-single__gallery-thumb--active {
	border-color: var(--trx-ad-color-primary);
}

.trx-ad-single__gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.trx-ad-single__gallery-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--trx-ad-color-bg-alt);
	border-radius: var(--trx-ad-radius-lg);
	color: var(--trx-ad-color-text-muted);
	aspect-ratio: 16 / 10;
	gap: var(--trx-ad-spacing-sm);
}

/* Header */

.trx-ad-single__header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--trx-ad-spacing-md);
	margin-bottom: var(--trx-ad-spacing-lg);
}

/* Header promoted above the media slider per feedback #20. Tighter bottom
   margin so the gallery sits right under the price block instead of after
   a tall gap. */
.trx-ad-single__header--top {
	margin-bottom: var(--trx-ad-spacing-md);
}

.trx-ad-single__header--top .trx-ad-single__title {
	font-size: 1.75rem;
}

/* Status badge overlay on the main image, top-left, slightly translucent so
   it doesn't fully occlude the image behind it. (Feedback #16.) */
.trx-ad-single__media {
	position: relative;
	margin-bottom: var(--trx-ad-spacing-lg);
}

.trx-ad-single__media-badge {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 5;
	padding: 0.45rem 0.9rem;
	border-radius: 999px;
	background: rgba(220, 38, 38, 0.92);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.trx-ad-single__media-badge--sold {
	background: rgba(220, 38, 38, 0.92);
}

.trx-ad-single__media-badge--pending,
.trx-ad-single__media-badge--reserved {
	/* Darkened from d97706 for WCAG AA contrast with the #fff text. */
	background: rgba(161, 98, 7, 0.95);
}

.trx-ad-single__media-badge--coming_soon {
	background: rgba(59, 130, 246, 0.92);
}

.trx-ad-single__title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

@media (min-width: 768px) {
	.trx-ad-single__title {
		font-size: 1.75rem;
	}
}

.trx-ad-single__price {
	font-size: 1.5rem;
	font-weight: 700;
	white-space: nowrap;
}

.trx-ad-single__price-current {
	color: var(--trx-ad-color-primary);
}

.trx-ad-single__price-original {
	text-decoration: line-through;
	color: var(--trx-ad-color-text-muted);
	font-size: 1rem;
	font-weight: 400;
	margin-right: var(--trx-ad-spacing-sm);
}

.trx-ad-single__price-sale {
	color: var(--trx-ad-color-danger);
}

.trx-ad-single__price-request {
	color: var(--trx-ad-color-text-secondary);
	font-size: 1rem;
	font-weight: 500;
}

/* Badges */

.trx-ad-single__badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--trx-ad-spacing-sm);
	margin-bottom: var(--trx-ad-spacing-xl);
}

.trx-ad-single__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--trx-ad-radius);
	font-size: 0.8125rem;
	font-weight: 500;
	background: var(--trx-ad-color-bg-badge);
	color: var(--trx-ad-color-text-secondary);
}

.trx-ad-single__badge svg {
	flex-shrink: 0;
}

.trx-ad-single__badge--condition {
	background: rgba(26, 86, 219, 0.08);
	color: var(--trx-ad-color-primary);
}

.trx-ad-single__badge--accident-free {
	background: rgba(14, 159, 110, 0.08);
	/* WCAG AA: success-500 on success-50 fails (3.08:1). Use success-700 (#047857) — 6.2:1. */
	color: #047857;
}

.trx-ad-single__badge--price-reduced {
	background: rgba(224, 36, 36, 0.08);
	/* WCAG AA: danger-500 on danger-50 fails (4.16:1). Use danger-700 (#b91c1c) — 6.4:1. */
	color: #b91c1c;
}

/* Description */

.trx-ad-single__description {
	margin-bottom: var(--trx-ad-spacing-xl);
}

.trx-ad-single__description h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-md) 0;
}

.trx-ad-single__description-text {
	line-height: 1.7;
	color: var(--trx-ad-color-text-secondary);
}

/* ==========================================================================
   Specs Table
   ========================================================================== */

.trx-ad-specs-table {
	margin-bottom: var(--trx-ad-spacing-xl);
}

.trx-ad-specs-table__heading {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-lg) 0;
}

.trx-ad-specs-table__group {
	margin-bottom: var(--trx-ad-spacing-lg);
}

.trx-ad-specs-table__group-title {
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-sm) 0;
	color: var(--trx-ad-color-text);
	padding-bottom: var(--trx-ad-spacing-sm);
	border-bottom: 2px solid var(--trx-ad-color-primary);
}

.trx-ad-specs-table__table {
	width: 100%;
	border-collapse: collapse;
}

.trx-ad-specs-table__row:nth-child(odd) {
	background: var(--trx-ad-color-bg-alt);
}

.trx-ad-specs-table__label,
.trx-ad-specs-table__value {
	padding: 10px var(--trx-ad-spacing-md);
	font-size: 0.875rem;
}

.trx-ad-specs-table__label {
	font-weight: 500;
	color: var(--trx-ad-color-text-secondary);
	width: 40%;
	text-align: left;
}

.trx-ad-specs-table__value {
	color: var(--trx-ad-color-text);
	font-weight: 500;
}

/* ==========================================================================
   Features
   ========================================================================== */

.trx-ad-single__features {
	margin-bottom: var(--trx-ad-spacing-xl);
}

.trx-ad-single__features-heading {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-md) 0;
}

.trx-ad-single__features-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--trx-ad-spacing-sm);
	list-style: none;
	padding: 0;
	margin: 0;
}

@media (min-width: 640px) {
	.trx-ad-single__features-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.trx-ad-single__features-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.trx-ad-single__features-item {
	display: flex;
	align-items: center;
	gap: var(--trx-ad-spacing-sm);
	font-size: 0.875rem;
	padding: var(--trx-ad-spacing-sm) 0;
}

.trx-ad-single__features-item svg {
	color: var(--trx-ad-color-success);
	flex-shrink: 0;
}

/* ==========================================================================
   EV Panel
   ========================================================================== */

.trx-ad-single__ev-panel {
	background: linear-gradient(135deg, rgba(14, 159, 110, 0.04), rgba(26, 86, 219, 0.04));
	border: 1px solid rgba(14, 159, 110, 0.15);
	border-radius: var(--trx-ad-radius-lg);
	padding: var(--trx-ad-spacing-lg);
	margin-bottom: var(--trx-ad-spacing-xl);
}

.trx-ad-single__ev-panel-heading {
	display: flex;
	align-items: center;
	gap: var(--trx-ad-spacing-sm);
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-md) 0;
	color: var(--trx-ad-color-success);
}

.trx-ad-single__ev-panel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--trx-ad-spacing-md);
}

.trx-ad-single__ev-stat {
	text-align: center;
	padding: var(--trx-ad-spacing-md);
	background: var(--trx-ad-color-bg);
	border-radius: var(--trx-ad-radius);
}

.trx-ad-single__ev-stat-label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--trx-ad-color-text-muted);
	margin-bottom: var(--trx-ad-spacing-xs);
}

.trx-ad-single__ev-stat-value {
	display: block;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--trx-ad-color-text);
}

/* ==========================================================================
   Actions Row
   ========================================================================== */

.trx-ad-single__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--trx-ad-spacing-sm);
	margin-bottom: var(--trx-ad-spacing-xl);
	padding-top: var(--trx-ad-spacing-lg);
	border-top: 1px solid var(--trx-ad-color-border);
}

.trx-ad-single__action-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--trx-ad-spacing-sm);
	padding: 8px 16px;
	border: 1px solid var(--trx-ad-color-border);
	border-radius: var(--trx-ad-radius);
	background: var(--trx-ad-color-bg);
	color: var(--trx-ad-color-text-secondary);
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--trx-ad-transition);
	font-family: inherit;
}

.trx-ad-single__action-btn:hover {
	border-color: var(--trx-ad-color-primary);
	color: var(--trx-ad-color-primary);
}

/* ==========================================================================
   Similar Vehicles
   ========================================================================== */

.trx-ad-single__similar {
	margin-top: var(--trx-ad-spacing-2xl);
	padding-top: var(--trx-ad-spacing-xl);
	border-top: 1px solid var(--trx-ad-color-border);
}

.trx-ad-single__similar-heading {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-lg) 0;
}

.trx-ad-single__similar-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--trx-ad-spacing-md);
}

@media (min-width: 640px) {
	.trx-ad-single__similar-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.trx-ad-single__similar-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ==========================================================================
   Dealer Card
   ========================================================================== */

/* No outer margin here: spacing between cards belongs to the parent layout
   (directory grid gap, sidebar gap) so it stays controllable from widget
   settings (tester feedback #5). */
.trx-ad-dealer-card {
	background: var(--trx-ad-color-bg);
	border: 1px solid var(--trx-ad-color-border);
	border-radius: var(--trx-ad-radius-lg);
	padding: var(--trx-ad-spacing-lg);
}

.trx-ad-dealer-card__heading {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 var(--trx-ad-spacing-md) 0;
	color: var(--trx-ad-color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.75rem;
}

.trx-ad-dealer-card__header {
	display: flex;
	align-items: center;
	gap: var(--trx-ad-spacing-md);
	margin-bottom: var(--trx-ad-spacing-lg);
	padding-bottom: var(--trx-ad-spacing-md);
	border-bottom: 1px solid var(--trx-ad-color-border);
}

.trx-ad-dealer-card__logo {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
}

.trx-ad-dealer-card__logo-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--trx-ad-radius-sm);
}

.trx-ad-dealer-card__name {
	font-size: 1.0625rem;
	font-weight: 600;
	margin: 0;
}

/* Dealer-page click-through (D6): name + logo link to the dealer's single
   page; kept visually identical to the plain heading until hover. */
.trx-ad-dealer-card__name-link {
	color: inherit;
	text-decoration: none;
	transition: color var(--trx-ad-transition);
}

.trx-ad-dealer-card__name-link:hover {
	color: var(--trx-ad-color-primary);
}

.trx-ad-dealer-card__logo-link {
	display: inline-block;
	line-height: 0;
}

.trx-ad-dealer-card__details {
	display: flex;
	flex-direction: column;
	gap: var(--trx-ad-spacing-md);
	margin-bottom: var(--trx-ad-spacing-lg);
}

.trx-ad-dealer-card__field {
	display: flex;
	align-items: flex-start;
	gap: var(--trx-ad-spacing-sm);
	font-size: 0.875rem;
}

.trx-ad-dealer-card__field svg {
	flex-shrink: 0;
	color: var(--trx-ad-color-text-muted);
	margin-top: 1px;
}

.trx-ad-dealer-card__link {
	color: var(--trx-ad-color-text);
	text-decoration: none;
	transition: color var(--trx-ad-transition);
	word-break: break-word;
	/* Reset: themes commonly set a tall paragraph line-height (e.g. 1.625em)
	   that misaligns these icon+link rows (tester feedback #3). */
	line-height: normal;
}

.trx-ad-dealer-card__link:hover {
	color: var(--trx-ad-color-primary);
}

.trx-ad-dealer-card__text {
	color: var(--trx-ad-color-text-secondary);
	line-height: 1.5;
}

.trx-ad-dealer-card__actions {
	display: flex;
	flex-direction: column;
	gap: var(--trx-ad-spacing-sm);
}

.trx-ad-dealer-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--trx-ad-spacing-sm);
	padding: 10px var(--trx-ad-spacing-md);
	border-radius: var(--trx-ad-radius);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: all var(--trx-ad-transition);
	cursor: pointer;
}

.trx-ad-dealer-card__btn--call {
	background: var(--trx-ad-color-primary);
	color: #fff;
}

.trx-ad-dealer-card__btn--call:hover {
	background: var(--trx-ad-color-primary-hover);
	color: #fff;
}

.trx-ad-dealer-card__btn--whatsapp {
	background: var(--trx-ad-color-whatsapp);
	color: #fff;
}

.trx-ad-dealer-card__btn--whatsapp:hover {
	background: #20bd5a;
	color: #fff;
}

.trx-ad-dealer-card__btn--email {
	background: var(--trx-ad-color-bg-alt);
	color: var(--trx-ad-color-text);
	border: 1px solid var(--trx-ad-color-border);
}

.trx-ad-dealer-card__btn--email:hover {
	border-color: var(--trx-ad-color-primary);
	color: var(--trx-ad-color-primary);
}

.trx-ad-dealer-card__btn--page {
	background: transparent;
	color: var(--trx-ad-color-primary);
	border: 1px solid var(--trx-ad-color-primary);
}

.trx-ad-dealer-card__btn--page:hover {
	background: var(--trx-ad-color-primary);
	color: #fff;
}

/* ==========================================================================
   Mobile Contact Bar
   ========================================================================== */

.trx-ad-mobile-bar {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--trx-ad-color-bg);
	border-top: 1px solid var(--trx-ad-color-border);
	padding: var(--trx-ad-spacing-sm) var(--trx-ad-spacing-md);
	z-index: 1000;
	gap: var(--trx-ad-spacing-sm);
	box-shadow: 0 -2px 10px var(--trx-ad-color-shadow);
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.trx-ad-mobile-bar.is-visible {
	transform: translateY(0);
}

@media (max-width: 767px) {
	.trx-ad-mobile-bar {
		display: flex;
	}
}

.trx-ad-mobile-bar__btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 8px;
	border-radius: var(--trx-ad-radius);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
}

.trx-ad-mobile-bar__btn--call {
	background: var(--trx-ad-color-primary);
	color: #fff;
}

.trx-ad-mobile-bar__btn--whatsapp {
	background: var(--trx-ad-color-whatsapp);
	color: #fff;
}

.trx-ad-mobile-bar__btn--email {
	background: var(--trx-ad-color-bg-alt);
	color: var(--trx-ad-color-text);
	border: 1px solid var(--trx-ad-color-border);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.trx-ad-mobile-bar,
	.trx-ad-single__actions,
	.trx-ad-card__actions,
	.trx-ad-single__similar,
	.trx-ad-dealer-card__actions,
	.trx-ad-archive__pagination {
		display: none !important;
	}

	.trx-ad-single__layout {
		grid-template-columns: 1fr !important;
	}

	.trx-ad-card {
		break-inside: avoid;
		box-shadow: none !important;
		border: 1px solid #ccc !important;
	}

	.trx-ad-dealer-card {
		position: static !important;
		border: 1px solid #ccc !important;
	}

	.trx-ad-single__gallery-thumbs {
		display: none !important;
	}

	body {
		font-size: 12pt;
	}
}

/* ==========================================================================
   Archive layout + filter form (Phase 3)
   ========================================================================== */

.trx-ad-archive__layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 2rem;
	margin-top: 1.5rem;
}

@media (max-width: 768px) {
	.trx-ad-archive__layout {
		grid-template-columns: 1fr;
	}
}

.trx-ad-archive__sidebar {
	min-width: 0;
	position: relative;
}

.trx-ad-archive__results {
	min-width: 0;
}

/* Top toolbar: hamburger + sort dropdown. Hamburger hidden on desktop. */
.trx-ad-archive__toolbar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
	flex-wrap: wrap;
}

.trx-ad-archive__filter-toggle {
	display: none;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.9rem;
	background: var(--trx-ad-color-primary, #1a56db);
	color: #fff;
	border: 0;
	border-radius: var(--trx-ad-radius, 8px);
	font-size: 0.95rem;
	cursor: pointer;
}

.trx-ad-archive__filter-toggle:hover,
.trx-ad-archive__filter-toggle:focus-visible {
	background: var(--trx-ad-color-primary-hover, #1e429f);
}

.trx-ad-archive__sort {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
	font-size: 0.95rem;
}

.trx-ad-archive__sort-label {
	color: #4b5563;
	font-weight: 500;
}

.trx-ad-archive__sort select {
	padding: 0.45rem 0.7rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
}

.trx-ad-archive__sidebar-close {
	display: none;
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	/* Fixed circle + centered glyph. box-sizing/padding/flex/min-width resist
	   block themes (e.g. Elementra) whose generic `button` rules add padding
	   and stretch this into an off-centre, hard-to-see ellipse (UAT #16). A
	   solid light fill (not transparent) keeps it visible without hovering. */
	box-sizing: border-box;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	min-width: 0;
	padding: 0;
	border: 1px solid #e5e7eb;
	background: #f3f4f6;
	color: #1f2937;
	cursor: pointer;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.trx-ad-archive__sidebar-close:hover {
	background: #e5e7eb;
}

/* Loading state — dim the grid while a fetch is in flight. */
.trx-ad-archive--loading .trx-ad-archive__results {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* Mobile drawer (off-canvas). */
@media (max-width: 768px) {
	.trx-ad-archive__filter-toggle {
		display: inline-flex;
	}
	.trx-ad-archive__sort {
		margin-left: 0;
	}
	.trx-ad-archive__sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(90vw, 360px);
		max-width: 90vw;
		background: #fff;
		box-shadow: 0 0 32px rgba(0,0,0,0.18);
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		/* Above sticky theme headers/logos so the drawer's top filters and its
		   close button aren't covered (UAT #16: header overlapped Keyword/Make/
		   Model and the close control). */
		z-index: 100001;
		overflow-y: auto;
		padding: 3rem 1.25rem 1.5rem;
	}
	.trx-ad-archive__sidebar--open {
		transform: translateX(0);
	}
	.trx-ad-archive__sidebar-close {
		display: inline-flex;
	}
	.trx-ad-body--no-scroll {
		overflow: hidden;
	}
	/* Backdrop — dims the page behind the drawer so it feels like a modal
	   surface, not a floating panel. Created in JS, removed on close. */
	.trx-ad-archive__sidebar-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.45);
		z-index: 100000;
		opacity: 0;
		transition: opacity 0.2s ease;
		pointer-events: none;
	}
	.trx-ad-archive__sidebar-backdrop--visible {
		opacity: 1;
		pointer-events: auto;
	}
}

.trx-ad-filter-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.25rem;
	background: #f7f7f8;
	border: 1px solid #e3e3e6;
	border-radius: 6px;
}

.trx-ad-filter-form__field label,
.trx-ad-filter-form__field legend {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	font-size: 0.9rem;
}

.trx-ad-filter-form__field input[type="text"],
.trx-ad-filter-form__field input[type="search"],
.trx-ad-filter-form__field input[type="number"],
.trx-ad-filter-form__field select {
	width: 100%;
	padding: 0.5rem 0.65rem;
	border: 1px solid #cdcdd1;
	border-radius: 4px;
	background: #fff;
	font-size: 0.95rem;
}

.trx-ad-filter-form__field--range {
	border: 0;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.trx-ad-filter-form__field--range legend {
	grid-column: 1 / -1;
}

.trx-ad-filter-form__field--checkbox label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: normal;
}

.trx-ad-filter-form__count {
	color: #888;
	font-size: 0.85em;
}

.trx-ad-filter-form__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.trx-ad-filter-form__submit {
	flex: 1;
	padding: 0.6rem 1rem;
	background: #1f2937;
	color: #fff;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.trx-ad-filter-form__submit:hover { background: #111827; }

.trx-ad-filter-form__count-pill {
	background: #fff;
	color: #1f2937;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
}

.trx-ad-filter-form__reset {
	color: #6b7280;
	text-decoration: underline;
	font-size: 0.9rem;
}

/* ==========================================================================
   Vehicle gallery (Phase 4A)
   ========================================================================== */

.trx-ad-gallery { display: flex; flex-direction: column; gap: 8px; }
.trx-ad-gallery__main {
	display: block;
	border-radius: var(--trx-ad-radius);
	overflow: hidden;
	background: var(--trx-ad-color-bg-alt);
	cursor: zoom-in;
}
.trx-ad-gallery__main img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	max-height: 540px;
}
.trx-ad-gallery__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--trx-ad-gallery-cols, 4), minmax(0, 1fr));
	gap: 6px;
}
.trx-ad-gallery__item { margin: 0; padding: 0; }
.trx-ad-gallery__thumb {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--trx-ad-radius-sm);
	cursor: zoom-in;
	background: var(--trx-ad-color-bg-alt);
}
.trx-ad-gallery__thumb img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: transform 0.2s ease;
}
.trx-ad-gallery__thumb:hover img { transform: scale(1.04); }

/* ==========================================================================
   Lightbox overlay
   ========================================================================== */

.trx-ad-lightbox {
	position: fixed; inset: 0; z-index: 999999;
	background: rgba(0, 0, 0, 0.86);
	display: none; align-items: center; justify-content: center;
	padding: 24px;
}
.trx-ad-lightbox.is-open { display: flex; }
.trx-ad-lightbox__img {
	max-width: 100%; max-height: 100%; height: auto;
	border-radius: var(--trx-ad-radius); box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.trx-ad-lightbox__close {
	position: absolute; top: 16px; right: 16px;
	width: 40px; height: 40px;
	background: transparent; color: #fff;
	border: 0; border-radius: 50%;
	font-size: 28px; line-height: 1; cursor: pointer;
	/* Hardened against theme button styles (padding / min-width / min-height)
	   that stretch the 40x40 circle into an ellipse (tester feedback #7). */
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	min-width: 0;
	min-height: 0;
	max-width: none;
	max-height: none;
	display: flex; align-items: center; justify-content: center;
}
.trx-ad-lightbox__close:hover { background: rgba(255,255,255,0.12); }
.trx-ad-lightbox__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 48px; height: 48px;
	background: rgba(0,0,0,0.35); color: #fff;
	border: 0; border-radius: 50%;
	font-size: 30px; line-height: 1; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.trx-ad-lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.trx-ad-lightbox__nav--prev { left: 16px; }
.trx-ad-lightbox__nav--next { right: 16px; }
.trx-ad-lightbox__nav[hidden] { display: none; }
/* Hint that media-slider images are zoomable. */
.trx-ad-media-slider .trx-ad-ms-main .swiper-slide[data-slide-type="image"] img { cursor: zoom-in; }

/* ==========================================================================
   Toast — transient confirmation (favorites/compare). Paired with an
   SR-only aria-live region for assistive tech.
   ========================================================================== */
.trx-ad-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}
.trx-ad-toast {
	position: fixed;
	left: 50%; bottom: 24px;
	transform: translateX(-50%) translateY(12px);
	z-index: 1000000;
	max-width: calc(100vw - 32px);
	padding: 10px 18px;
	background: rgba(17, 24, 39, 0.95);
	color: #fff;
	font-size: 0.9rem; line-height: 1.3;
	border-radius: 999px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.trx-ad-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Similar + recently-viewed strips
   ========================================================================== */

.trx-ad-similar,
.trx-ad-recently-viewed {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--trx-ad-color-border);
}
.trx-ad-similar__heading,
.trx-ad-recently-viewed__heading {
	font-size: 1.25rem;
	margin: 0 0 16px;
	font-weight: 600;
	color: var(--trx-ad-color-text);
}
.trx-ad-similar__grid,
.trx-ad-recently-viewed__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.trx-ad-card--rv {
	display: block;
	text-decoration: none;
	color: inherit;
	background: var(--trx-ad-color-bg);
	border: 1px solid var(--trx-ad-color-border);
	border-radius: var(--trx-ad-radius);
	overflow: hidden;
	transition: box-shadow 0.15s ease;
}
.trx-ad-card--rv:hover { box-shadow: 0 4px 18px var(--trx-ad-color-shadow); }
.trx-ad-card--rv .trx-ad-card__image { aspect-ratio: 4 / 3; background: var(--trx-ad-color-bg-alt); }
.trx-ad-card--rv .trx-ad-card__image img { width:100%; height:100%; object-fit:cover; display:block; }
.trx-ad-card--rv .trx-ad-card__body { padding: 10px 12px; }
.trx-ad-card--rv .trx-ad-card__title { font-size: 0.95rem; margin: 0 0 4px; font-weight: 600; }
.trx-ad-card--rv .trx-ad-card__price { color: var(--trx-ad-color-primary); font-weight: 600; }

/* ==========================================================================
   Print stylesheet (Phase 4A)
   Used by single-vehicle "Print" button + browser-native print.
   ========================================================================== */

@media print {
	body { background: #fff !important; color: #000 !important; }

	/* Strip noise. */
	.trx-ad-mobile-bar,
	.trx-ad-archive__sidebar,
	.trx-ad-archive__pagination,
	.trx-ad-filter-form,
	.trx-ad-similar,
	.trx-ad-recently-viewed,
	.trx-ad-single__actions,
	.trx-ad-single__sidebar,
	.trx-ad-card__action,
	.trx-ad-lightbox,
	#wpadminbar,
	header, footer, nav { display: none !important; }

	.trx-ad-single { padding: 0 !important; }
	.trx-ad-single__main, .trx-ad-archive__results { width: 100% !important; max-width: 100% !important; }

	.trx-ad-single__title { font-size: 18pt; margin: 0 0 6pt; }
	.trx-ad-single__price-block, .trx-ad-card__price { color: #000 !important; font-weight: bold; }

	.trx-ad-gallery__main img { max-height: 220pt; }
	.trx-ad-gallery__grid { grid-template-columns: repeat(4, 1fr) !important; }
	.trx-ad-gallery__thumb img { aspect-ratio: 4/3; }

	a, a:visited { color: #000 !important; text-decoration: underline; }
	.trx-ad-specs-table { font-size: 10pt; }
	.trx-ad-specs-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

	/* Try to keep specs table on one page. */
	.trx-ad-specs-table { page-break-inside: avoid; }
}

/* ==========================================================================
   Gutenberg Blocks (Phase 5)
   Block wrappers — inner elements (.trx-ad-card, .trx-ad-filter-form, etc.)
   already have their own styling above; these rules cover block-level
   spacing, cards, and column behaviour.
   ========================================================================== */

[class*="wp-block-trx-auto-dealer-"] {
	margin-block: 1.5rem;
}
[class*="wp-block-trx-auto-dealer-"]:first-child {
	margin-block-start: 0;
}
[class*="wp-block-trx-auto-dealer-"]:last-child {
	margin-block-end: 0;
}

/* Search Form block — give the filter form a card frame when used as a
   standalone block (different from the archive sidebar context). */
.wp-block-trx-auto-dealer-search-form {
	background: #fafafa;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-search-form__heading {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #111827;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__heading {
	margin-block-start: 0;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.75rem 1rem;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field {
	min-width: 0; /* Grid items default to min-width:auto, which lets the
	                 two range inputs push the cell wider than its column. */
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field input,
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	min-width: 0;
}
/* Range fieldsets — two number inputs side-by-side without overflow. */
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range {
	border: 0;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range legend {
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	padding: 0;
	margin-bottom: 0.125rem;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range input {
	display: block;
	width: 100%;
	min-width: 0;
}
/* Wrap both inputs in a flex row that respects the cell width. */
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range {
	display: grid;
	grid-template-areas:
		"legend legend"
		"from   to";
	grid-template-columns: 1fr 1fr;
	column-gap: 0.5rem;
	row-gap: 0.375rem;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range legend {
	grid-area: legend;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range input:first-of-type {
	grid-area: from;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__field--range input:last-of-type {
	grid-area: to;
}
.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form__actions {
	grid-column: 1 / -1;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

/* Compare + Favorites page — hydrated grids + per-card remove button. */
.trx-ad-compare-page,
.trx-ad-favorites-page {
	margin: 1.5rem 0;
}
.trx-ad-compare-page__grid,
.trx-ad-favorites-page__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	margin-top: 1rem;
}
.trx-ad-compare-page__grid .trx-ad-card,
.trx-ad-favorites-page__grid .trx-ad-card {
	position: relative;
}
.trx-ad-compare-page__grid .trx-ad-card__image,
.trx-ad-favorites-page__grid .trx-ad-card__image {
	aspect-ratio: 16 / 10;
	width: 100%;
	height: auto;
	overflow: hidden;
	background: var(--trx-ad-color-bg-alt, #f3f4f6);
}
.trx-ad-compare-page__grid .trx-ad-card__image img,
.trx-ad-compare-page__grid .trx-ad-card__img,
.trx-ad-favorites-page__grid .trx-ad-card__image img,
.trx-ad-favorites-page__grid .trx-ad-card__img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}
.trx-ad-card__remove {
	position: absolute;
	top: 8px;
	inset-inline-end: 8px;
	/* Fixed circle + centered glyph. Explicit box-sizing/padding/flex resist
	   block themes (e.g. Elementra) whose generic `button` rules add padding
	   and stretch this into an off-centre ellipse (UAT #15). */
	box-sizing: border-box;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	padding: 0;
	border-radius: 50%;
	border: 0;
	background: rgba(17, 24, 39, 0.7);
	color: #fff;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	z-index: 2;
}
.trx-ad-card__remove:hover {
	background: rgba(220, 38, 38, 0.9);
}
.trx-ad-compare-page__empty,
.trx-ad-favorites-page__empty {
	color: #6b7280;
	padding: 2rem 0;
	text-align: center;
}

/* Comparison spec table — one row per enabled field, one column per vehicle.
 * The table can be wider than a phone viewport (4 vehicle columns); the
 * scroll wrapper keeps the overflow inside the table box instead of forcing
 * the whole page to scroll sideways (UAT #45). */
.trx-ad-compare-page__specs-scroll {
	margin-top: 1.5rem;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.trx-ad-compare-page__specs {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e5e7eb;
}
.trx-ad-compare-page__specs th,
.trx-ad-compare-page__specs td {
	padding: 12px 14px;
	border: 1px solid #e5e7eb;
	text-align: start;
	vertical-align: top;
	font-size: 0.95rem;
}
.trx-ad-compare-page__specs thead th,
.trx-ad-compare-page__specs tr:first-child th {
	background: #f9fafb;
	font-weight: 600;
}
.trx-ad-compare-page__specs tbody th[scope="row"] {
	background: #f9fafb;
	color: #374151;
	font-weight: 500;
	width: 200px;
}
.trx-ad-compare-page__specs tr:nth-child(even) td {
	background: #fcfcfd;
}
.trx-ad-compare-page__specs a {
	color: var(--trx-ad-color-primary, #1a56db);
	text-decoration: none;
}
.trx-ad-compare-page__specs a:hover {
	text-decoration: underline;
}
@media (max-width: 768px) {
	.trx-ad-compare-page__specs {
		font-size: 0.85rem;
	}
	.trx-ad-compare-page__specs th,
	.trx-ad-compare-page__specs td {
		padding: 8px 10px;
	}
	.trx-ad-compare-page__specs tbody th[scope="row"] {
		width: auto;
	}
}
.trx-ad-compare-page__heading,
.trx-ad-favorites-page__heading {
	font-size: 1.5rem;
	margin: 0 0 0.5rem;
}

/* Compare page — vehicle column header (image + title + price + remove). */
/* Compare-spec head cell image: lock to a single aspect ratio so themes
 * that style <img> with their own width/height can't deform the cell.
 * Specificity > 0,2,1 with !important on width/height/object-fit beats
 * the typical theme reset at 0,2,0. */
.trx-ad-compare-page table.trx-ad-compare-page__specs th.trx-ad-compare-page__head-cell .trx-ad-compare-page__image {
	display: block;
	width: 100% !important;
	max-width: 240px !important;
	aspect-ratio: 4 / 3 !important;
	height: auto !important;
	overflow: hidden;
	border-radius: 6px;
	background: #f3f4f6;
	margin: 0 auto 8px;
}
.trx-ad-compare-page table.trx-ad-compare-page__specs th.trx-ad-compare-page__head-cell .trx-ad-compare-page__image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block !important;
}

.trx-ad-compare-page__head th.trx-ad-compare-page__head-cell {
	background: #fff;
	padding: 12px;
	min-width: 180px;
	vertical-align: top;
}
.trx-ad-compare-page__image {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #f3f4f6;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 8px;
}
.trx-ad-compare-page__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.trx-ad-compare-page__image--placeholder {
	background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}
.trx-ad-compare-page__title {
	display: block;
	font-weight: 600;
	font-size: 1rem;
	color: #111827;
	text-decoration: none;
	margin-bottom: 4px;
	line-height: 1.3;
}
.trx-ad-compare-page__title:hover {
	color: var(--trx-ad-color-primary, #1a56db);
	text-decoration: none;
}
.trx-ad-compare-page__price {
	font-weight: 600;
	color: var(--trx-ad-color-primary, #1a56db);
	margin-bottom: 8px;
}
.trx-ad-compare-page__remove {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, 0.75);
	color: #fff;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	z-index: 2;
}
.trx-ad-compare-page__remove:hover {
	background: rgba(220, 38, 38, 0.95);
}
.trx-ad-compare-page__head-cell {
	position: relative;
}

/* Dealer Directory grid (Elementor widget + standalone usage). The column
   count is driven by a CSS variable so a responsive Elementor control can
   override it without specificity wars and the fallback still works. */
.trx-ad-dealer-directory {
	display: grid;
	grid-template-columns: repeat(var(--trx-ad-dir-cols, 3), 1fr);
	gap: 24px;
}
@media (max-width: 1023px) {
	.trx-ad-dealer-directory {
		grid-template-columns: repeat(min(2, var(--trx-ad-dir-cols, 2)), 1fr);
	}
}
@media (max-width: 640px) {
	.trx-ad-dealer-directory {
		grid-template-columns: 1fr;
	}
}

/* Pro Dealer Directory shortcode `[trx_ad_dealer_directory]` emits BEM-style
   markup under `.trx-ad-directory > .trx-ad-directory__grid > .trx-ad-directory__card`
   with a `--trx-ad-cols` custom property set inline on the section. */
.trx-ad-directory {
	margin: 24px 0;
}
.trx-ad-directory__grid {
	display: grid;
	grid-template-columns: repeat(var(--trx-ad-cols, 3), 1fr);
	gap: 24px;
	list-style: none;
	padding: 0;
	margin: 0;
}
.trx-ad-directory__card {
	background: #fff;
	border: 1px solid #e4e7eb;
	border-radius: 8px;
	padding: 20px;
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.trx-ad-directory__card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}
.trx-ad-directory__link {
	display: block;
	text-decoration: none;
	color: inherit;
}
.trx-ad-directory__logo {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: 80px;
	margin: 0 auto 16px;
	object-fit: contain;
}
.trx-ad-directory__logo--empty {
	display: block;
	width: 100%;
	height: 80px;
	background: linear-gradient(135deg, #f0f4f8 0%, #e6ebf0 100%);
	border-radius: 4px;
	margin: 0 auto 16px;
}
.trx-ad-directory__name {
	font-size: 1.2em;
	font-weight: 600;
	margin: 0 0 8px;
	color: #1a1a1a;
	text-align: center;
}
.trx-ad-directory__location {
	font-size: 0.92em;
	color: #5a6470;
	margin: 0 0 8px;
	text-align: center;
}
.trx-ad-directory__count {
	font-size: 0.88em;
	color: #7d8794;
	margin: 0;
	text-align: center;
}
.trx-ad-directory__empty {
	padding: 32px;
	text-align: center;
	color: #5a6470;
	background: #f7f9fb;
	border-radius: 8px;
}
@media (max-width: 1023px) {
	.trx-ad-directory__grid {
		grid-template-columns: repeat(min(2, var(--trx-ad-cols, 2)), 1fr);
	}
}
@media (max-width: 640px) {
	.trx-ad-directory__grid {
		grid-template-columns: 1fr;
	}
}

/* Compact search form: single-row inline form with the most-used filters
   (make, body style, condition, submit). Hides the rest. */
.trx-ad-search-form--compact .trx-ad-filter-form {
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	align-items: end;
}
.trx-ad-search-form--compact .trx-ad-filter-form__field--range,
.trx-ad-search-form--compact .trx-ad-filter-form__field--checkbox,
.trx-ad-search-form--compact .trx-ad-filter-form__field--keyword {
	display: none;
}

/* Vehicle Grid block — the inner .trx-ad-archive__grid handles the grid
   itself; here we just ensure the empty state reads correctly. */
.wp-block-trx-auto-dealer-vehicle-grid.trx-ad-grid--empty {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
	padding: 2rem;
	text-align: center;
	color: #6b7280;
}

/* Vehicle Card block — wrap a single card so it doesn't span the full
   width when used standalone (the archive grid version is unaffected). */
.wp-block-trx-auto-dealer-vehicle-card {
	max-width: 380px;
}
.wp-block-trx-auto-dealer-vehicle-card.alignwide,
.wp-block-trx-auto-dealer-vehicle-card.alignfull {
	max-width: none;
}

/* Card display toggles. Modifiers (`.trx-ad-card-display--no-*`) are added
   either to the vehicle-card block wrapper (single card) or the vehicle-grid
   block wrapper (cascade to every card inside). Same selectors work for both
   thanks to descendant matching. */
.trx-ad-card-display--no-meta     .trx-ad-card__specs,
.trx-ad-card-display--no-label    .trx-ad-card__badge,
.trx-ad-card-display--no-favorite .trx-ad-card__action--favorite,
.trx-ad-card-display--no-compare  .trx-ad-card__action--compare {
	display: none !important;
}
/* If both action toggles are off, hide the actions container too so we
   don't leave an empty box. */
.trx-ad-card-display--no-favorite.trx-ad-card-display--no-compare .trx-ad-card__actions {
	display: none !important;
}

/* Search Form — per-filter toggles (see filter-form.php field modifiers). */
.trx-ad-search-form--hide-keyword       .trx-ad-filter-form__field--keyword,
.trx-ad-search-form--hide-make          .trx-ad-filter-form__field--make,
.trx-ad-search-form--hide-model         .trx-ad-filter-form__field--model,
.trx-ad-search-form--hide-body-style    .trx-ad-filter-form__field--body-style,
.trx-ad-search-form--hide-fuel          .trx-ad-filter-form__field--fuel,
.trx-ad-search-form--hide-condition     .trx-ad-filter-form__field--condition,
.trx-ad-search-form--hide-year          .trx-ad-filter-form__field--year,
.trx-ad-search-form--hide-price         .trx-ad-filter-form__field--price,
.trx-ad-search-form--hide-mileage       .trx-ad-filter-form__field--mileage,
.trx-ad-search-form--hide-featured      .trx-ad-filter-form__field--featured,
.trx-ad-search-form--hide-accident-free .trx-ad-filter-form__field--accident-free {
	display: none !important;
}

/* Dealer Info — per-field toggles (modifiers on the .wp-block-...-dealer-info
   wrapper hide individual children of .trx-ad-dealer-card via descendant
   selectors; the template stays untouched). */
.trx-ad-dealer-card--no-logo        .trx-ad-dealer-card__logo,
.trx-ad-dealer-card--no-heading     .trx-ad-dealer-card__heading,
.trx-ad-dealer-card--no-phone       .trx-ad-dealer-card__field--phone,
.trx-ad-dealer-card--no-email       .trx-ad-dealer-card__field--email,
.trx-ad-dealer-card--no-address     .trx-ad-dealer-card__field--address,
.trx-ad-dealer-card--no-website     .trx-ad-dealer-card__field--website,
.trx-ad-dealer-card--no-hours       .trx-ad-dealer-card__field--hours,
.trx-ad-dealer-card--no-map         .trx-ad-dealer-card__field--map,
.trx-ad-dealer-card--no-description .trx-ad-dealer-card__field--description,
.trx-ad-dealer-card--no-call        .trx-ad-dealer-card__btn--call,
.trx-ad-dealer-card--no-whatsapp    .trx-ad-dealer-card__btn--whatsapp,
.trx-ad-dealer-card--no-email-btn   .trx-ad-dealer-card__btn--email,
.trx-ad-dealer-card--no-dealer-link .trx-ad-dealer-card__btn--page {
	display: none !important;
}

/* Dealer-link opt-out: the button is hidden above; the name/logo anchors
   stay in the markup but become inert so the card reads as plain text. */
.trx-ad-dealer-card--no-dealer-link .trx-ad-dealer-card__name-link,
.trx-ad-dealer-card--no-dealer-link .trx-ad-dealer-card__logo-link {
	pointer-events: none;
	cursor: default;
	color: inherit;
}

/* Hours field: preserve line breaks. */
.trx-ad-dealer-card__hours {
	white-space: pre-line;
}

/* Single-dealer page layout (templates/single-dealer.php). */
.trx-ad-dealer__container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}
/* Same Elementor-context reset as .trx-ad-archive/.trx-ad-single: the global
   Elementor wrapper handles width + gutters (tester feedback #13). */
.elementor .trx-ad-dealer__container {
	max-width: none;
	padding: 0;
}
.trx-ad-dealer__title {
	margin: 0 0 1.5rem;
	font-size: 2rem;
	font-weight: 600;
}
.trx-ad-dealer__layout {
	display: grid;
	grid-template-columns: 360px 1fr;
	gap: 2rem;
	align-items: start;
}
.trx-ad-dealer__layout > * {
	min-width: 0; /* prevent grid items from blowing past their cell */
}
.trx-ad-dealer__listings-heading {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 600;
}
@media (max-width: 781px) {
	.trx-ad-dealer__layout {
		grid-template-columns: 1fr;
	}
}

/* Map field — fills the dealer-card width with a 4:3-ish embed. */
.trx-ad-dealer-card__field--map {
	display: block;
	margin-top: 1rem;
}
.trx-ad-dealer-card__map {
	width: 100%;
	height: 240px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	display: block;
}
.trx-ad-dealer-card__map-link {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--trx-ad-color-primary);
	text-decoration: none;
}
.trx-ad-dealer-card__map-link:hover {
	text-decoration: underline;
}

/* Description block — slightly reduced spacing inside the card. */
.trx-ad-dealer-card__description p {
	margin: 0 0 0.5rem;
}
.trx-ad-dealer-card__description p:last-child {
	margin-bottom: 0;
}

/* Specs Table block — frame the table when it's a block (not the single
   listing template, which already has its own layout). */
.wp-block-trx-auto-dealer-specs-table {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
}
.wp-block-trx-auto-dealer-specs-table .trx-ad-specs-table__heading {
	margin: 0;
	padding: 1rem 1.25rem;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	font-size: 1.125rem;
	font-weight: 600;
}
.wp-block-trx-auto-dealer-specs-table .trx-ad-specs-table {
	padding: 0.5rem 1.25rem 1.25rem;
}
.wp-block-trx-auto-dealer-specs-table .trx-ad-specs-table__group + .trx-ad-specs-table__group {
	margin-top: 1.25rem;
}

/* Contact Form block — card frame with prominent heading. */
.wp-block-trx-auto-dealer-contact-form {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.5rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.wp-block-trx-auto-dealer-contact-form .trx-ad-form__heading {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #111827;
}

/* Dealer Info block — card frame matching the contact form so they
   sit nicely next to each other in the single-vehicle pattern. */
.wp-block-trx-auto-dealer-dealer-info {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.wp-block-trx-auto-dealer-dealer-info .trx-ad-dealer-card {
	box-shadow: none;
	border: 0;
	padding: 0;
	background: transparent;
}

/* ==========================================================================
   Forms (.trx-ad-form*) — used by ContactForm block, [trx_ad_inquiry_form]
   shortcode, and the single-vehicle inquiry/test-drive/finance forms.
   ========================================================================== */

.trx-ad-form {
	font-family: inherit;
	color: #111827;
}

.trx-ad-form__form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.trx-ad-form__fields {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

.trx-ad-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}
.trx-ad-form__field--w100 {
	grid-column: 1 / -1;
}
.trx-ad-form__field--w50 {
	grid-column: span 1;
}
@media (max-width: 640px) {
	.trx-ad-form__fields {
		grid-template-columns: 1fr;
	}
	.trx-ad-form__field--w50 {
		grid-column: 1 / -1;
	}
}

.trx-ad-form__label {
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.trx-ad-form__required {
	color: #dc2626;
	font-weight: 700;
}

.trx-ad-form__input,
.trx-ad-form__textarea,
.trx-ad-form__select {
	width: 100%;
	padding: 0.5rem 0.75rem;
	font-size: 0.9375rem;
	font-family: inherit;
	color: #111827;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-sizing: border-box;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.trx-ad-form__input:focus,
.trx-ad-form__textarea:focus,
.trx-ad-form__select:focus {
	outline: none;
	border-color: var(--trx-ad-color-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.trx-ad-form__input:disabled,
.trx-ad-form__textarea:disabled,
.trx-ad-form__select:disabled {
	background: #f3f4f6;
	color: #9ca3af;
	cursor: not-allowed;
}

.trx-ad-form__textarea {
	min-height: 96px;
	resize: vertical;
}

.trx-ad-form__select {
	appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 10px 7px;
	padding-right: 2rem;
}

.trx-ad-form__checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	color: #374151;
	cursor: pointer;
}
.trx-ad-form__checkbox {
	width: 1rem;
	height: 1rem;
	accent-color: var(--trx-ad-color-primary);
	cursor: pointer;
}

.trx-ad-form__footer {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.trx-ad-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
	background: var(--trx-ad-color-primary);
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.15s ease, transform 0.05s ease;
	line-height: 1.4;
}
.trx-ad-form__submit:hover {
	background: var(--trx-ad-color-primary-hover);
}
.trx-ad-form__submit:active {
	transform: translateY(1px);
}
.trx-ad-form__submit:focus-visible {
	outline: 2px solid var(--trx-ad-color-primary-hover);
	outline-offset: 2px;
}
.trx-ad-form__submit:disabled {
	background: #93c5fd;
	cursor: not-allowed;
	transform: none;
}

.trx-ad-form__message {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: 0.9375rem;
}
.trx-ad-form__message[data-type="success"],
.trx-ad-form__message.is-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}
.trx-ad-form__message[data-type="error"],
.trx-ad-form__message.is-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* ==========================================================================
   Block Patterns (Phase 5C)
   ========================================================================== */

.trx-ad-pattern-inventory {
	margin-block: 2rem;
}

.trx-ad-pattern-single .wp-block-columns {
	gap: 1.5rem;
	align-items: flex-start;
}

@media (max-width: 781px) {
	.trx-ad-pattern-single .wp-block-columns {
		flex-direction: column;
	}
	.trx-ad-pattern-single .wp-block-column {
		flex-basis: auto !important;
		width: 100% !important;
	}
	.wp-block-trx-auto-dealer-search-form .trx-ad-filter-form {
		grid-template-columns: 1fr;
	}
	.wp-block-trx-auto-dealer-vehicle-card {
		max-width: none;
	}
}

/* ============================================================
 * Pro Social Proof + Response Time badges (Phase 13b)
 * Injected by DealerResponseTime + SocialProofCounters via the_content.
 * ============================================================ */
.trx-ad-meta-badges,
.trx-ad-social-proof-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}
.trx-ad-social-proof {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
}
/* Plain-text response-time line under the dealer card. Discoverable
 * via the `.trx-ad-response-time` class for theme overrides without
 * looking like a "pill". */
.trx-ad-response-time-wrap {
	margin-top: 8px;
}
.trx-ad-response-time {
	display: block;
	color: #555d66;
	font-size: 0.9em;
	line-height: 1.4;
}
.trx-ad-social-proof--views {
	background: #e3f2fd;
	color: #0d47a1;
	border: 1px solid #90caf9;
}
.trx-ad-social-proof--saved {
	background: #fff3e0;
	color: #e65100;
	border: 1px solid #ffcc80;
}

/* ============================================================
 * Compare bar — floating sticky bar at viewport bottom (free tier)
 * ============================================================ */
.trx-ad-compare-bar {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 16px;
	background: #ffffff;
	color: #1a1a1a;
	border: 1px solid #e0e0e0;
	border-radius: 999px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
	padding: 10px 18px;
	max-width: calc(100vw - 32px);
}
.trx-ad-compare-bar[hidden] {
	display: none;
}
.trx-ad-compare-bar__count {
	font-weight: 600;
	font-size: 0.95em;
	flex: 0 0 auto;
	white-space: nowrap;
}
.trx-ad-compare-bar__count .trx-ad-compare-count {
	display: inline-block;
	min-width: 1.5em;
	padding: 1px 6px;
	margin-inline-end: 4px;
	border-radius: 999px;
	background: var(--trx-ad-color-primary);
	color: #fff;
	font-size: 0.85em;
	text-align: center;
}
/* Compare Link — compact header badge (Elementor + Gutenberg + shortcode) */
.trx-ad-compare-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	line-height: 1;
}
.trx-ad-compare-link:hover {
	color: var(--trx-ad-color-primary, #1565c0);
	text-decoration: none;
}
.trx-ad-compare-link__icon {
	flex: 0 0 auto;
}
.trx-ad-compare-link__label {
	font-weight: 500;
}
.trx-ad-compare-link .trx-ad-compare-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.4em;
	height: 1.4em;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--trx-ad-color-primary, #1565c0);
	color: #fff;
	font-size: 0.78em;
	font-weight: 600;
	line-height: 1;
}
.trx-ad-compare-link[data-trx-ad-compare-link-hide-empty][data-empty="1"] {
	display: none;
}

.trx-ad-compare-bar__close {
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}
.trx-ad-compare-bar__close:hover {
	background: #fee2e2;
	color: #b91c1c;
}
.trx-ad-compare-bar .trx-ad-btn--primary {
	display: inline-flex;
	align-items: center;
	background: var(--trx-ad-color-primary);
	color: #ffffff;
	padding: 6px 14px;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.9em;
	font-weight: 500;
}
.trx-ad-compare-bar .trx-ad-btn--primary:hover {
	background: var(--trx-ad-color-primary-hover);
}

.trx-ad-compare-bar__cta {
	white-space: nowrap;
	flex: 0 0 auto;
}

/* The label/suffix split spans render inside an inline-flex button, which
   drops the whitespace text node between them ("Comparenow"). Restore the
   word gap without a literal space so the mobile display:none on the suffix
   never leaves a trailing gap. */
.trx-ad-compare-bar__cta-suffix {
	margin-inline-start: 0.3em;
}

/* Mobile compare-bar polish. The "now" suffix is the first thing to drop on
   narrow viewports (feedback #24: it wrapped to a new line and the button
   went almost round). Padding shrinks slightly so the bar still feels like a
   pill, not a rectangle, on phones. */
@media (max-width: 480px) {
	.trx-ad-compare-bar {
		gap: 10px;
		padding: 8px 12px;
		bottom: 16px;
		max-width: calc(100vw - 20px);
	}
	.trx-ad-compare-bar__cta {
		padding: 6px 12px;
		font-size: 0.85em;
	}
	.trx-ad-compare-bar__cta-suffix {
		display: none;
	}
	.trx-ad-compare-bar__count {
		font-size: 0.85em;
	}
}

