/* AY Fahrzeuge – Frontend. All rules are scoped to .ayf to avoid theme conflicts. */
.ayf {
	--ayf-primary: #c8102e;
	--ayf-dark: #1d2327;
	--ayf-muted: #6b7280;
	--ayf-line: #e5e7eb;
	--ayf-soft: #f5f6f8;
	--ayf-radius: 6px;
	--ayf-cols: 3;
	--ayf-gap: 24px;
	color: var(--ayf-dark);
	box-sizing: border-box;
}
.ayf *, .ayf *::before, .ayf *::after { box-sizing: border-box; }
.ayf [hidden] { display: none !important; }
.ayf-container { max-width: 1320px; margin: 0 auto; padding: 32px 20px 64px; }
.ayf-page-head { margin-bottom: 24px; }
.ayf-page-title { margin: 0 0 8px; font-size: clamp(26px, 3vw, 38px); line-height: 1.2; }
.ayf-icon { flex: none; vertical-align: middle; }

/* Buttons */
.ayf .ayf-btn:not(#_), .ayf button.ayf-btn:not(#_) {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border: 2px solid var(--ayf-primary); border-radius: var(--ayf-radius);
	background: var(--ayf-primary); color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2;
	text-decoration: none; cursor: pointer; transition: filter .15s, background .15s, color .15s;
}
.ayf .ayf-btn:not(#_):hover { filter: brightness(.92); color: #fff; }
.ayf .ayf-btn-outline:not(#_) { background: transparent; color: var(--ayf-primary); }
.ayf .ayf-btn-outline:not(#_):hover { background: var(--ayf-primary); color: #fff; filter: none; }
.ayf .ayf-btn-wa:not(#_) { background: #25d366; border-color: #25d366; }
.ayf .ayf-btn-light:not(#_) { background: #fff; border-color: #fff; color: var(--ayf-primary); }
.ayf .ayf-btn-light:not(#_):hover { color: var(--ayf-primary); }
.ayf .ayf-btn:not(#_)[disabled] { opacity: .6; cursor: wait; }

/* Layout with sidebar */
.ayf-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
.ayf-sidebar { position: sticky; top: 24px; }
.ayf-filter-toggle { display: none; }

/* Filter */
.ayf-filter { background: var(--ayf-soft); border-radius: var(--ayf-radius); padding: 22px; }
.ayf-filter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.ayf-filter-title { margin: 0; font-size: 20px; }
.ayf-reset { font-size: 13px; color: var(--ayf-primary); text-decoration: underline; }
.ayf-fg { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.ayf-fg > label, .ayf-fg legend, .ayf-label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 8px; padding: 0; }
.ayf select, .ayf input[type=text], .ayf input[type=email], .ayf input[type=tel], .ayf input[type=number], .ayf textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius);
	background: #fff; color: var(--ayf-dark); font-size: 15px; line-height: 1.3; margin: 0; height: auto;
}
.ayf select:focus, .ayf input:focus, .ayf textarea:focus { outline: 2px solid var(--ayf-primary); outline-offset: 0; border-color: transparent; }
.ayf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ayf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ayf .ayf-chip { position: relative; display: inline-flex; cursor: pointer; margin: 0; padding: 0; }
.ayf .ayf-chip input { position: absolute; left: 0; top: 0; width: 1px !important; height: 1px !important; margin: 0 !important; opacity: 0; pointer-events: none; }
.ayf-chip span {
	display: inline-block; padding: 8px 14px; border: 1px solid var(--ayf-line); border-radius: 999px;
	background: #fff; font-size: 14px; transition: all .15s; user-select: none;
}
.ayf-chip small { color: var(--ayf-muted); }
.ayf-chip:hover span { border-color: var(--ayf-primary); }
.ayf-chip input:checked + span { background: var(--ayf-primary); border-color: var(--ayf-primary); color: #fff; }
.ayf-chip input:checked + span small { color: rgba(255,255,255,.8); }
.ayf-chip input:focus-visible + span { outline: 2px solid var(--ayf-dark); outline-offset: 2px; }

/* Dual range slider */
.ayf-range { position: relative; height: 28px; }
.ayf-range-track { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--ayf-line); }
.ayf-range-fill { position: absolute; top: 0; bottom: 0; background: var(--ayf-primary); border-radius: 2px; }
.ayf-range input[type=range] {
	position: absolute; left: 0; top: 4px; width: 100%; height: 20px; margin: 0; padding: 0;
	background: none; pointer-events: none; -webkit-appearance: none; appearance: none; border: 0;
}
.ayf-range input[type=range]::-webkit-slider-runnable-track { background: none; height: 20px; }
.ayf-range input[type=range]::-moz-range-track { background: none; }
.ayf-range input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
	background: #fff; border: 3px solid var(--ayf-primary); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ayf-range input[type=range]::-moz-range-thumb {
	pointer-events: auto; width: 14px; height: 14px; border-radius: 50%;
	background: #fff; border: 3px solid var(--ayf-primary); cursor: pointer;
}
.ayf-range-values { font-size: 14px; color: var(--ayf-muted); margin-top: 6px; }

/* Toolbar */
.ayf-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ayf-hits { font-size: 18px; font-weight: 700; }
.ayf-sort { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.ayf-sort select { width: auto; min-width: 220px; }

/* Grid & cards */
.ayf-grid { display: grid; grid-template-columns: repeat(var(--ayf-cols), minmax(0, 1fr)); gap: var(--ayf-gap); transition: opacity .2s; }
.ayf-grid[aria-busy=true] { opacity: .45; pointer-events: none; }
.ayf-grid-4 { --ayf-cols: 4; }
.ayf-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.ayf-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); }
.ayf-card-img { display: block; aspect-ratio: 4 / 3; background: var(--ayf-soft); overflow: hidden; }
.ayf .ayf-card-img img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; transition: transform .3s; }
.ayf-card:hover .ayf-card-img img { transform: scale(1.04); }
.ayf-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #c3c7cd; }
.ayf-noimg .ayf-icon { width: 64px; height: 64px; }
.ayf-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px; }
.ayf-card-brand { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ayf-primary); }
.ayf-card-title { margin: 4px 0 14px; font-size: 18px; line-height: 1.3; }
.ayf-card-title a { color: inherit; text-decoration: none; }
.ayf-card-specs { list-style: none; margin: 0 0 18px; padding: 0; font-size: 14px; }
.ayf-card-specs li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--ayf-line); margin: 0; }
.ayf-card-specs .ayf-icon { color: var(--ayf-muted); }
.ayf-card-specs .ayf-k { color: var(--ayf-muted); }
.ayf-card-specs .ayf-v { margin-left: auto; font-weight: 600; text-align: right; }
.ayf .ayf-card-btn { margin-top: auto; width: 100%; }
.ayf-empty { padding: 40px; text-align: center; background: var(--ayf-soft); border-radius: var(--ayf-radius); }
.ayf-more-wrap { text-align: center; margin-top: 32px; }

/* Category tiles */
.ayf-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.ayf-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius); background: #fff; color: var(--ayf-dark); text-decoration: none; transition: all .2s; }
.ayf-cat:hover { border-color: var(--ayf-primary); color: var(--ayf-primary); }
.ayf-cat-icon .ayf-icon { width: 44px; height: 44px; color: var(--ayf-primary); }
.ayf-cat-name { font-weight: 700; font-size: 18px; }
.ayf-cat-count { font-size: 14px; color: var(--ayf-muted); }

/* Single */
.ayf-crumbs { margin-bottom: 18px; font-size: 14px; }
.ayf-crumbs a { color: var(--ayf-muted); text-decoration: none; }
.ayf-single-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.ayf-gallery-main { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ayf-soft); border-radius: var(--ayf-radius); overflow: hidden; cursor: zoom-in; }
.ayf .ayf-gallery-main img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; }
.ayf-gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.ayf-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.ayf-thumbs a { display: block; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; border: 2px solid transparent; opacity: .75; }
.ayf-thumbs a.is-active, .ayf-thumbs a:hover { border-color: var(--ayf-primary); opacity: 1; }
.ayf .ayf-thumbs img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; }
.ayf-single-title { margin: 4px 0 6px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; }
.ayf-nr { color: var(--ayf-muted); font-size: 14px; margin-bottom: 16px; }
.ayf-price { display: flex; flex-direction: column; padding: 16px 18px; background: var(--ayf-soft); border-radius: var(--ayf-radius); margin-bottom: 18px; }
.ayf-price strong { font-size: 24px; }
.ayf-price span { font-size: 13px; color: var(--ayf-muted); }
.ayf-specs { margin: 0 0 20px; }
.ayf-specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--ayf-line); }
.ayf-specs dt { color: var(--ayf-muted); margin: 0; }
.ayf-specs dd { margin: 0; font-weight: 600; text-align: right; }
.ayf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ayf-actions .ayf-btn { flex: 1 1 160px; }
.ayf-share { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ayf-muted); margin-bottom: 18px; }
.ayf-share a { color: var(--ayf-dark); display: inline-flex; }
.ayf-share a:hover { color: var(--ayf-primary); }
.ayf-site { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius); font-size: 14px; }
.ayf-site .ayf-icon { color: var(--ayf-primary); margin-top: 2px; }
.ayf-section { margin-top: 48px; }
.ayf-section > h2 { font-size: 24px; margin: 0 0 18px; }
.ayf-equip { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: 32px; }
.ayf-equip li { display: flex; gap: 8px; break-inside: avoid; padding: 6px 0; margin: 0; }
.ayf-equip .ayf-icon { color: var(--ayf-primary); margin-top: 2px; }
.ayf-inquiry { background: var(--ayf-soft); padding: 32px; border-radius: var(--ayf-radius); }
.ayf-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 32px; background: var(--ayf-primary); color: #fff; border-radius: var(--ayf-radius); }
.ayf-cta h2 { color: #fff; margin: 0 0 6px; font-size: 24px; }
.ayf-cta p { margin: 0; opacity: .9; }

/* Forms */
.ayf-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.ayf-form .ayf-wide { grid-column: 1 / -1; }
.ayf-consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.ayf-consent input { margin-top: 3px; }
.ayf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ayf-form-msg { padding: 12px 16px; border-radius: var(--ayf-radius); margin-bottom: 16px; background: #e7f6ec; color: #116329; }
.ayf-form-msg[data-state=fehler] { background: #fdecec; color: #9b1c1c; }

/* Lightbox */
.ayf-lightbox { position: fixed; inset: 0; z-index: 999999; background: rgba(10,10,12,.92); display: flex; align-items: center; justify-content: center; }
.ayf-lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.ayf-lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.ayf-lightbox button:hover { background: rgba(255,255,255,.25); }
.ayf-lb-close { top: 18px; right: 18px; }
.ayf-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.ayf-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.ayf-lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }

/* Responsive */
@media (max-width: 1100px) {
	.ayf-grid { --ayf-cols: 2; }
	.ayf-grid-4 { --ayf-cols: 2; }
}
@media (max-width: 900px) {
	.ayf-layout { grid-template-columns: 1fr; }
	.ayf-sidebar { position: static; display: none; }
	.ayf-listing.filter-open .ayf-sidebar { display: block; }
	.ayf .ayf-filter-toggle:not(#_) { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 16px; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius); background: #fff; color: var(--ayf-dark); font-weight: 600; cursor: pointer; }
	.ayf-single-top { grid-template-columns: 1fr; }
	.ayf-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
	.ayf-grid, .ayf-grid-4 { --ayf-cols: 1; }
	.ayf-form-grid { grid-template-columns: 1fr; }
	.ayf-sort select { min-width: 0; }
	.ayf-inquiry, .ayf-cta { padding: 22px; }
}

/* ------------------------------------------------------------------
 * v1.2 – Dealer layout (header banner, card sidebar, compact cards)
 * ---------------------------------------------------------------- */
.ayf { --ayf-page: #eef1f6; --ayf-hero: #0b2a5b; }
.ayf-page { overflow-x: clip; }
.ayf-container:has(> .has-hero) { padding-top: 0; }

/* Full-width page background behind the listing */
.ayf-listing.has-filter { background: var(--ayf-page); box-shadow: 0 0 0 100vmax var(--ayf-page); clip-path: inset(0 -100vmax); padding-bottom: 40px; }

/* Header banner */
.ayf-hero {
	position: relative; margin: 0 calc(50% - 50vw) 32px; padding: 56px 20px 60px;
	background: var(--ayf-hero) center / cover no-repeat; color: #fff; text-align: center; overflow: hidden;
}
.ayf-hero::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(120deg, rgba(0,0,0,.25), rgba(0,0,0,0) 60%), radial-gradient(circle at 80% 20%, rgba(255,255,255,.08), transparent 45%);
}
.ayf-hero-inner { position: relative; }
.ayf .ayf-hero-title { margin: 0 0 10px; color: #fff; font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.15; }
.ayf .ayf-hero-hits { color: #fff; font-size: clamp(20px, 2.4vw, 28px); font-weight: 400; }

/* Sidebar cards */
.ayf .ayf-filter { background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.06); padding: 24px; }
.ayf .ayf-filter-title { font-size: 20px; font-weight: 700; }
.ayf-sidebox {
	display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 22px 24px;
	background: #fff; border-radius: var(--ayf-radius); box-shadow: 0 1px 3px rgba(16,24,40,.06);
	color: var(--ayf-primary); text-decoration: none;
}
.ayf-sidebox:hover { color: var(--ayf-primary); box-shadow: 0 6px 18px rgba(16,24,40,.1); }
.ayf-sidebox-icon .ayf-icon { width: 38px; height: 38px; }
.ayf-sidebox strong { display: block; font-size: 16px; }
.ayf-sidebox span span { display: block; font-size: 15px; }

/* Vehicle type as checkbox list */
.ayf .ayf-chips.is-list { flex-direction: column; gap: 10px; }
.ayf .ayf-chips.is-list .ayf-chip span { padding: 0; border: 0; border-radius: 0; background: none; font-size: 15px; display: inline-flex; align-items: center; gap: 10px; }
.ayf .ayf-chips.is-list .ayf-chip span::before {
	content: ""; width: 18px; height: 18px; flex: none; border: 1.5px solid #9aa3ae; border-radius: 3px; background: #fff center / 12px no-repeat;
}
.ayf .ayf-chips.is-list .ayf-chip input:checked + span { background: none; color: var(--ayf-dark); }
.ayf .ayf-chips.is-list .ayf-chip input:checked + span::before {
	background-color: var(--ayf-primary); border-color: var(--ayf-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
.ayf .ayf-chips.is-list .ayf-chip input:checked + span small { color: var(--ayf-muted); }
.ayf .ayf-chips.is-list .ayf-chip:hover span { color: var(--ayf-primary); }

/* Toolbar as white bar */
.has-filter .ayf-toolbar { background: #fff; padding: 14px 18px; border-radius: var(--ayf-radius); box-shadow: 0 1px 3px rgba(16,24,40,.06); margin-bottom: 18px; }
.has-filter .ayf-sort > span { display: none; }
.has-filter .ayf-sort select { font-weight: 600; }

/* Compact cards (2 columns with icons) */
.ayf-card { border: 0; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.ayf .ayf-card--compact .ayf-card-brand { color: var(--ayf-dark); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 15px; }
.ayf .ayf-card--compact .ayf-card-title { font-weight: 700; font-size: 17px; margin: 2px 0 14px; }
.ayf-card--compact .ayf-card-specs { display: grid; grid-template-columns: 1fr auto; gap: 14px 12px; padding-top: 16px; border-top: 1px solid var(--ayf-line); font-size: 14px; }
.ayf-card--compact .ayf-card-specs li { border: 0; padding: 0; }
.ayf-card--compact .ayf-card-specs li:nth-child(even) { justify-content: flex-end; }
.ayf-card--compact .ayf-card-specs .ayf-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ayf-card--compact .ayf-card-specs .ayf-v { margin-left: 0; font-weight: 500; text-align: left; }
.ayf-card--compact .ayf-card-specs .ayf-icon { color: var(--ayf-dark); width: 20px; height: 20px; }
.ayf .ayf-card--compact .ayf-card-btn:not(#_) { border-color: var(--ayf-dark); color: var(--ayf-dark); background: transparent; font-weight: 500; padding: 9px 16px; border-width: 1px; }
.ayf .ayf-card--compact .ayf-card-btn:not(#_):hover { background: var(--ayf-dark); color: #fff; }

/* Load more as full-width primary button */
.has-filter .ayf-more-wrap .ayf-more:not(#_) { width: 100%; }

/* Header search [ay_fahrzeug_suche] */
.ayf-search { position: relative; display: inline-flex; width: 100%; max-width: 260px; }
.ayf .ayf-search input[type=search] { width: 100%; padding: 9px 38px 9px 12px; border: 1px solid var(--ayf-line); border-radius: var(--ayf-radius); background: #f5f6f8; font-size: 14px; }
.ayf .ayf-search button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--ayf-muted); cursor: pointer; line-height: 0; }

@media (max-width: 900px) {
	.ayf-hero { padding: 36px 16px 40px; margin-bottom: 20px; }
	.ayf-listing.has-filter .ayf-filter-toggle:not(#_) { background: #fff; }
}
.ayf-card--compact .ayf-card-specs .ayf-v { white-space: nowrap; }
.ayf-card--compact .ayf-card-specs { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 10px; font-size: 13.5px; }
.ayf-card--compact .ayf-card-specs li { min-width: 0; gap: 6px; }
.ayf-card--compact .ayf-card-specs li:nth-child(odd) .ayf-v { overflow: hidden; text-overflow: ellipsis; }
.ayf-card--compact .ayf-card-specs .ayf-icon { width: 18px; height: 18px; }

/* v1.3 – custom icons */
.ayf .ayf-icon-img { width: 20px; height: 20px; object-fit: contain; }
.ayf-cat-icon.has-img { display: flex; align-items: center; justify-content: center; height: 90px; }
.ayf .ayf-term-icon { max-width: 150px; max-height: 90px; width: auto; height: auto; object-fit: contain; }
.ayf-cat-desc { font-size: 14px; color: var(--ayf-muted); text-align: center; line-height: 1.45; }
.ayf-cats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* Theme list resets (e.g. XTRA adds padding/bullets to content lists) */
.ayf ul.ayf-card-specs, .ayf ul.ayf-equip { padding-left: 0 !important; margin-left: 0 !important; list-style: none !important; }
.ayf ul.ayf-card-specs li::before, .ayf ul.ayf-equip li::before { content: none !important; }
