/* =================================================================
   Vehicle Products — Product listing with filters
   ================================================================= */

:root {
	--vp-cols-admin: 4;
	--vp-cols: var(--vp-cols-admin);
	--vp-card-bg: #fff;
	--vp-card-r: 10px;
	--vp-accent: #f5700a;
	--vp-page-bg: #f5f5f5;
	--vp-sidebar-w: 280px;
	--vp-gap: 16px;
	--vp-text: #333;
	--vp-muted: #888;
	--vp-border: #e5e5e5;
}

/* ── Page wrapper ── */
.vp-page {
	background: var(--vp-page-bg);
	min-height: 60vh;
	overflow-x: hidden;
	width: 100%;
	box-sizing: border-box;
}
.vp-page *, .vp-page *::before, .vp-page *::after {
	box-sizing: border-box;
}

/* ── Vehicle bar ── */
.vp-vehicle-bar {
	background: #1a1a1a;
	color: #fff;
	padding: 12px 0;
	font-size: 13px;
}
.vp-vehicle-bar__inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

/* Breadcrumb */
.vp-breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.vp-breadcrumb a {
	color: #aaa;
	text-decoration: none;
	transition: color .15s;
}
.vp-breadcrumb a:hover { color: var(--vp-accent); }
.vp-breadcrumb__sep { color: #555; }
.vp-breadcrumb strong { color: #fff; }

/* Bar actions */
.vp-vehicle-bar__actions {
	display: flex;
	gap: 12px;
	align-items: center;
}
.vp-vehicle-bar__back,
.vp-vehicle-bar__change {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #aaa;
	text-decoration: none;
	font-size: 12px;
	padding: 5px 10px;
	border-radius: 6px;
	border: 1px solid #333;
	transition: all .15s;
}
.vp-vehicle-bar__back:hover,
.vp-vehicle-bar__change:hover {
	color: #fff;
	border-color: var(--vp-accent);
	background: rgba(245,112,10,.1);
}

/* ── Layout ── */
.vp-layout {
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px 20px;
	display: grid;
	grid-template-columns: var(--vp-sidebar-w) 1fr;
	gap: 24px;
	align-items: start;
	min-width: 0;
	overflow: hidden;
}
.vp-layout--sidebar-right {
	grid-template-columns: 1fr var(--vp-sidebar-w);
}
.vp-layout--sidebar-right .vp-filters {
	order: 2;
}

/* ── Filters sidebar ── */
.vp-filters {
	background: #fff;
	border-radius: var(--vp-card-r);
	border: 1px solid var(--vp-border);
	position: sticky;
	top: 20px;
	overflow: hidden;
}
.vp-filters__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 16px 12px;
	border-bottom: 1px solid var(--vp-border);
}
.vp-filters__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--vp-text);
}
.vp-filters__close {
	display: none; /* shown on mobile */
	background: none;
	border: none;
	cursor: pointer;
	color: var(--vp-muted);
	padding: 4px;
}
.vp-filters__body {
	padding: 0;
	max-height: calc(100vh - 200px);
	overflow-y: auto;
}
.vp-filters__footer {
	padding: 12px 16px;
	border-top: 1px solid var(--vp-border);
}
.vp-filters__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	color: var(--vp-accent);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	padding: 0;
}
.vp-filters__reset:hover { text-decoration: underline; }

/* Filter groups */
.vp-filter-group {
	border-bottom: 1px solid var(--vp-border);
}
.vp-filter-group:last-child { border-bottom: none; }

.vp-filter-group__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 14px 16px;
	background: none;
	border: none;
	font-size: 13px;
	font-weight: 700;
	color: var(--vp-text);
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.vp-filter-group__toggle svg {
	transition: transform .2s;
}
.vp-filter-group__toggle[aria-expanded="false"] svg {
	transform: rotate(-90deg);
}
.vp-filter-group__toggle[aria-expanded="false"] + .vp-filter-group__content {
	display: none;
}
.vp-filter-group__content {
	padding: 0 16px 14px;
}

/* Search input */
.vp-filter-group__search-wrap {
	position: relative;
	padding: 12px 16px;
}
.vp-filter-group__search-input {
	width: 100%;
	padding: 10px 12px 10px 36px;
	border: 1px solid var(--vp-border);
	border-radius: 8px;
	font-size: 13px;
	outline: none;
	transition: border-color .15s;
	box-sizing: border-box;
}
.vp-filter-group__search-input:focus {
	border-color: var(--vp-accent);
}
.vp-filter-group__search-icon {
	position: absolute;
	left: 28px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--vp-muted);
	pointer-events: none;
}

/* Checkbox list */
.vp-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}
.vp-filter-item { margin-bottom: 2px; }
.vp-filter-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 13px;
	color: var(--vp-text);
}
.vp-filter-check input { display: none; }
.vp-filter-check__box {
	width: 18px;
	height: 18px;
	border: 2px solid #ccc;
	border-radius: 4px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all .15s;
}
.vp-filter-check input:checked + .vp-filter-check__box {
	background: var(--vp-accent);
	border-color: var(--vp-accent);
}
.vp-filter-check input:checked + .vp-filter-check__box::after {
	content: '';
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	margin-top: -2px;
}
.vp-filter-check__label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.vp-filter-check__count {
	color: var(--vp-muted);
	font-size: 12px;
}

/* Price slider */
.vp-price-slider__inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}
.vp-price-slider__input {
	width: 80px;
	padding: 6px 8px;
	border: 1px solid var(--vp-border);
	border-radius: 6px;
	font-size: 13px;
	text-align: center;
	outline: none;
}
.vp-price-slider__input:focus { border-color: var(--vp-accent); }
.vp-price-slider__sep { color: var(--vp-muted); }
.vp-price-slider__currency { color: var(--vp-muted); font-size: 13px; font-weight: 600; }

.vp-price-slider__track {
	position: relative;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	margin: 8px 0 4px;
}
.vp-price-slider__range {
	position: absolute;
	top: 0;
	height: 100%;
	background: var(--vp-accent);
	border-radius: 3px;
}
.vp-price-slider__thumb {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: -7px;
	width: 100%;
	height: 20px;
	background: transparent;
	pointer-events: none;
	margin: 0;
	padding: 0;
}
.vp-price-slider__thumb::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--vp-accent);
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.vp-price-slider__thumb::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--vp-accent);
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ── Toolbar ── */
.vp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.vp-toolbar__left {
	display: flex;
	align-items: center;
	gap: 12px;
}
.vp-toolbar__filter-btn {
	display: none; /* shown on mobile */
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid var(--vp-border);
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	color: var(--vp-text);
	position: relative;
}
.vp-toolbar__filter-count {
	background: var(--vp-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}
.vp-toolbar__count {
	font-size: 14px;
	color: var(--vp-text, #1e293b);
	font-weight: 600;
}
.vp-toolbar__count strong {
	color: var(--vp-accent, #f5700a);
	font-weight: 700;
}
.vp-toolbar__right {
	display: flex;
	align-items: center;
	gap: 8px;
}
.vp-toolbar__sort {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}
.vp-toolbar__sort-label {
	color: var(--vp-muted);
	font-weight: 500;
	white-space: nowrap;
}
.vp-toolbar__sort-select {
	padding: 6px 10px;
	border: 1px solid var(--vp-border);
	border-radius: 6px;
	font-size: 13px;
	outline: none;
	cursor: pointer;
	background: #fff;
	max-width: 180px;
}
.vp-toolbar__sort-select:focus {
	border-color: var(--vp-accent);
}

/* View toggle */
.vp-toolbar__view-toggle {
	display: flex;
	gap: 2px;
	background: #f0f0f0;
	border-radius: 6px;
	padding: 2px;
}
.vp-toolbar__view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 5px;
	background: transparent;
	color: var(--vp-muted);
	cursor: pointer;
	transition: all .15s;
}
.vp-toolbar__view-btn:hover { color: var(--vp-text); }
.vp-toolbar__view-btn--active {
	background: #fff;
	color: var(--vp-accent);
	box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Active tags ── */
.vp-active-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.vp-active-tags:empty { margin-bottom: 0; }
.vp-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fff;
	border: 1px solid var(--vp-border);
	border-radius: 20px;
	padding: 4px 8px 4px 12px;
	font-size: 12px;
	color: var(--vp-text);
}
.vp-tag button {
	background: none;
	border: none;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: var(--vp-muted);
	padding: 0 2px;
}
.vp-tag button:hover { color: var(--vp-accent); }

/* ── Product grid ── */
.vp-grid {
	display: grid;
	grid-template-columns: repeat( var(--vp-cols), minmax(0, 1fr) );
	gap: var(--vp-gap);
	transition: opacity .2s;
	min-height: 200px;
	min-width: 0;
	overflow: hidden;
}
.vp-grid--loading {
	opacity: .4;
	pointer-events: none;
}

/* ── List view ── */
.vp-grid--list {
	grid-template-columns: 1fr;
	gap: 12px;
}
.vp-grid--list .vp-card {
	flex-direction: row;
	align-items: stretch;
}
.vp-grid--list .vp-card__link {
	flex-direction: row;
	flex: 1;
	min-width: 0;
}
.vp-grid--list .vp-card__image-wrap {
	padding-top: 0;
	width: 140px;
	min-width: 140px;
	height: auto;
	aspect-ratio: 1;
	border-right: 1px solid var(--vp-border);
}
.vp-grid--list .vp-card__body {
	padding: 14px 20px;
	justify-content: center;
	flex: 1;
	min-width: 0;
	gap: 4px;
}
.vp-grid--list .vp-card__title {
	font-size: 15px;
	-webkit-line-clamp: 1;
}
.vp-grid--list .vp-card__brand { font-size: 12px; }
.vp-grid--list .vp-card__price { font-size: 18px; }
.vp-grid--list .vp-card__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 14px 20px;
	min-width: 150px;
	border-left: 1px solid var(--vp-border);
	gap: 8px;
}
.vp-grid--list .vp-card__atc {
	width: auto;
	padding: 10px 24px;
	white-space: nowrap;
}

/* ── Product card ── */
.vp-card {
	background: var(--vp-card-bg);
	border-radius: var(--vp-card-r);
	border: 1px solid var(--vp-border);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s, transform .2s;
	min-width: 0;
	max-width: 100%;
}
.vp-card:hover {
	box-shadow: 0 8px 24px rgba(0,0,0,.08);
	transform: translateY(-2px);
}
.vp-grid--list .vp-card {
	border-left: 3px solid transparent;
	transition: box-shadow .2s, border-color .2s;
}
.vp-grid--list .vp-card:hover {
	transform: none;
	border-left-color: var(--vp-accent);
}
.vp-card__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	text-decoration: none;
	color: inherit;
}
.vp-card__image-wrap {
	position: relative;
	padding-top: 100%;
	background: #f9f9f9;
	overflow: hidden;
}
.vp-card__img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
}

/* Badges */
.vp-card__badges {
	position: absolute;
	top: 8px;
	left: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	z-index: 1;
}
.vp-card__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: .3px;
	white-space: nowrap;
	max-width: calc(100% - 16px);
	overflow: hidden;
	text-overflow: ellipsis;
}
.vp-card__badge--instock {
	background: var(--vp-badge-in-bg, #e8f5e9);
	color: var(--vp-badge-in-text, #2e7d32);
}
.vp-card__badge--outofstock {
	background: var(--vp-badge-out-bg, #fbe9e7);
	color: var(--vp-badge-out-text, #c62828);
}
.vp-card__badge--compat {
	background: #e3f2fd;
	color: #1565c0;
}

/* Card body */
.vp-card__body {
	padding: 14px 14px 6px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	overflow: hidden;
}
.vp-card__brand {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--vp-accent);
	letter-spacing: .5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.vp-card__brand-logo {
	width: 16px;
	height: 16px;
	object-fit: contain;
	border-radius: 3px;
	flex-shrink: 0;
}
.vp-card__title {
	font-size: 13px;
	font-weight: 600;
	color: var(--vp-text);
	margin: 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.vp-card:hover .vp-card__title { color: var(--vp-accent); }

/* Rating */
.vp-card__rating {
	display: flex;
	align-items: center;
	gap: 2px;
	font-size: 12px;
}
.vp-star { color: #e0e0e0; }
.vp-star--full { color: #f5a623; }
.vp-star--half {
	color: #f5a623;
	opacity: .6;
}
.vp-card__rating-count {
	color: var(--vp-muted);
	font-size: 11px;
	margin-left: 4px;
}

/* Price */
.vp-card__price {
	font-size: 16px;
	font-weight: 800;
	color: var(--vp-text);
	margin-top: 4px;
}
.vp-card__price del {
	color: var(--vp-muted);
	font-size: 13px;
	font-weight: 500;
}
.vp-card__price ins {
	text-decoration: none;
	color: var(--vp-accent);
}

/* Actions */
.vp-card__actions {
	padding: 0 14px 14px;
}
.vp-card__atc {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 10px;
	border: none;
	border-radius: 8px;
	background: var(--vp-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s;
}
.vp-card__atc:hover {
	background: var(--vp-accent-hover, #e06500);
	transform: scale(1.02);
}
.vp-card__atc--view {
	background: transparent;
	color: var(--vp-accent);
	border: 2px solid var(--vp-accent);
	text-decoration: none;
}
.vp-card__atc--view:hover {
	background: var(--vp-accent);
	color: #fff;
}
.vp-card__atc--loading {
	pointer-events: none;
	opacity: .6;
}
.vp-card__atc--added {
	background: #2e7d32;
}

/* ── Empty state ── */
.vp-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--vp-muted);
}
.vp-empty svg { margin-bottom: 16px; opacity: .4; }
.vp-empty p { font-size: 15px; margin: 0 0 16px; }
.vp-empty__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: 2px solid var(--vp-accent);
	border-radius: 8px;
	background: transparent;
	color: var(--vp-accent);
	font-weight: 700;
	cursor: pointer;
	transition: all .15s;
}
.vp-empty__reset:hover {
	background: var(--vp-accent);
	color: #fff;
}

/* ── Pagination ── */
.vp-pagination {
	margin-top: 24px;
	display: flex;
	justify-content: center;
}
.vp-pagination ul {
	list-style: none;
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
}
.vp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--vp-text);
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--vp-border);
	transition: all .15s;
}
.vp-pagination .page-numbers:hover {
	border-color: var(--vp-accent);
	color: var(--vp-accent);
}
.vp-pagination .page-numbers.current {
	background: var(--vp-accent);
	border-color: var(--vp-accent);
	color: #fff;
}
.vp-pagination__load-more {
	padding: 12px 32px;
	border: 2px solid var(--vp-accent);
	border-radius: 8px;
	background: transparent;
	color: var(--vp-accent);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s;
}
.vp-pagination__load-more:hover {
	background: var(--vp-accent);
	color: #fff;
}

/* ── Mobile overlay ── */
.vp-filter-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,.5);
	z-index: 999;
	opacity: 0;
	transition: opacity .2s;
}
.vp-filter-overlay--visible {
	display: block;
	opacity: 1;
}

/* ══════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════ */

@media (max-width: 1100px) {
	.vp-page { --vp-cols: 3; }
}

@media (max-width: 900px) {
	.vp-page { --vp-cols: 2; }

	/* Sidebar becomes drawer */
	.vp-layout {
		grid-template-columns: 1fr;
		padding: 16px 14px;
	}
	.vp-filters {
		position: fixed;
		top: 0;
		left: -320px;
		width: 300px;
		height: 100vh;
		z-index: 1000;
		border-radius: 0;
		border: none;
		transition: left .3s ease;
		overflow-y: auto;
	}
	.vp-filters--open {
		left: 0;
		box-shadow: 4px 0 20px rgba(0,0,0,.15);
	}
	.vp-filters__close { display: flex; }
	.vp-toolbar__filter-btn { display: inline-flex; }

	.vp-layout--sidebar-right .vp-filters { order: 0; }
}

@media (max-width: 600px) {
	.vp-page { --vp-cols: 1; }
	.vp-layout { padding: 12px 10px; gap: 12px; }
	.vp-grid { gap: 10px; }
	.vp-vehicle-bar__inner { flex-direction: column; align-items: flex-start; padding: 0 12px; }
	.vp-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
	.vp-toolbar__left,
	.vp-toolbar__right { width: 100%; justify-content: space-between; }
	.vp-toolbar__view-toggle { display: none; }

	/* ── Mobile card: image left + (info + button) right ── */
	.vp-card {
		flex-direction: row;
		align-items: stretch;
		padding: 0;
	}
	.vp-card:hover { transform: none; }
	.vp-card__link {
		flex-direction: row;
		flex: 1;
		min-width: 0;
	}

	/* Image: fixed square on the left */
	.vp-card__image-wrap {
		padding-top: 0;
		width: 110px;
		min-width: 110px;
		height: auto;
		aspect-ratio: 1;
		border-right: 1px solid var(--vp-border);
	}
	.vp-card__img { padding: 8px; }

	/* Badges: horizontal row inside image, smaller */
	.vp-card__badges {
		top: 4px;
		left: 4px;
		right: 4px;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 3px;
	}
	.vp-card__badge {
		font-size: 7px;
		padding: 2px 4px;
		letter-spacing: 0;
		gap: 2px;
	}
	.vp-card__badge svg { width: 8px; height: 8px; }

	/* Body: stacked info */
	.vp-card__body {
		padding: 10px 12px;
		justify-content: center;
		flex: 1;
		min-width: 0;
		gap: 3px;
	}
	.vp-card__brand { font-size: 10px; letter-spacing: .3px; }
	.vp-card__title { font-size: 13px; font-weight: 600; -webkit-line-clamp: 2; }
	.vp-card__price { font-size: 16px; font-weight: 800; margin-top: 2px; }
	.vp-card__rating { font-size: 10px; }

	/* Actions: button below the card as full-width strip */
	.vp-card__actions {
		position: absolute;
		bottom: 0;
		right: 0;
		padding: 0;
		display: flex;
		align-items: stretch;
	}
	.vp-card {
		position: relative;
	}
	.vp-card__atc {
		font-size: 0;
		width: 42px;
		height: 42px;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 8px 0 8px 0;
	}
	.vp-card__atc svg { width: 18px; height: 18px; }
	.vp-card__atc span { display: none; }
	.vp-card__atc--view { font-size: 11px; width: auto; padding: 8px 12px; border-radius: 6px; margin: 8px 10px; }
	.vp-card__atc--view span,
	.vp-card__atc--view { font-size: 11px; }

	/* List view same treatment */
	.vp-grid--list .vp-card__image-wrap { width: 110px; min-width: 110px; }
	.vp-grid--list .vp-card__actions { border-left: none; min-width: 0; }
}
