/**
 * KFZ-Web Frontend Styles
 * 
 * BEM Naming: .kfzweb-{block}__{element}--{modifier}
 * Framework-agnostic - No Bootstrap/Foundation required
 * 
 * @package KFZ_Web
 * @since 3.0.0
 */

/* =========================================
   GLOBAL RESET & BOX-SIZING
   ========================================= */

.kfzweb-single,
.kfzweb-single *,
.kfzweb-single *::before,
.kfzweb-single *::after,
.kfzweb-archive,
.kfzweb-archive *,
.kfzweb-archive *::before,
.kfzweb-archive *::after,
.kfzweb-vehicle,
.kfzweb-vehicle *,
.kfzweb-vehicle *::before,
.kfzweb-vehicle *::after,
.kfzweb-filters,
.kfzweb-filters *,
.kfzweb-filters *::before,
.kfzweb-filters *::after,
.kfzweb-vehicle-grid-block,
.kfzweb-vehicle-grid-block *,
.kfzweb-vehicle-grid-block *::before,
.kfzweb-vehicle-grid-block *::after {
    box-sizing: border-box;
}

/* Ensure images don't overflow */
.kfzweb-single img,
.kfzweb-archive img,
.kfzweb-vehicle img {
    max-width: 100%;
    height: auto;
}

/* All tokens are generated by \KFZWeb\Design\Tokens. */

/* =========================================
   SKIP-TO-CONTENT (KFZ-38 §7.1)
   ========================================= */

.kfzweb-skip-link {
    position: absolute;
    top: -100%;
    left: var(--kfzweb-space-4);
    z-index: 10000;
    padding: var(--kfzweb-space-2) var(--kfzweb-space-4);
    background: var(--kfzweb-primary);
    color: #fff;
    font-family: var(--kfzweb-font-family);
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-semibold);
    text-decoration: none;
    border-radius: var(--kfzweb-radius-sm);
    transition: top var(--kfzweb-transition);
}

.kfzweb-skip-link:focus {
    top: var(--kfzweb-space-2);
    outline: 3px solid var(--kfzweb-primary);
    outline-offset: 2px;
}

/* =========================================
   SCREEN READER UTILITY (KFZ-38 §7.3)
   ========================================= */

.sr-only,
.kfzweb-filter-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tabular nums for prices */
.kfzweb-vehicle__price-value,
.kfzweb-price-box__price,
.kfzweb-quick-stats__item--price .kfzweb-quick-stats__value {
    font-variant-numeric: tabular-nums;
}

/* =========================================
   GRID SYSTEM
   ========================================= */

.kfzweb-grid {
    display: grid;
    gap: var(--kfzweb-gap);
}

.kfzweb-grid--2-col { grid-template-columns: repeat(2, 1fr); }
.kfzweb-grid--3-col { grid-template-columns: repeat(3, 1fr); }
.kfzweb-grid--4-col { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .kfzweb-grid--4-col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .kfzweb-grid--2-col, .kfzweb-grid--3-col, .kfzweb-grid--4-col { grid-template-columns: 1fr; }
}

/* =========================================
   VEHICLE CARD (Archive)
   ========================================= */

.kfzweb-vehicle {
    background: var(--kfzweb-bg);
    border-radius: var(--kfzweb-radius);
    overflow: hidden;
    box-shadow: var(--kfzweb-shadow);
    transition: box-shadow var(--kfzweb-transition), transform var(--kfzweb-transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Hover: desktop only (KFZ-38 §3.3) */
@media (hover: hover) {
    .kfzweb-vehicle:hover {
        box-shadow: var(--kfzweb-shadow-md);
        transform: translateY(-2px);
    }
}

/* Focus-visible for keyboard navigation */
.kfzweb-vehicle a:focus-visible,
.kfzweb-vehicle__title a:focus-visible {
    outline: 3px solid var(--kfzweb-primary);
    outline-offset: 2px;
    border-radius: var(--kfzweb-radius);
}

/* Card click/tap feedback */
.kfzweb-vehicle:active {
    transform: scale(0.98);
    transition-duration: 120ms;
}

.kfzweb-vehicle__image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--kfzweb-bg-alt);
}

.kfzweb-vehicle__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--kfzweb-transition);
}

@media (hover: hover) {
    .kfzweb-vehicle:hover .kfzweb-vehicle__image img {
        transform: scale(1.03);
    }
}

.kfzweb-vehicle__no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--kfzweb-text-muted);
    font-size: 0.875rem;
}

/* Platzhalterbild (kein Foto): mit Luft darstellen statt randlos beschnitten.
   Höhere Spezifität als `.kfzweb-vehicle__image img { object-fit: cover }`. */
.kfzweb-vehicle__image img.kfzweb-vehicle__no-image-img {
    object-fit: contain;
    padding: 9%;
    background: var(--kfzweb-bg-alt);
}

.kfzweb-vehicle__image-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: calc(var(--kfzweb-radius) / 2);
    font-size: 0.75rem;
}

.kfzweb-vehicle__content {
    padding: var(--kfzweb-space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kfzweb-vehicle__title {
    font-size: var(--kfzweb-text-lg);
    font-weight: var(--kfzweb-font-semibold);
    color: var(--kfzweb-text);
    margin: 0 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kfzweb-vehicle__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--kfzweb-transition);
}

.kfzweb-vehicle__title a:hover {
    color: var(--kfzweb-primary);
}

.kfzweb-vehicle__price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kfzweb-text);
}

/* =========================================
   BUTTONS
   ========================================= */

.kfzweb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--kfzweb-space-2);
    padding: 10px 20px;
    min-height: 44px;
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-semibold);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--kfzweb-radius);
    cursor: pointer;
    transition: all var(--kfzweb-transition);
    -webkit-tap-highlight-color: transparent;
}

.kfzweb-btn:active {
    transform: scale(0.98);
}

.kfzweb-btn--primary {
    background: var(--kfzweb-primary);
    color: #fff;
}

.kfzweb-btn--primary:hover {
    background: var(--kfzweb-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--kfzweb-shadow-md);
}

.kfzweb-btn--secondary {
    background: var(--kfzweb-gray-100);
    border-color: var(--kfzweb-gray-200);
    color: var(--kfzweb-text);
}

.kfzweb-btn--secondary:hover {
    background: var(--kfzweb-gray-200);
}

.kfzweb-btn--danger {
    background: var(--kfzweb-danger);
    color: #fff;
}

.kfzweb-btn--danger:hover {
    background: #dc2626;
}

.kfzweb-btn--ghost {
    background: transparent;
    color: var(--kfzweb-primary);
}

.kfzweb-btn--ghost:hover {
    background: var(--kfzweb-primary-light);
}

.kfzweb-btn--block {
    width: 100%;
}

/* =========================================
   SINGLE VEHICLE PAGE
   ========================================= */

.kfzweb-single {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.kfzweb-single__header {
    margin-bottom: 1.5rem;
}

.kfzweb-single__breadcrumb {
    margin-bottom: 0.75rem;
}

.kfzweb-single__breadcrumb a {
    color: var(--kfzweb-primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.kfzweb-single__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--kfzweb-text);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.kfzweb-single__subtitle {
    font-size: 1rem;
    color: var(--kfzweb-text-muted);
    margin: 0;
}

/* PDF Button */
.kfzweb-pdf-button {
    display: inline-flex;
    align-items: center;
    gap: var(--kfzweb-space-2);
    margin-top: 0.75rem;
    padding: 8px 16px;
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-semibold);
    /* line-height explizit + !important: ohne sie erbt der <a> auf Fremd-Themes
       (z. B. Impreza stylt Anker-Zeilenhöhe mit höherer Spezifität → 24px) eine
       andere Zeilenhöhe als der Merken-<button> (1.4) → unterschiedliche Höhen
       nebeneinander. !important, weil Themes <a> oft spezifischer ansprechen als
       eine einzelne Klasse; line-height ist typo-neutral (kein Branding-Konflikt).
       1.4 = identisch zu .kfzweb-wishlist-btn--single. */
    line-height: 1.4 !important;
    box-sizing: border-box;
    color: var(--kfzweb-primary);
    background: transparent;
    border: 1px solid var(--kfzweb-primary);
    border-radius: var(--kfzweb-radius);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--kfzweb-transition);
}

.kfzweb-pdf-button:hover {
    background: var(--kfzweb-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--kfzweb-shadow-md);
}

.kfzweb-pdf-button svg {
    flex-shrink: 0;
}

/* Gallery */
.kfzweb-gallery {
    position: relative;
}

.kfzweb-gallery__main {
    position: relative;
    aspect-ratio: 16/10;
    background: var(--kfzweb-bg-alt);
    border-radius: var(--kfzweb-radius);
    overflow: hidden;
}

.kfzweb-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

/* =========================================
   Lightbox (Galerie-Vollbild)
   ========================================= */
.kfzweb-gallery__expand {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--kfzweb-radius-full);
    background: var(--kfzweb-gray-900);
    color: #fff;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.kfzweb-gallery__expand:hover,
.kfzweb-gallery__expand:focus-visible { opacity: 1; }

.kfzweb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kfzweb-lightbox[hidden] { display: none; }
.kfzweb-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--kfzweb-gray-900);
    opacity: 0.93;
}
.kfzweb-lightbox__stage {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 92vw;
    max-height: 86vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kfzweb-lightbox__image {
    max-width: 92vw;
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--kfzweb-radius);
    box-shadow: var(--kfzweb-shadow-lg);
}
.kfzweb-lightbox__close,
.kfzweb-lightbox__nav {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    background: transparent;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.kfzweb-lightbox__close:hover,
.kfzweb-lightbox__close:focus-visible,
.kfzweb-lightbox__nav:hover,
.kfzweb-lightbox__nav:focus-visible { opacity: 1; }
.kfzweb-lightbox__close { top: 16px; right: 20px; }
.kfzweb-lightbox__nav { top: 50%; transform: translateY(-50%); }
.kfzweb-lightbox__nav--prev { left: 12px; }
.kfzweb-lightbox__nav--next { right: 12px; }
.kfzweb-lightbox__counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: #fff;
    font-size: 14px;
    opacity: 0.85;
}
@media (max-width: 640px) {
    .kfzweb-lightbox__nav--prev { left: 4px; }
    .kfzweb-lightbox__nav--next { right: 4px; }
}

.kfzweb-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--kfzweb-transition), transform var(--kfzweb-transition), opacity var(--kfzweb-transition);
    opacity: 0;
    box-sizing: border-box;
}

.kfzweb-gallery:hover .kfzweb-gallery__nav {
    opacity: 1;
}

.kfzweb-gallery__nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.kfzweb-gallery__nav--prev { left: 1rem; }
.kfzweb-gallery__nav--next { right: 1rem; }

.kfzweb-gallery__counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
}

.kfzweb-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-snap-type: x mandatory;
    scrollbar-width: thin; /* Firefox */
}

/* Hide scrollbar on mobile but keep functionality */
.kfzweb-gallery__thumbs::-webkit-scrollbar {
    height: 4px;
}

.kfzweb-gallery__thumbs::-webkit-scrollbar-thumb {
    background: var(--kfzweb-border);
    border-radius: 2px;
}

.kfzweb-gallery__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 0.25rem;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color var(--kfzweb-transition), opacity var(--kfzweb-transition);
    opacity: 0.7;
}

.kfzweb-gallery__thumb:hover {
    opacity: 1;
    border-color: var(--kfzweb-border);
}

.kfzweb-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kfzweb-gallery__thumb--active {
    border-color: var(--kfzweb-primary);
    opacity: 1;
}

.kfzweb-gallery__thumb--active:hover {
    border-color: var(--kfzweb-primary);
}

.kfzweb-gallery__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    color: var(--kfzweb-text-muted);
    gap: 0.5rem;
}

/* Quick Stats */
.kfzweb-single__quick-stats {
    margin-bottom: 2rem;
}

.kfzweb-quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--kfzweb-bg-alt);
    border-radius: var(--kfzweb-radius);
}

.kfzweb-quick-stats__item {
    text-align: center;
}

.kfzweb-quick-stats__item--price .kfzweb-quick-stats__value {
    font-size: 1.5rem;
    color: var(--kfzweb-primary);
}

.kfzweb-quick-stats__value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--kfzweb-text);
}

.kfzweb-quick-stats__label {
    display: block;
    font-size: 0.75rem;
    color: var(--kfzweb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Content Layout */
.kfzweb-single__content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

.kfzweb-single__sidebar {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sections */
.kfzweb-section {
    margin-bottom: 2rem;
}

.kfzweb-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--kfzweb-text);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--kfzweb-border);
}

.kfzweb-section__title svg {
    color: var(--kfzweb-primary);
}

/* Price Box */
.kfzweb-price-box {
    background: var(--kfzweb-bg);
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius);
    padding: 1.5rem;
    box-shadow: var(--kfzweb-shadow);
}

.kfzweb-price-box__price-wrap {
    text-align: center;
    margin-bottom: 1rem;
}

.kfzweb-price-box__price {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--kfzweb-text);
}

.kfzweb-price-box__vat {
    font-size: 0.875rem;
    color: var(--kfzweb-text-muted);
}

.kfzweb-price-box__availability {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--kfzweb-success);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.kfzweb-price-box__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Top Features */
.kfzweb-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kfzweb-features__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--kfzweb-bg-alt);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--kfzweb-text);
}

.kfzweb-features__chip svg {
    color: var(--kfzweb-success);
}

.kfzweb-features__chip--highlight {
    background: var(--kfzweb-success-light);
}

/* Specs Table */
.kfzweb-specs__group {
    margin-bottom: 1.5rem;
}

.kfzweb-specs__group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--kfzweb-text);
    margin: 0 0 0.75rem;
}

.kfzweb-specs__group-title svg {
    color: var(--kfzweb-primary);
}

.kfzweb-specs__row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--kfzweb-border);
}

.kfzweb-specs__label {
    color: var(--kfzweb-text-muted);
}

.kfzweb-specs__value {
    font-weight: 500;
    color: var(--kfzweb-text);
}

/* WLTP */
.kfzweb-wltp__content {
    background: var(--kfzweb-bg-alt);
    padding: 1rem;
    border-radius: var(--kfzweb-radius);
}

.kfzweb-wltp__class {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kfzweb-wltp__co2-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 700;
    font-size: 1.125rem;
}

/* CO₂-Klasse-Badges in der WLTP-Section (Gebrauchtwagen — ohne regulierte A–G-Skala) */
.kfzweb-wltp__classes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
}
.kfzweb-wltp__class {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.kfzweb-wltp__class-cap {
    font-size: 0.8125rem;
    color: var(--kfzweb-text-muted);
}

.kfzweb-wltp__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.kfzweb-wltp__item-label {
    display: block;
    font-size: 0.75rem;
    color: var(--kfzweb-text-muted);
}

.kfzweb-wltp__item-value {
    font-weight: 600;
    color: var(--kfzweb-text);
}

/* Equipment Accordion */
.kfzweb-equipment__section {
    border-bottom: 1px solid var(--kfzweb-border);
}

.kfzweb-equipment__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--kfzweb-text);
    text-align: left;
    transition: color var(--kfzweb-transition);
}

.kfzweb-equipment__header:hover {
    color: var(--kfzweb-primary);
}

.kfzweb-equipment__count {
    font-weight: 400;
    color: var(--kfzweb-text-muted);
    margin-left: 0.5rem;
}

.kfzweb-equipment__toggle {
    transition: transform var(--kfzweb-transition);
    color: var(--kfzweb-text-muted);
}

.kfzweb-equipment__section--open .kfzweb-equipment__toggle {
    transform: rotate(180deg);
}

.kfzweb-equipment__content {
    display: none;
    padding-bottom: 1rem;
}

.kfzweb-equipment__section--open .kfzweb-equipment__content {
    display: block;
}

.kfzweb-equipment__list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 1rem;
}

.kfzweb-equipment__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    break-inside: avoid;
    font-size: 0.875rem;
}

.kfzweb-equipment__item svg {
    color: var(--kfzweb-success);
    flex-shrink: 0;
}

/* Description */
.kfzweb-description__content {
    line-height: 1.7;
    color: var(--kfzweb-text);
}

/* Dealer Box */
.kfzweb-dealer-box {
    background: var(--kfzweb-bg-alt);
    border-radius: var(--kfzweb-radius);
    padding: 1.25rem;
}

.kfzweb-dealer-box__title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--kfzweb-text-muted);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kfzweb-dealer-box__name {
    font-weight: 600;
    color: var(--kfzweb-text);
    margin-bottom: 0.5rem;
}

.kfzweb-dealer-box__address {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--kfzweb-text-muted);
}

/* WLTP Disclaimer */
.kfzweb-wltp-disclaimer {
    font-size: 0.75rem;
    color: var(--kfzweb-text-muted);
    line-height: 1.5;
    padding: 1rem;
    background: var(--kfzweb-bg-alt);
    border-radius: var(--kfzweb-radius);
    margin: 2rem 0;
}

/* =========================================
   INLINE FORM VALIDATION (KFZ-38 §5)
   ========================================= */

.kfzweb-field {
    margin-bottom: var(--kfzweb-space-4);
}

.kfzweb-field label {
    display: block;
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-medium);
    color: var(--kfzweb-text);
    margin-bottom: var(--kfzweb-space-1);
}

.kfzweb-field input,
.kfzweb-field select,
.kfzweb-field textarea {
    width: 100%;
    padding: var(--kfzweb-space-2) var(--kfzweb-space-3);
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius-sm);
    font-family: var(--kfzweb-font-family);
    font-size: var(--kfzweb-text-base);
    color: var(--kfzweb-text);
    background: var(--kfzweb-bg);
    transition: border-color var(--kfzweb-transition), background var(--kfzweb-transition);
}

.kfzweb-field input:focus,
.kfzweb-field select:focus,
.kfzweb-field textarea:focus {
    outline: none;
    border-color: var(--kfzweb-primary);
    box-shadow: 0 0 0 3px var(--kfzweb-primary-light);
}

/* Error state */
.kfzweb-field--error input,
.kfzweb-field--error select,
.kfzweb-field--error textarea {
    border-color: var(--kfzweb-danger);
    background: var(--kfzweb-danger-light);
}

.kfzweb-field-error {
    display: flex;
    align-items: center;
    gap: var(--kfzweb-space-1);
    margin-top: var(--kfzweb-space-1);
    font-size: var(--kfzweb-text-sm);
    font-weight: var(--kfzweb-font-medium);
    color: var(--kfzweb-danger);
    animation: kfzweb-fade-in-up 200ms ease both;
}

.kfzweb-field-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Success state */
.kfzweb-field--success input {
    border-color: var(--kfzweb-success);
}

/* Form error summary */
.kfzweb-form-errors {
    background: var(--kfzweb-danger-light);
    border-left: 3px solid var(--kfzweb-danger);
    border-radius: var(--kfzweb-radius);
    padding: var(--kfzweb-space-4);
    margin-bottom: var(--kfzweb-space-6);
    font-size: var(--kfzweb-text-sm);
}

.kfzweb-form-errors p {
    margin: 0 0 var(--kfzweb-space-2);
    font-weight: var(--kfzweb-font-medium);
    color: var(--kfzweb-danger);
}

.kfzweb-form-errors a {
    color: var(--kfzweb-danger);
    text-decoration: underline;
}

/* =========================================
   RESPONSIVE - Mobile First Approach
   ========================================= */

/* Tablet: 1024px and below */
@media (max-width: 1024px) {
    .kfzweb-single__content {
        grid-template-columns: 1fr;
    }
    
    .kfzweb-single__sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .kfzweb-price-box {
        flex: 1 1 300px;
    }
    
    .kfzweb-dealer-box {
        flex: 1 1 200px;
    }
}

/* Tablet / Large Phone: 640px and below */
@media (max-width: 640px) {
    .kfzweb-single {
        padding: 1rem;
    }

    .kfzweb-single__title {
        font-size: var(--kfzweb-text-2xl);
        line-height: 1.25;
    }

    .kfzweb-single__sidebar {
        flex-direction: column;
    }

    .kfzweb-price-box,
    .kfzweb-dealer-box {
        flex: 1 1 100%;
    }

    /* Gallery navigation always visible on touch */
    .kfzweb-gallery__nav {
        opacity: 1;
    }

    .kfzweb-gallery__thumb {
        scroll-snap-align: start;
        width: 70px;
        height: 52px;
    }

    .kfzweb-equipment__list {
        columns: 1;
    }

    .kfzweb-section__title {
        font-size: var(--kfzweb-text-lg);
    }
}

/* Phone: 480px and below */
@media (max-width: 480px) {
    .kfzweb-single {
        padding: 0.75rem;
    }
    
    .kfzweb-single__title {
        font-size: 1.25rem;
    }
    
    .kfzweb-single__subtitle {
        font-size: 0.875rem;
    }
    
    .kfzweb-gallery__main {
        aspect-ratio: 4/3;
        border-radius: 0;
        margin: 0 -0.75rem; /* Full-bleed on mobile */
        width: calc(100% + 1.5rem);
    }
    
    .kfzweb-gallery__thumbs {
        margin: 0.75rem -0.75rem 0;
        padding: 0 0.75rem 0.5rem;
    }
    
    .kfzweb-quick-stats {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .kfzweb-quick-stats__item {
        display: flex;
        justify-content: space-between;
        text-align: left;
    }
    
    .kfzweb-wltp__grid {
        grid-template-columns: 1fr;
    }
    
    .kfzweb-specs__row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .kfzweb-specs__value {
        text-align: left;
    }
    
    /* Larger touch targets */
    .kfzweb-equipment__header {
        padding: 1rem 0;
        min-height: 48px;
    }
    
    .kfzweb-btn {
        min-height: 48px;
        font-size: 1rem;
    }
    
    /* Price box sticky on mobile */
    .kfzweb-price-box--sticky-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        border-radius: 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        padding: 1rem;
    }
    
    .kfzweb-price-box--sticky-mobile .kfzweb-price-box__price-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
    }
    
    .kfzweb-price-box--sticky-mobile .kfzweb-price-box__actions {
        flex-direction: row;
    }
    
    /* Ensure body content doesn't hide behind sticky price box */
    body.kfzweb-has-sticky-price {
        padding-bottom: 120px;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Always show gallery navigation on touch devices */
    .kfzweb-gallery__nav {
        opacity: 1;
    }
    
    /* Disable hover transforms on touch */
    .kfzweb-vehicle:hover {
        transform: none;
    }
    
    .kfzweb-vehicle:hover .kfzweb-vehicle__image img {
        transform: none;
    }
    
    /* Larger tap targets */
    .kfzweb-gallery__thumb {
        min-width: 60px;
        min-height: 44px;
    }
    
    .kfzweb-pagination a,
    .kfzweb-pagination span {
        min-width: 44px;
        min-height: 44px;
    }
}

/* =========================================
   VEHICLE CARD (Extended)
   ========================================= */

.kfzweb-vehicle__subtitle {
    font-size: 0.875rem;
    color: var(--kfzweb-text-muted);
    margin: 0 0 0.75rem;
}

.kfzweb-vehicle__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--kfzweb-text-muted);
    margin-bottom: 0.75rem;
}

.kfzweb-vehicle__spec::after {
    content: "·";
    margin-left: 0.5rem;
}

.kfzweb-vehicle__spec:last-child::after {
    display: none;
}

.kfzweb-vehicle__price {
    margin-bottom: 0.75rem;
}

.kfzweb-vehicle__price-vat {
    font-size: 0.75rem;
    color: var(--kfzweb-text-muted);
}

.kfzweb-vehicle__footer {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* WLTP Compact (for cards) */
.kfzweb-wltp--compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.9rem;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.7rem;
    background: var(--kfzweb-bg-alt);
    border-radius: calc(var(--kfzweb-radius) / 2);
}

.kfzweb-wltp__item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.kfzweb-wltp--compact .kfzweb-wltp__label {
    color: var(--kfzweb-text-muted);
}

/* CO₂-Klasse-Badge im Karten-/Compact-Kontext kleiner halten — das Standard-Badge
   (18px, fürs Detail gedacht) dominiert sonst die ansonsten nur 12px kleine
   Compact-Card. Auf der Detailseite bleibt das Badge unverändert groß. */
.kfzweb-wltp--compact .kfzweb-wltp__co2-badge {
    font-size: 0.8125rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
}

/* CO2 Class Colors (EU Standard A-G) */
.kfzweb-wltp__co2-class {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 600;
    color: #fff;
}

.kfzweb-wltp__co2-class--a { background: #00a651; }
.kfzweb-wltp__co2-class--b { background: #51b747; }
.kfzweb-wltp__co2-class--c { background: #bdd630; color: var(--kfzweb-text); }
.kfzweb-wltp__co2-class--d { background: #fff200; color: var(--kfzweb-text); }
.kfzweb-wltp__co2-class--e { background: #fcb814; }
.kfzweb-wltp__co2-class--f { background: #f36f21; }
.kfzweb-wltp__co2-class--g { background: #ed1c24; }

/* =========================================
   ARCHIVE PAGE
   ========================================= */

.kfzweb-archive {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

.kfzweb-archive__header {
    margin-bottom: 2rem;
    text-align: center;
}

.kfzweb-archive__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--kfzweb-text);
    margin: 0 0 0.5rem;
}

.kfzweb-archive__description {
    color: var(--kfzweb-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.kfzweb-pagination {
    margin-top: 2rem;
    text-align: center;
}

.kfzweb-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kfzweb-pagination a,
.kfzweb-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--kfzweb-border);
    border-radius: var(--kfzweb-radius);
    text-decoration: none;
    color: var(--kfzweb-text);
    transition: background var(--kfzweb-transition), border-color var(--kfzweb-transition), color var(--kfzweb-transition);
}

.kfzweb-pagination a:hover {
    background: var(--kfzweb-bg-alt);
    border-color: var(--kfzweb-primary);
    color: var(--kfzweb-primary);
}

.kfzweb-pagination .current {
    background: var(--kfzweb-primary);
    border-color: var(--kfzweb-primary);
    color: #fff;
}

.kfzweb-no-results {
    text-align: center;
    padding: 3rem;
    color: var(--kfzweb-text-muted);
}

/* =========================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================= */

/* Keyframes */
@keyframes kfzweb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes kfzweb-success-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes kfzweb-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kfzweb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes kfzweb-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes kfzweb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes kfzweb-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.kfzweb-loading {
    animation: kfzweb-pulse 1.5s ease-in-out infinite;
}

.kfzweb-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--kfzweb-border);
    border-top-color: var(--kfzweb-primary);
    border-radius: 50%;
    animation: kfzweb-spin 0.8s linear infinite;
}

.kfzweb-loading-spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Skeleton Loading */
.kfzweb-skeleton {
    background: linear-gradient(90deg, var(--kfzweb-bg-alt) 25%, var(--kfzweb-border) 50%, var(--kfzweb-bg-alt) 75%);
    background-size: 200% 100%;
    animation: kfzweb-skeleton 1.5s ease-in-out infinite;
    border-radius: var(--kfzweb-radius);
}

.kfzweb-skeleton-image {
    aspect-ratio: 4/3;
}

.kfzweb-skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.kfzweb-skeleton-text--short {
    width: 60%;
}

.kfzweb-skeleton-text--title {
    height: 1.5em;
    width: 80%;
}

/* Vehicle Card Entrance Animation */
.kfzweb-vehicle {
    animation: kfzweb-fade-in-up 0.4s ease-out both;
}

/* Staggered animation for grid items */
.kfzweb-grid .kfzweb-vehicle:nth-child(1) { animation-delay: 0ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(2) { animation-delay: 50ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(3) { animation-delay: 100ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(4) { animation-delay: 150ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(5) { animation-delay: 200ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(6) { animation-delay: 250ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(7) { animation-delay: 300ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(8) { animation-delay: 350ms; }
.kfzweb-grid .kfzweb-vehicle:nth-child(n+9) { animation-delay: 400ms; }

/* Gallery image fade */
.kfzweb-gallery__image {
    animation: kfzweb-fade-in 0.3s ease-out;
}

/* Thumbnail active state transition */
.kfzweb-gallery__thumb {
    transition: border-color var(--kfzweb-transition), opacity var(--kfzweb-transition), transform var(--kfzweb-transition);
}

.kfzweb-gallery__thumb:hover {
    transform: scale(1.05);
}

/* Success Feedback */
.kfzweb-success-icon {
    animation: kfzweb-success-pop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Button Micro-Interactions */
.kfzweb-btn {
    position: relative;
    overflow: hidden;
}

.kfzweb-btn--primary::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.25) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.6s;
}

.kfzweb-btn--primary:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* Equipment accordion smooth transition */
.kfzweb-equipment__content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, padding 0.3s ease-out;
    padding-bottom: 0;
}

.kfzweb-equipment__section--open .kfzweb-equipment__content {
    display: block;
    max-height: 2000px; /* Large enough for content */
    opacity: 1;
    padding-bottom: 1rem;
}

/* Quick stats entrance */
.kfzweb-quick-stats__item {
    animation: kfzweb-fade-in-up 0.3s ease-out both;
}

.kfzweb-quick-stats__item:nth-child(1) { animation-delay: 0ms; }
.kfzweb-quick-stats__item:nth-child(2) { animation-delay: 50ms; }
.kfzweb-quick-stats__item:nth-child(3) { animation-delay: 100ms; }
.kfzweb-quick-stats__item:nth-child(4) { animation-delay: 150ms; }
.kfzweb-quick-stats__item:nth-child(5) { animation-delay: 200ms; }

/* Price box entrance on single page */
.kfzweb-price-box {
    animation: kfzweb-slide-in-right 0.4s ease-out;
}

/* Feature chips entrance */
.kfzweb-features__chip {
    animation: kfzweb-fade-in-up 0.3s ease-out both;
}

.kfzweb-features__chip:nth-child(n) {
    animation-delay: calc(var(--chip-index, 0) * 30ms);
}

/* Pagination hover */
.kfzweb-pagination a {
    transition: background var(--kfzweb-transition), border-color var(--kfzweb-transition), color var(--kfzweb-transition), transform var(--kfzweb-transition);
}

.kfzweb-pagination a:hover {
    transform: translateY(-2px);
}

.kfzweb-pagination a:active {
    transform: translateY(0);
}

/* Image loading state */
.kfzweb-vehicle__image--loading {
    position: relative;
}

.kfzweb-vehicle__image--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--kfzweb-bg-alt) 25%, var(--kfzweb-border) 50%, var(--kfzweb-bg-alt) 75%);
    background-size: 200% 100%;
    animation: kfzweb-skeleton 1.5s ease-in-out infinite;
}

/* Section title underline animation */
.kfzweb-section__title {
    position: relative;
}

.kfzweb-section__title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--kfzweb-primary);
    transition: width 0.3s ease-out;
}

.kfzweb-section:hover .kfzweb-section__title::after {
    width: 100%;
}

/* =========================================
   REDUCED MOTION (Accessibility)
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .kfzweb-loading {
        animation: none;
        opacity: 0.7;
    }
    
    .kfzweb-skeleton {
        animation: none;
        background: var(--kfzweb-bg-alt);
    }
    
    .kfzweb-vehicle:hover {
        transform: none;
    }
    
    .kfzweb-vehicle:hover .kfzweb-vehicle__image img {
        transform: none;
    }
    
    .kfzweb-btn:active {
        transform: none;
    }
    
    .kfzweb-pagination a:hover {
        transform: none;
    }
    
    .kfzweb-gallery__thumb:hover {
        transform: none;
    }
    
    .kfzweb-section__title::after {
        width: 100%;
        transition: none;
    }
}
