/* ================================================
   MCF VEHICLES v6 — Sidebar Filter Layout
   ================================================ */

/* ── Layout: Sidebar + Content ── */
.vl-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 72px; /* header height */
}

/* ══════════════════════════════════
   FILTER SIDEBAR  (.vf-sidebar)
   ══════════════════════════════════ */
.vf-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--mcf-white, #fff);
    border-right: 1px solid var(--mcf-gray-mid, #E0E0E0);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    z-index: 100;
}

/* Sidebar Header */
.vf-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
}
.vf-sidebar-title {
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--mcf-black, #1A1A1A);
    display: flex;
    align-items: center;
    gap: 10px;
}
.vf-sidebar-title i {
    font-size: 14px;
    color: var(--mcf-gray, #6B6B6B);
}
.vf-sidebar-close {
    display: none; /* only visible on mobile */
    width: 36px;
    height: 36px;
    border: none;
    background: var(--mcf-gray-light, #F5F5F5);
    border-radius: 10px;
    font-size: 16px;
    color: var(--mcf-gray, #6B6B6B);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.vf-sidebar-close:hover {
    background: var(--mcf-gray-mid, #E0E0E0);
    color: var(--mcf-black, #1A1A1A);
}

/* Sidebar Body (fields) */
.vf-sidebar-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vf-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--mcf-gray, #6B6B6B);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.vf-select,
.vf-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--mcf-gray-mid, #E0E0E0);
    border-radius: 10px;
    font-family: 'Mulish', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--mcf-black, #1A1A1A);
    background: var(--mcf-white, #fff);
    transition: border-color .2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.vf-select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.vf-select:hover, .vf-input:hover { border-color: var(--mcf-gray, #6B6B6B); }
.vf-select:focus, .vf-input:focus { outline: none; border-color: var(--mcf-blue, #0092C7); }

/* Sidebar Footer (buttons) */
.vf-sidebar-foot {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--mcf-gray-mid, #E0E0E0);
}
.vf-search,
.vf-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-family: 'Mulish', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s ease;
    width: 100%;
}
.vf-search { background: var(--mcf-black, #1A1A1A); color: #fff; }
.vf-search:hover { background: var(--mcf-dark, #2D2D2D); transform: translateY(-1px); }
.vf-reset  { background: transparent; color: var(--mcf-gray, #6B6B6B); border: 1px solid var(--mcf-gray-mid, #E0E0E0); }
.vf-reset:hover  { border-color: var(--mcf-black, #1A1A1A); color: var(--mcf-black, #1A1A1A); }

/* Mobile Overlay */
.vf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 299;
    opacity: 0;
    transition: opacity .3s ease;
    cursor: pointer;               /* iOS braucht das fuer click-events auf divs */
    -webkit-tap-highlight-color: transparent;
}
.vf-overlay.is-active {
    display: block;
    opacity: 1;
}

/* Mobile filter button (hidden on desktop) */
.vf-mobile-btn {
    display: none; /* shown on mobile */
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--mcf-white, #fff);
    color: var(--mcf-black, #1A1A1A);
    border: 1.5px solid var(--mcf-gray-mid, #E0E0E0);
    border-radius: 10px;
    font-family: 'Mulish', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s ease;
}
.vf-mobile-btn:hover { background: var(--mcf-gray-light, #F5F5F5); border-color: #bbb; }

/* Active Filter-Tags (above grid) */
.vf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}
.vf-tags:empty { display: none; }
.vf-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 12px;
    background: var(--mcf-black, #1A1A1A);
    color: #fff;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}
.vf-tag-x {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}
.vf-tag-x:hover { color: #fff; }

/* ══════════════════════════════════
   FAHRZEUG-LISTE  (.vl-*)
   ══════════════════════════════════ */
.vl-main {
    flex: 1;
    background: var(--mcf-gray-light, #F5F5F5);
    min-height: calc(100vh - 72px);
    min-width: 0; /* prevent flex overflow */
}
.vl-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 32px 100px;
}

/* Topbar: Anzahl + Sortierung */
.vl-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.vl-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.vl-count {
    font-size: 26px;
    font-weight: 800;
    color: var(--mcf-black, #1A1A1A);
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.vl-count strong { font-size: 30px; }

.vl-sort {
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--mcf-gray-mid, #E0E0E0);
    border-radius: 10px;
    font-family: 'Mulish', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--mcf-black, #1A1A1A);
    background: var(--mcf-white, #fff);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color .2s;
}
.vl-sort:hover { border-color: var(--mcf-blue, #0092C7); }
.vl-sort:focus { outline: none; border-color: var(--mcf-blue, #0092C7); }

/* Grid */
.vl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

/* States */
.vl-loading,
.vl-empty,
.vl-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    font-size: 15px;
    color: var(--mcf-gray, #6B6B6B);
    font-family: 'Mulish', sans-serif;
}
.vl-error { color: #c00; }

/* ══════════════════════════════════
   FAHRZEUG-KARTE  (.vc-*)
   ══════════════════════════════════ */
.vc-card {
    background: var(--mcf-white, #fff);
    border-radius: 16px;
    border: 1px solid var(--mcf-gray-mid, #E0E0E0);
    overflow: hidden;
    cursor: pointer;
    transition: all .3s ease;
}
.vc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,.08);
    border-color: transparent;
}

/* Bild */
.vc-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--mcf-gray-light, #F5F5F5);
    overflow: hidden;
}
.vc-main-img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
    transition: transform .4s ease;
}
.vc-card:hover .vc-main-img { transform: scale(1.04); }

/* Badges oben rechts */
.vc-badges {
    position: absolute;
    top: 12px; right: 12px;
    display: flex; flex-direction: column; gap: 6px;
    z-index: 4;
}
.vc-badge {
    padding: 4px 12px;
    font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.vc-badge-new     { background: var(--mcf-blue, #0092C7); color: #fff; }
.vc-badge-reduced { background: #d32f2f; color: #fff; }

/* ENVKV-Strip */
.vc-envkv-strip {
    display: flex;
    align-items: stretch;
    background: #f7f9f7;
    border: 1px solid #e2e8e2;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}

.vc-envkv-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    flex-shrink: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .3px;
}

.vc-envkv-vals {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    padding: 7px 10px;
    gap: 2px 0;
}
.vc-envkv-val {
    display: flex;
    flex-direction: column;
    padding: 1px 10px 1px 0;
    border-right: 1px solid #dde8dd;
    margin-right: 10px;
}
.vc-envkv-val:last-child { border-right: none; margin-right: 0; }
.vc-envkv-lbl {
    font-size: 8.5px;
    font-weight: 700;
    color: #9aaa9a;
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1;
    white-space: nowrap;
}
.vc-envkv-num {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mcf-black, #1A1A1A);
    white-space: nowrap;
    line-height: 1.3;
}

/* Body */
.vc-body { padding: 20px 20px 16px; }

.vc-maker {
    font-size: 10px; font-weight: 700;
    color: var(--mcf-gray, #6B6B6B); text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 4px;
}
.vc-title {
    font-size: 17px; font-weight: 800; color: var(--mcf-black, #1A1A1A);
    line-height: 1.3; margin: 0 0 16px;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

/* Specs */
.vc-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mcf-gray-mid, #E0E0E0);
}
.vc-spec { display: flex; flex-direction: column; gap: 2px; }
.vc-spec-lbl {
    font-size: 10px; font-weight: 700;
    color: var(--mcf-gray, #6B6B6B); text-transform: uppercase; letter-spacing: .5px;
}
.vc-spec-val { font-size: 13px; font-weight: 600; color: var(--mcf-black, #1A1A1A); }

/* Highlight-Chips */
.vc-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mcf-gray-mid, #E0E0E0);
    min-height: 30px;
}
.vc-chip {
    display: inline-block;
    background: var(--mcf-gray-light, #F5F5F5);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--mcf-dark, #2D2D2D);
    white-space: nowrap;
}

/* Preis */
.vc-price     { font-size: 22px; font-weight: 800; color: var(--mcf-black, #1A1A1A); line-height: 1; letter-spacing: -0.3px; }
.vc-price-tax { font-size: 11px; color: var(--mcf-gray, #6B6B6B); margin-top: 3px; font-weight: 400; }

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */

/* Large desktop: 3 columns in grid */
/* (default above) */

/* Medium: 2 columns in grid */
@media (max-width: 1400px) {
    .vl-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet / small desktop: sidebar narrows */
@media (max-width: 1100px) {
    .vf-sidebar { width: 260px; }
    .vf-sidebar-body { padding: 16px 20px; }
    .vf-sidebar-head { padding: 20px 20px 0; }
    .vf-sidebar-foot { padding: 14px 20px 20px; }
    .vl-inner { padding: 28px 24px 80px; }
}

/* Mobile: sidebar becomes slide-in drawer */
@media (max-width: 860px) {
    .vl-layout {
        flex-direction: column;
        padding-top: 64px; /* mobile header = 64px */
    }

    /* Sidebar as off-canvas drawer */
    .vf-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh; /* iOS safe area */
        z-index: 300;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        padding-top: 0;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
    }
    .vf-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,.15);
    }

    .vf-sidebar-close {
        display: flex;
    }

    .vf-sidebar-body {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

    /* Mobile filter toggle button visible */
    .vf-mobile-btn {
        display: inline-flex;
    }

    .vl-inner { padding: 20px 16px 80px; }

    .vl-topbar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    .vl-topbar-left {
        flex: 1;
        min-width: 0;
    }
    .vl-count { font-size: 20px; }
    .vl-count strong { font-size: 24px; }
    .vl-sort { flex-shrink: 0; }

    .vl-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Very small */
@media (max-width: 480px) {
    .vl-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .vl-topbar-left {
        justify-content: space-between;
    }
    .vl-sort { width: 100%; }
    .vf-sidebar { width: 100%; max-width: 100%; }
}
