/* Vehicle inventory — listing & detail.
   Self-contained and scoped under .vwe-occasions so it renders consistently
   inside any theme without depending on the theme's own styles. */

.vwe-occasions {
	--vwe-accent: #2563eb;
	--vwe-accent-2: #1d4ed8;
	--vwe-ink: #1a1a1a;
	--vwe-muted: #6b7280;
	--vwe-line: #e5e7eb;
	--vwe-bg: #f7f8fa;
	--vwe-panel: #f8fafc;
}
.vwe-occasions * { box-sizing: border-box; }
.vwe-container { max-width: 1200px; margin: 0 auto; padding: 32px 20px 64px; font-family: inherit; color: var(--vwe-ink); }

.vwe-head h1 { font-size: 2rem; margin: 0 0 4px; color: var(--vwe-ink); }
.vwe-count { color: var(--vwe-muted); margin: 0 0 24px; }

/* Voertuigsoort switch (optional, above the filters) */
.vwe-soorten { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.vwe-soorten a { padding: 8px 16px; border: 1px solid var(--vwe-line); border-radius: 999px; background: #fff; color: var(--vwe-ink); font-weight: 600; font-size: .9rem; text-decoration: none; line-height: 1.2; transition: border-color .15s, color .15s; }
.vwe-soorten a:hover { border-color: var(--vwe-accent); color: var(--vwe-accent); }
.vwe-soorten a[aria-current="page"] { background: var(--vwe-accent); border-color: var(--vwe-accent); color: #fff; }

/* Filters */
.vwe-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--vwe-bg); border: 1px solid var(--vwe-line); border-radius: 12px; padding: 16px; margin-bottom: 28px; }
.vwe-filters label { display: flex; flex-direction: column; font-size: .78rem; font-weight: 600; color: var(--vwe-muted); gap: 5px; }
.vwe-filters select, .vwe-filters input { font-size: .95rem; padding: 9px 10px; border: 1px solid #cfd4da; border-radius: 8px; background: #fff; min-width: 150px; color: var(--vwe-ink); }
.vwe-filters input[type="number"] { width: 150px; box-sizing: border-box; -moz-appearance: textfield; appearance: textfield; }
.vwe-filters input[type="number"]::-webkit-inner-spin-button, .vwe-filters input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.vwe-reset { align-self: center; color: var(--vwe-muted); font-size: .85rem; }

/* Buttons */
.vwe-btn { background: var(--vwe-accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 20px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2; }
.vwe-btn:hover { background: var(--vwe-accent-2); color: #fff; }
.vwe-btn-lg { width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; margin-top: 8px; }
.vwe-btn-ghost { background: #fff; color: var(--vwe-accent); border: 1px solid var(--vwe-accent); }
.vwe-btn-ghost:hover { background: var(--vwe-accent); color: #fff; }

/* Listing grid (card markup: vwe-vehicle-overview > vwe-vehicle-block) */
.vwe-occasions .vwe-vehicle-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.vwe-occasions .vwe-vehicle-overview:after { display: none !important; }
.vwe-occasions .vwe-vehicle-block { background: #fff; border: 1px solid var(--vwe-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: box-shadow .18s, transform .18s; }
.vwe-occasions .vwe-vehicle-block:hover { box-shadow: 0 12px 30px rgba(0,0,0,.10); transform: translateY(-3px); }
.vwe-occasions .vwe-vehicle-block .img-wrapper { display: block; line-height: 0; }
.vwe-occasions .vwe-vehicle-block img.thumb { width: 100%; aspect-ratio: 1.8; object-fit: cover; display: block; background: #e9edf1; }
.vwe-occasions .vwe-vehicle-block .vehicle-info { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.vwe-occasions .vwe-vehicle-block h5.title { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.vwe-occasions .vwe-vehicle-block h5.title a { color: var(--vwe-ink); text-decoration: none; }
.vwe-occasions .vwe-vehicle-block p.title { margin: 0; color: var(--vwe-muted); font-size: .85rem; }
.vwe-occasions .vwe-vehicle-block p.title a { color: inherit; text-decoration: none; }
.vwe-occasions .vwe-vehicle-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 14px; margin: 4px 0 6px; padding: 0; }
.vwe-occasions .vwe-vehicle-specs .spec { display: flex; font-size: .82rem; color: #374151; }
.vwe-occasions .vwe-vehicle-specs .spec dt { display: none; }
.vwe-occasions .vwe-vehicle-specs .spec dd { margin: 0; }
.vwe-occasions .vwe-vehicle-price { font-size: 1.3rem; font-weight: 700; color: var(--vwe-accent); margin-top: 4px; }
.vwe-occasions .vwe-vehicle-price .sale-price:empty { display: none; }
@media (max-width: 1024px) { .vwe-occasions .vwe-vehicle-overview { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .vwe-occasions .vwe-vehicle-overview { grid-template-columns: 1fr; } }

/* Pagination */
.vwe-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.vwe-pagination .page-numbers { padding: 8px 13px; border: 1px solid var(--vwe-line); border-radius: 8px; text-decoration: none; color: var(--vwe-ink); }
.vwe-pagination .current { background: var(--vwe-accent); color: #fff; border-color: var(--vwe-accent); }
.vwe-empty { padding: 48px; text-align: center; color: var(--vwe-muted); background: var(--vwe-bg); border-radius: 12px; }

/* Detail */
.vwe-breadcrumb { margin-bottom: 18px; }
.vwe-breadcrumb a { color: var(--vwe-muted); text-decoration: none; }
.vwe-breadcrumb a:hover { color: var(--vwe-accent); }
.vwe-detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-areas: "gallery side" "content side"; gap: 0 36px; align-items: start; }
.vwe-gallery { grid-area: gallery; }
.vwe-detail-side { grid-area: side; }
.vwe-detail-content { grid-area: content; min-width: 0; }
.vwe-gallery-main img { width: 100%; border-radius: 14px; aspect-ratio: 4/3; object-fit: cover; background: #e9edf1; }
.vwe-gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.vwe-gallery-thumbs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; }
/* photos are wrapped in buttons that open the lightbox; strip theme button styling */
.vwe-occasions .vwe-gallery-open { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; line-height: 0; cursor: zoom-in; border-radius: 8px; }
.vwe-occasions .vwe-gallery-main .vwe-gallery-open { border-radius: 14px; }
.vwe-occasions .vwe-gallery-open:focus-visible { outline: 3px solid var(--vwe-accent); outline-offset: 2px; }
.vwe-occasions .vwe-gallery-thumbs .vwe-gallery-open img { transition: opacity .15s; }
.vwe-occasions .vwe-gallery-thumbs .vwe-gallery-open:hover img { opacity: .85; }

/* Lightbox (appended to <body>, so not scoped under .vwe-occasions) */
.vwe-lightbox-lock, .vwe-lightbox-lock body { overflow: hidden; }
.vwe-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(10, 12, 16, .92); display: flex; align-items: center; justify-content: center; }
.vwe-lightbox[hidden] { display: none; }
.vwe-lightbox-figure { margin: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 72px; box-sizing: border-box; }
.vwe-lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.vwe-lightbox button { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 400 40px/1 sans-serif; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: none; transition: background .15s; }
.vwe-lightbox button:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.vwe-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.vwe-lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); padding-bottom: 4px !important; }
.vwe-lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); padding-bottom: 4px !important; }
.vwe-lightbox-close { top: 14px; right: 16px; width: 44px !important; height: 44px !important; font-size: 32px !important; }
.vwe-lightbox-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem; background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 999px; }
@media (max-width: 600px) {
	.vwe-lightbox-figure { padding: 56px 8px; }
	.vwe-lightbox-prev, .vwe-lightbox-next { width: 42px !important; height: 42px !important; font-size: 32px !important; background: rgba(0, 0, 0, .45); }
	.vwe-lightbox-prev { left: 8px; }
	.vwe-lightbox-next { right: 8px; }
}

/* right-hand info panel groups title/price/specs/CTAs into one card */
.vwe-detail-side { background: var(--vwe-panel); border: 1px solid var(--vwe-line); border-radius: 16px; padding: 24px; }
/* keep price/specs/CTAs in view while scrolling past the photos (desktop only;
   the grid is a single column below 821px). A panel taller than the viewport
   scrolls on its own instead of being cut off. */
@media (min-width: 821px) {
	.vwe-detail-side { position: sticky; top: var(--vwe-sticky-top, 24px); max-height: calc(100vh - var(--vwe-sticky-top, 24px) - 24px); overflow-y: auto; }
	.admin-bar .vwe-detail-side { top: calc(var(--vwe-sticky-top, 24px) + 32px); max-height: calc(100vh - var(--vwe-sticky-top, 24px) - 56px); }
}
.vwe-detail-title { font-size: 1.55rem; line-height: 1.25; margin: 0 0 2px; color: var(--vwe-ink); }
.vwe-detail-type { color: var(--vwe-muted); margin: 0 0 14px; }
.vwe-detail-price { font-size: 1.9rem; font-weight: 700; color: var(--vwe-accent); margin: 0 0 18px; }

.vwe-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.vwe-cta-row .vwe-btn { flex: 1 1 auto; text-align: center; }

.vwe-specs { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.vwe-specs th, .vwe-specs td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--vwe-line); font-size: .92rem; }
.vwe-specs th { color: var(--vwe-muted); font-weight: 500; width: 45%; }
.vwe-specs td { color: var(--vwe-ink); font-weight: 600; text-align: right; }
.vwe-specs tr:last-child th, .vwe-specs tr:last-child td { border-bottom: 0; }

.vwe-section { margin-top: 40px; }
.vwe-section h2 { font-size: 1.25rem; border-bottom: 2px solid var(--vwe-accent); display: inline-block; padding-bottom: 4px; margin-bottom: 16px; color: var(--vwe-ink); }
.vwe-desc { line-height: 1.6; color: #374151; }
.vwe-accessoires { columns: 2; list-style: none; padding: 0; margin: 0; }
.vwe-accessoires li { padding: 5px 0 5px 22px; position: relative; break-inside: avoid; color: var(--vwe-ink); }
.vwe-accessoires li::before { content: "✓"; position: absolute; left: 0; color: var(--vwe-accent); font-weight: 700; }

/* dealer block as a matching panel */
.vwe-dealer { background: var(--vwe-panel); border: 1px solid var(--vwe-line); border-radius: 16px; padding: 24px; }
.vwe-dealer p { line-height: 1.7; color: #374151; margin: 0 0 16px; }
.vwe-dealer a { color: var(--vwe-accent); }

@media (max-width: 820px) {
	.vwe-detail-grid { grid-template-columns: 1fr; grid-template-areas: "gallery" "side" "content"; gap: 28px; }
	.vwe-accessoires { columns: 1; }
	.vwe-cta-row { flex-direction: column; }
}
