/* DealerBase Vehicles — inherits your theme's fonts. Override the variables below in your theme. */
.dbv {
	--dbv-accent: #1f4e79;
	--dbv-accent-text: #fff;
	--dbv-ink: inherit;
	--dbv-muted: #5f6670;
	--dbv-line: #dfe3e8;
	--dbv-surface: #f6f7f9;
	--dbv-sale: #b42318;
	--dbv-radius: 6px;
	color: var(--dbv-ink);
}
.dbv *, .dbv *::before, .dbv *::after { box-sizing: border-box; }

/* Search */
.dbv-search {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px 16px;
	padding: 16px;
	margin: 0 0 24px;
	background: var(--dbv-surface);
	border-radius: var(--dbv-radius);
}
.dbv-field { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; margin: 0; }
.dbv-field span { color: var(--dbv-muted); }
.dbv-field input, .dbv-field select {
	width: 100%; min-height: 40px; padding: 6px 10px;
	border: 1px solid var(--dbv-line); border-radius: 4px; background: #fff; font: inherit;
}
.dbv-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dbv-btn {
	min-height: 42px; padding: 0 22px; border: 0; border-radius: 4px; cursor: pointer;
	background: var(--dbv-accent); color: var(--dbv-accent-text); font: inherit; font-weight: 600;
}
.dbv-btn:hover { filter: brightness(1.1); }
.dbv-reset { color: var(--dbv-muted); font-size: .875rem; }
.dbv :focus-visible { outline: 2px solid var(--dbv-accent); outline-offset: 2px; }

/* Grid */
.dbv-count { color: var(--dbv-muted); margin: 0 0 12px; }
.dbv-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px;
}
.dbv-card { margin: 0; border-bottom: 1px solid var(--dbv-line); }
.dbv-card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.dbv-card__media {
	position: relative; aspect-ratio: 4 / 3; overflow: hidden;
	background: var(--dbv-surface); border-radius: var(--dbv-radius);
}
.dbv-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.dbv-card__link:hover .dbv-card__media img { transform: scale(1.03); }
.dbv-card__noimg {
	display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px;
	color: var(--dbv-muted); font-size: .875rem; background: var(--dbv-surface); border-radius: var(--dbv-radius);
}
.dbv-badge {
	position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 3px;
	background: var(--dbv-sale); color: #fff; font-size: .8rem; font-weight: 600;
}
.dbv-card__body { padding: 12px 0 16px; }
.dbv-card__title { font-size: 1.05rem; line-height: 1.3; margin: 0 0 4px; }
.dbv-card__meta { color: var(--dbv-muted); font-size: .875rem; margin: 0 0 8px; }
.dbv-card__price { margin: 0; }

.dbv-price { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dbv-price--poa { font-size: 1rem; font-weight: 600; }
.dbv-price-was { color: var(--dbv-muted); font-size: .9rem; margin-left: 6px; }
.dbv-card--special .dbv-price { color: var(--dbv-sale); }

/* Pagination */
.dbv-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; }
.dbv-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--dbv-line); border-radius: 4px; text-decoration: none; color: inherit;
}
.dbv-pagination .current { background: var(--dbv-accent); border-color: var(--dbv-accent); color: var(--dbv-accent-text); }

@media (prefers-reduced-motion: reduce) {
	.dbv-card__media img { transition: none; }
	.dbv-card__link:hover .dbv-card__media img { transform: none; }
}

/* 1.2: admin-only save box on the vehicle page */
.dbv-admin-save { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; padding: 12px 16px; border: 1px dashed var(--dbv-line); border-radius: var(--dbv-radius); font-size: .9rem; }
.dbv-admin-save span { color: var(--dbv-muted); }

/* ==================================================================
   1.3: listing-style single page
   ================================================================== */
.dbv-l { --dbv-l-gap: 40px; --dbv-l-aside: 340px; margin: 0 auto; }
.dbv-l__back { margin: 0 0 16px; font-size: .9rem; }
.dbv-l__back a { color: var(--dbv-muted); text-decoration: none; }
.dbv-l__back a:hover { color: inherit; text-decoration: underline; }

.dbv-l__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--dbv-l-aside);
	grid-template-areas: "gallery aside" "head aside" "body aside";
	grid-template-rows: auto auto 1fr;
	gap: 20px var(--dbv-l-gap);
	align-items: start;
}
.dbv-l__gallery { grid-area: gallery; min-width: 0; }
.dbv-l__head { grid-area: head; }
.dbv-l__aside { grid-area: aside; position: sticky; top: calc(24px + var(--wp-admin--admin-bar--height, 0px)); }
.dbv-l__body { grid-area: body; min-width: 0; }

/* Gallery */
.dbv-g__stage { position: relative; aspect-ratio: 4 / 3; background: #16191d; border-radius: var(--dbv-radius); overflow: hidden; }
.dbv-g__open { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.dbv-g__stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dbv-g__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255,255,255,.92); color: #16191d; font-size: 30px; line-height: 1;
	display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.dbv-g__nav--prev { left: 12px; }
.dbv-g__nav--next { right: 12px; }
.dbv-g__nav:hover { background: #fff; }
.dbv-g__count, .dbv-g__expand {
	position: absolute; bottom: 12px; padding: 4px 10px; border-radius: 4px;
	background: rgba(0,0,0,.65); color: #fff; font-size: .8rem; border: 0;
}
.dbv-g__count { left: 12px; }
.dbv-g__expand { right: 12px; cursor: pointer; font: inherit; font-size: .8rem; }
.dbv-g__thumbs { list-style: none; display: flex; gap: 8px; margin: 10px 0 0; padding: 0 0 6px; overflow-x: auto; scrollbar-width: thin; }
.dbv-g__thumbs li { flex: 0 0 auto; margin: 0; }
.dbv-g__thumb { display: block; width: 76px; height: 57px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: none; cursor: pointer; opacity: .75; }
.dbv-g__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dbv-g__thumb.is-active, .dbv-g__thumb:hover { border-color: var(--dbv-accent); opacity: 1; }
.dbv-g__empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: var(--dbv-surface); border-radius: var(--dbv-radius); color: var(--dbv-muted); }

/* Lightbox */
.dbv-lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0b0d10; }
.dbv-lightbox::backdrop { background: #0b0d10; }
.dbv-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.dbv-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dbv-lightbox__close { position: absolute; top: 12px; right: 16px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.dbv-lightbox .dbv-g__count { bottom: 16px; left: 50%; transform: translateX(-50%); }

/* Title */
.dbv-l__meta { margin: 0 0 6px; color: var(--dbv-muted); font-size: .875rem; }
.dbv-l__title { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.2; }
.dbv-l__sub { margin: 6px 0 0; font-size: 1.05rem; color: var(--dbv-muted); }

/* Price card */
.dbv-card-price { padding: 20px; border: 1px solid var(--dbv-line); border-radius: var(--dbv-radius); background: #fff; color: #1d2228; }
.dbv-card-price p { margin: 0; }
.dbv-card-price__label { font-size: .875rem; color: var(--dbv-muted); }
.dbv-card-price__amount { font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dbv-card-price__amount--poa { font-size: 1.35rem; }
.dbv-card-price__was { margin-top: 2px !important; color: var(--dbv-muted); text-decoration: line-through; }
.dbv-card-price__note { margin-top: 6px !important; font-size: .85rem; color: var(--dbv-muted); }
.dbv-card-price__dealer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--dbv-line); display: grid; gap: 10px; }
.dbv-card-price__name { font-weight: 600; }
.dbv-btn--block { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }
.dbv-btn--ghost { background: transparent; color: var(--dbv-accent); box-shadow: inset 0 0 0 2px var(--dbv-accent); }
a.dbv-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Highlights and attributes */
.dbv-l__highlights { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 4px 0 20px; padding: 16px 0; border-top: 1px solid var(--dbv-line); border-bottom: 1px solid var(--dbv-line); }
.dbv-l__highlights li { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 1.05rem; }
.dbv-ico { color: var(--dbv-accent); flex: none; }
.dbv-l__attrs { margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; }
.dbv-l__attrs > div { display: flex; gap: 8px; padding: 7px 0; }
.dbv-l__attrs dt { margin: 0; font-weight: 600; flex: none; }
.dbv-l__attrs dd { margin: 0; }

/* Sections */
.dbv-l__section { margin-top: 32px; }
.dbv-l__section h2 { margin: 0 0 12px; font-size: 1.3rem; }
.dbv-l__desc { max-width: 72ch; }
.dbv-l__desc p { margin: 0 0 1em; }
.dbv-l__features { columns: 2 220px; column-gap: 32px; padding-left: 1.2em; margin: 0; }
.dbv-l__features li { break-inside: avoid; margin-bottom: 4px; }
.dbv-l__specs { border-top: 1px solid var(--dbv-line); padding-top: 16px; }
.dbv-l__specs summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.dbv-l__specs summary::-webkit-details-marker { display: none; }
.dbv-l__specs summary::after { content: "+"; font-size: 1.5rem; color: var(--dbv-muted); }
.dbv-l__specs[open] summary::after { content: "\2212"; }
.dbv-l__specs summary h2 { margin: 0; }
.dbv-l__specs .dbv-spec-groups { margin-top: 16px; }
.dbv-spec-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 40px; }
.dbv-spec-group h3 { margin: 0 0 8px; font-size: 1rem; }
.dbv-specs { margin: 0; border-top: 1px solid var(--dbv-line); }
.dbv-specs > div { display: grid; grid-template-columns: 10em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--dbv-line); }
.dbv-specs dt { color: var(--dbv-muted); margin: 0; }
.dbv-specs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dbv-l__ref { margin-top: 32px; color: var(--dbv-muted); font-size: .85rem; }

/* Mobile action bar */
.dbv-l__bar { display: none; }

@media (max-width: 900px) {
	.dbv-l__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "head" "aside" "body"; grid-template-rows: none; }
	.dbv-l__aside { position: static; }
	.dbv-l { padding-bottom: 72px; }
	.dbv-l__bar {
		display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; color: #1d2228;
		box-shadow: 0 -2px 10px rgba(0,0,0,.12);
	}
	.dbv-l__bar-price { font-weight: 700; font-size: 1.1rem; margin-right: auto; }
	.dbv-l__bar .dbv-btn { min-height: 40px; padding: 0 16px; }
}
@media (max-width: 600px) {
	.dbv-g__stage { border-radius: 0; margin: 0 calc(50% - 50vw); width: 100vw; }
	.dbv-g__nav { width: 36px; height: 36px; font-size: 24px; }
	.dbv-specs > div { grid-template-columns: 8em 1fr; }
}
