/* Autotrader Vehicles - Frontend Styles */

.autotrader-integration-pro-wrapper {
	--at-primary: #0066cc;
	--at-primary-hover: #0052a3;
	--at-btn-text: #ffffff;
	--at-price: #0066cc;
	--at-heading: #1a1a2e;

	max-width: 1400px;
	margin: 0 auto;
	padding: 30px 20px;
	color: var(--at-heading);
	line-height: 1.6;
	overflow-x: hidden;
	box-sizing: border-box;
}

.autotrader-integration-pro-container {
	width: 100%;
}

/* Breadcrumbs */
.autotrader-breadcrumbs {
	font-size: 0.875rem;
	color: #6c757d;
	margin-bottom: 20px;
}

.autotrader-breadcrumbs a {
	color: var(--at-primary);
	text-decoration: none;
}

.autotrader-breadcrumbs a:hover {
	text-decoration: underline;
}

.autotrader-breadcrumb-sep {
	margin: 0 6px;
	color: #adb5bd;
}

/* Header */
.autotrader-integration-pro-header {
	margin-bottom: 30px;
}

.autotrader-integration-pro-title {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--at-heading);
}

.autotrader-integration-pro-count {
	color: #6c757d;
	margin: 0;
	font-size: 0.95rem;
}

/* Filters */
.autotrader-filters {
	margin-bottom: 30px;
	padding: 20px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e9ecef;
}

.autotrader-filters-make-model-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	align-items: flex-end;
	margin-bottom: 16px;
}

.autotrader-filters-form {
	margin: 0;
	padding: 0;
}

.autotrader-filters-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	align-items: flex-end;
}

.autotrader-filters-row + .autotrader-filters-row {
	margin-top: 16px;
}

.autotrader-filters-row-top {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 16px;
	align-items: end;
}

.autotrader-filters-row-ranges {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	align-items: end;
}

.autotrader-filters-row-actions {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	justify-content: space-between;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e9ecef;
}

.autotrader-filter-group {
	flex: 1;
	min-width: 0;
}

.autotrader-filter-group label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #495057;
	margin-bottom: 6px;
}

.autotrader-filter-group select,
.autotrader-filter-group input[type="number"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ced4da;
	border-radius: 6px;
	font-size: 0.95rem;
	background: #fff;
	cursor: pointer;
	appearance: auto;
	box-sizing: border-box;
}

.autotrader-filter-group input[type="number"] {
	cursor: text;
	-moz-appearance: textfield;
}

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

.autotrader-filter-group select:focus,
.autotrader-filter-group input[type="number"]:focus {
	outline: none;
	border-color: var(--at-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--at-primary) 10%, transparent);
}

.autotrader-range-inputs {
	display: flex;
	align-items: center;
	gap: 6px;
}

.autotrader-range-inputs input {
	flex: 1;
	min-width: 0;
}

.autotrader-range-sep {
	color: #6c757d;
	font-weight: 600;
	flex-shrink: 0;
}

.autotrader-filter-buttons {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-shrink: 0;
}

.autotrader-btn-apply,
.autotrader-btn-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0;
	padding: 10px 24px;
	font-size: 0.95rem;
	font-family: inherit;
	line-height: 1.4;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	text-align: center;
	text-decoration: none;
	min-width: 150px;
	height: 42px;
	box-sizing: border-box;
	border-radius: 6px;
}

.autotrader-btn-clear {
	background: #e9ecef;
	color: #495057;
}

.autotrader-btn-clear:hover {
	background: #dee2e6;
	color: #212529;
}

.autotrader-btn-disabled {
	opacity: 0.5;
	pointer-events: none;
}

.autotrader-filter-sort {
	max-width: 260px;
}

/* Vehicle Grid */
.autotrader-integration-pro-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* Vehicle Card */
.autotrader-vehicle-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	display: flex;
	flex-direction: column;
}

.autotrader-vehicle-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
	transform: translateY(-2px);
}

.autotrader-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

/* ── Card Image Slider ── */

.at-card-slider {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f0f0f0;
}

.at-card-slider-track {
	position: relative;
	width: 100%;
	height: 100%;
}

.at-card-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.at-card-slide--active {
	opacity: 1;
	pointer-events: auto;
}

.at-card-slide > .autotrader-card-link {
	height: 100%;
}

/* Grey panel behind image — avoids black decoder flash before CDN pixels arrive */
.at-card-slide-media {
	display: block;
	width: 100%;
	height: 100%;
	background-color: #e8eaed;
	position: relative;
	overflow: hidden;
}

.at-card-slide-media img.at-card-slide-img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 0;
	transition: opacity 0.22s ease;
}

.at-card-slide-media img.at-card-slide-img.at-card-slide-img--visible {
	opacity: 1;
}

.at-card-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1a1a2e;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease, background 0.15s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	padding: 0;
}

.autotrader-vehicle-card:hover .at-card-arrow {
	opacity: 1;
}

.at-card-arrow:hover,
.at-card-arrow:focus,
.at-card-arrow:active {
	background: rgba(255, 255, 255, 0.98);
	color: #1a1a2e;
}

.at-card-arrow:hover svg,
.at-card-arrow:focus svg,
.at-card-arrow:active svg {
	stroke: #1a1a2e;
}

.at-card-arrow:focus {
	outline: none;
}

.at-card-arrow--prev { left: 8px; }
.at-card-arrow--next { right: 8px; }

.at-card-dots {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	display: flex;
	gap: 5px;
}

.at-card-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: background 0.15s ease;
	border: none;
	padding: 0;
}

.at-card-dot--active {
	background: #fff;
}

.at-card-image-counter {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 3;
	background: rgba(26, 26, 46, 0.7);
	color: #fff;
	font-size: 0.75rem;
	padding: 3px 10px;
	border-radius: 20px;
	line-height: 1.4;
}

.at-card-no-image {
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e9ecef;
	color: #6c757d;
}

/* ── Card Body ── */

.at-card-body-link {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.at-card-body {
	padding: 14px 18px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.at-card-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 2px;
	color: var(--at-heading);
	line-height: 1.25;
}

.at-card-subtitle {
	font-size: 0.85rem;
	color: #6c757d;
	margin: 0 0 6px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.at-card-attention {
	font-size: 0.82rem;
	color: #495057;
	margin: 0 0 10px;
	line-height: 1.4;
}

.at-card-key-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.at-card-spec-pill {
	font-size: 0.78rem;
	font-weight: 600;
	color: #1a1a2e;
	background: #f0f2f5;
	padding: 4px 12px;
	border-radius: 20px;
	white-space: nowrap;
}

.at-card-price-row {
	margin-top: auto;
	padding-top: 10px;
}

.at-card-price {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--at-heading);
	display: block;
}

.at-card-location {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 0.8rem;
	color: #6c757d;
}

.at-card-location svg {
	flex-shrink: 0;
}

/* No Vehicles */
.autotrader-no-vehicles {
	text-align: center;
	padding: 60px 20px;
	color: #6c757d;
}

.autotrader-btn {
	display: inline-block;
	padding: 12px 28px;
	background: var(--at-primary);
	color: var(--at-btn-text);
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	margin-top: 16px;
	transition: background 0.2s ease;
}

.autotrader-btn:hover {
	background: var(--at-primary-hover);
	color: var(--at-btn-text);
}

/* Pagination */
.autotrader-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 40px;
	padding: 20px 0;
	flex-wrap: wrap;
}

.autotrader-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	text-decoration: none;
	color: var(--at-primary);
	font-size: 0.95rem;
	background: #fff;
	transition: all 0.15s ease;
}

.autotrader-page-link:hover {
	background: #f0f2f5;
	border-color: var(--at-primary);
}

.autotrader-page-current {
	background: var(--at-primary);
	color: var(--at-btn-text);
	border-color: var(--at-primary);
	font-weight: 600;
}

.autotrader-page-dots {
	padding: 0 4px;
	color: #6c757d;
}

/* Single Vehicle */
.autotrader-single-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 40px;
	align-items: start;
	max-width: 100%;
	overflow: hidden;
}

.autotrader-single-main {
	min-width: 0;
	overflow: hidden;
}

.autotrader-single-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 16px;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Price Block */
.autotrader-single-price-block {
	margin-bottom: 24px;
	padding: 20px;
	background: var(--at-price-bg, #f0f7ff);
	border-radius: 8px;
	border: 1px solid var(--at-price-bg-border, #c5ddf5);
}

.autotrader-single-price {
	font-size: 2rem;
	font-weight: 700;
	color: var(--at-price);
	display: block;
}

.autotrader-single-was-price {
	font-size: 1rem;
	color: #dc3545;
	text-decoration: line-through;
	margin-right: 12px;
}

.autotrader-single-saving {
	font-size: 0.95rem;
	color: #28a745;
	font-weight: 600;
}

.autotrader-single-monthly {
	display: block;
	font-size: 0.95rem;
	color: #6c757d;
	margin-top: 6px;
}

.autotrader-price-indicator {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	margin-top: 8px;
	background: #e9ecef;
	color: #495057;
}

/* Highlights */
.autotrader-single-highlights {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
	margin-bottom: 30px;
}

.autotrader-highlight-item {
	padding: 12px 16px;
	background: #f8f9fa;
	border-radius: 8px;
	text-align: center;
}

.autotrader-highlight-label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6c757d;
	margin-bottom: 4px;
}

.autotrader-highlight-value {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: var(--at-heading);
}

/* Description */
.autotrader-single-description {
	margin-bottom: 30px;
}

.autotrader-single-description h2 {
	font-size: 1.25rem;
	margin: 0 0 12px;
}

.autotrader-description-content {
	color: #495057;
}

/* Specifications */
.autotrader-specifications {
	margin-bottom: 30px;
}

.autotrader-specifications h2 {
	font-size: 1.1rem;
	margin: 0 0 12px;
}

.autotrader-specs-table {
	width: 100%;
	border-collapse: collapse;
}

.autotrader-specs-table tr:nth-child(even) {
	background: #f8f9fa;
}

.autotrader-specs-table th,
.autotrader-specs-table td {
	padding: 8px 12px;
	text-align: left;
	border-bottom: 1px solid #e9ecef;
	font-size: 0.85rem;
}

.autotrader-specs-table th {
	font-weight: 600;
	color: #495057;
	width: 40%;
}

.autotrader-specs-table td {
	color: var(--at-heading);
}

/* Gallery */
.autotrader-gallery {
	margin-bottom: 30px;
}

.autotrader-gallery-main {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #f0f0f0;
	aspect-ratio: 3 / 2;
}

.autotrader-gallery-main img#autotrader-gallery-hero {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.autotrader-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1a1a2e;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	padding: 0;
	transition: opacity 0.2s ease, background 0.15s ease;
}

.autotrader-gallery-arrow:hover,
.autotrader-gallery-arrow:focus,
.autotrader-gallery-arrow:active {
	background: rgba(255, 255, 255, 0.98);
	color: #1a1a2e;
}

.autotrader-gallery-arrow:hover svg,
.autotrader-gallery-arrow:focus svg,
.autotrader-gallery-arrow:active svg {
	stroke: #1a1a2e;
}

.autotrader-gallery-arrow:focus {
	outline: none;
}

.autotrader-gallery-arrow--prev { left: 12px; }
.autotrader-gallery-arrow--next { right: 12px; }

.autotrader-gallery-counter {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 0.85rem;
}

.autotrader-gallery-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	overflow-x: auto;
	padding-bottom: 8px;
	scrollbar-width: thin;
}

.autotrader-gallery-thumb {
	flex-shrink: 0;
	width: 80px;
	height: 56px;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	background: none;
	transition: border-color 0.15s ease;
}

.autotrader-gallery-thumb:hover,
.autotrader-gallery-thumb--active {
	border-color: var(--at-primary);
}

.autotrader-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.autotrader-gallery-placeholder {
	padding: 60px 20px;
	text-align: center;
	background: #f8f9fa;
	border-radius: 12px;
	margin-bottom: 30px;
	color: #6c757d;
}

/* Sidebar */
.autotrader-single-sidebar {
	position: sticky;
	top: 100px;
}

.autotrader-sidebar-card {
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.autotrader-sidebar-card h3 {
	font-size: 1.1rem;
	margin: 0 0 16px;
}

.autotrader-sidebar-price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--at-price);
	margin: 0 0 8px;
}

.autotrader-sidebar-title {
	color: #495057;
	margin: 0 0 20px;
	font-size: 0.95rem;
}

.autotrader-dealer-info {
	padding-top: 16px;
	border-top: 1px solid #e9ecef;
}

.autotrader-dealer-phone,
.autotrader-dealer-email {
	margin: 8px 0 0;
	font-size: 0.9rem;
}

.autotrader-dealer-phone a,
.autotrader-dealer-email a {
	color: var(--at-primary);
	text-decoration: none;
	font-weight: 600;
}

.autotrader-dealer-phone a:hover,
.autotrader-dealer-email a:hover {
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
	.autotrader-single-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.autotrader-single-sidebar {
		position: static;
	}

	.autotrader-gallery-thumbs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		flex-wrap: nowrap;
	}

	.autotrader-gallery-thumb {
		flex-shrink: 0;
	}

	.autotrader-description-content {
		overflow-wrap: break-word;
		word-break: break-word;
	}
}

@media (max-width: 768px) {
	.autotrader-integration-pro-grid {
		grid-template-columns: 1fr;
	}

	.autotrader-integration-pro-title {
		font-size: 1.5rem;
	}

	.autotrader-filters-make-model-row,
	.autotrader-filters-row,
	.autotrader-filters-row-top,
	.autotrader-filters-row-ranges {
		display: flex;
		flex-direction: column;
	}

	.autotrader-filter-group {
		min-width: 100%;
	}

	.autotrader-filters-row-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.autotrader-filter-sort {
		max-width: none;
	}

	.autotrader-filter-buttons {
		flex-direction: column;
	}

	.autotrader-btn-apply,
	.autotrader-btn-clear {
		width: 100%;
		text-align: center;
	}

	.autotrader-single-title {
		font-size: 1.35rem;
	}

	.autotrader-single-price {
		font-size: 1.5rem;
	}

	.autotrader-single-highlights {
		grid-template-columns: repeat(2, 1fr);
	}

	.autotrader-gallery-thumb {
		width: 60px;
		height: 42px;
	}

	.at-card-arrow {
		opacity: 1;
	}

	.autotrader-specifications {
		overflow-x: auto;
	}

	.autotrader-single-price-block {
		word-wrap: break-word;
	}

	.autotrader-gallery-main {
		aspect-ratio: 4 / 3;
	}

	.autotrader-breadcrumbs {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

@media (max-width: 480px) {
	.autotrader-integration-pro-wrapper {
		padding: 15px 12px;
	}

	.autotrader-single-highlights {
		grid-template-columns: 1fr 1fr;
	}
}
