/* =============================================================================
   ARCHIVE / USED CARS LISTING
   ============================================================================= */

.ac-archive-page { background: var(--ac-site-bg); min-height: 60vh; }

/* Page header */
.ac-archive-header { padding: 40px 0 24px; }
.ac-archive-header h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--ac-dark); margin-bottom: 4px; }
.ac-archive-header .ac-stock-count { font-size: .88rem; color: var(--ac-muted); }

/* Layout: sidebar left, results right */
.ac-archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px; align-items: start;
    padding-bottom: 60px;
}

/* ==========================================================================
   FILTER PANEL
   ========================================================================== */
.ac-filter-panel {
    background: #fff;
    border: 1px solid rgba(0,0,0,.07);
    position: sticky;
    top: calc(var(--ac-header-h) + 16px);
    overflow: hidden;
}
.ac-filter-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,.07);
    display: flex; align-items: center; justify-content: space-between;
}
.ac-filter-panel-header h3 {
    font-size: .78rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ac-dark);
}
.ac-filter-clear-all {
    font-size: .75rem; font-weight: 600; color: var(--ac-muted);
    cursor: pointer; transition: color .2s;
}
.ac-filter-clear-all:hover { color: var(--ac-danger); }

/* Filter group */
.ac-filter-group { padding: 14px 20px; border-bottom: 1px solid rgba(0,0,0,.06); }
.ac-filter-group:last-of-type { border-bottom: none; }
.ac-filter-group-label {
    display: block; font-size: .65rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: #aaa; margin-bottom: 10px;
}

/* Inputs */
.ac-filter-input,
.ac-filter-select {
    width: 100%; padding: 9px 12px;
    border: 1px solid rgba(0,0,0,.12); border-radius: 4px;
    font-size: .85rem; color: var(--ac-dark); background: #fafafa;
    transition: border-color .2s, background .2s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23aaa' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.ac-filter-input:focus,
.ac-filter-select:focus { outline: none; border-color: var(--ac-accent); background: #fff; }
.ac-filter-input { background-image: none; }

.ac-filter-range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Body type — SVG icon grid */
.ac-body-type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.ac-body-type-option { position: relative; }
.ac-body-type-option input[type="radio"] {
    position: absolute; opacity: 0; pointer-events: none;
}
.ac-body-type-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 4px 8px;
    border: 1.5px solid rgba(0,0,0,.1); border-radius: 6px;
    cursor: pointer; background: #fafafa;
    transition: all .2s;
}
.ac-body-type-btn .bt-icon { color: #888; transition: color .2s; line-height: 0; }
.ac-body-type-btn .bt-icon svg {
	width: 30px;
}
.ac-body-type-btn .bt-label {
    font-size: .62rem; font-weight: 600; letter-spacing: .04em;
    color: #888; text-align: center; transition: color .2s;
    text-transform: uppercase;
}
.ac-body-type-btn:hover { border-color: rgba(0,0,0,.25); background: #fff; }
.ac-body-type-btn:hover .bt-icon,
.ac-body-type-btn:hover .bt-label { color: var(--ac-dark); }

.ac-body-type-option input:checked + .ac-body-type-btn {
    border-color: var(--ac-dark);
    background: #fff;
}
.ac-body-type-option input:checked + .ac-body-type-btn .bt-icon,
.ac-body-type-option input:checked + .ac-body-type-btn .bt-label { color: var(--ac-dark); }

/* Apply button */
.ac-filter-apply-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 40px); margin: 16px 20px;
    padding: 11px; background: var(--ac-dark); color: var(--ac-white);
    border: none; border-radius: 4px; font-weight: 700; font-size: .8rem;
    letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer; transition: background .2s;
}
.ac-filter-apply-btn:hover { background: #333; }

/* ==========================================================================
   RESULTS AREA
   ========================================================================== */
.ac-results-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
    padding: 12px 16px; background: #fff;
    border: 1px solid rgba(0,0,0,.07);
}
.ac-results-count { font-size: .85rem; color: var(--ac-muted); }
.ac-results-count strong { color: var(--ac-dark); font-weight: 700; }
.ac-results-controls { display: flex; align-items: center; gap: 8px; }

.ac-sort-select {
    padding: 7px 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 4px;
    font-size: .82rem; background: #fafafa; color: var(--ac-dark);
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23aaa' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px;
}
.ac-view-toggle { display: flex; gap: 2px; }
.ac-view-btn {
    width: 32px; height: 32px; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,0,0,.12); color: #bbb;
    cursor: pointer; background: #fafafa; transition: all .2s;
}
.ac-view-btn.active { border-color: var(--ac-dark); color: var(--ac-dark); background: #fff; }
.ac-view-btn:hover { color: var(--ac-dark); }

/* Loading overlay */
.ac-results-wrap { position: relative; min-height: 200px; }
.ac-loading-overlay {
    position: absolute; inset: 0; z-index: 10;
    background: rgba(240,237,232,.8); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.ac-loading-overlay.hidden { display: none; }
.ac-loading-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid rgba(0,0,0,.1); border-top-color: var(--ac-dark);
    animation: ac-spin .7s linear infinite;
}

/* Car grids */
.ac-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.ac-cars-grid--list .ac-car-card { flex-direction: row; }
.ac-cars-grid--list .ac-card-image { width: 240px; min-width: 240px; aspect-ratio: auto; min-height: 170px; }

/* No results */
.ac-no-results { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--ac-muted); }
.ac-no-results h3 { margin-bottom: 8px; color: var(--ac-dark); }

/* Load more */
.ac-load-more { text-align: center; margin-top: 28px; }
.ac-load-more-btn {
    padding: 12px 40px; border: 1.5px solid var(--ac-dark);
    background: transparent; color: var(--ac-dark);
    font-weight: 600; font-size: .85rem; letter-spacing: .06em;
    cursor: pointer; border-radius: 4px; transition: all .2s;
}
.ac-load-more-btn:hover { background: var(--ac-dark); color: #fff; }

/* Mobile */
.ac-mobile-filter-btn { display: none; }

@media (max-width: 900px) {
    .ac-archive-layout { grid-template-columns: 1fr; }
    .ac-filter-panel   { position: static; display: none; }
    .ac-filter-panel.is-open { display: block; margin-bottom: 16px; }
    .ac-mobile-filter-btn {
        display: flex; align-items: center; gap: 8px;
        padding: 10px 16px; border: 1.5px solid var(--ac-dark);
        border-radius: 4px; font-weight: 600; font-size: .85rem;
        background: #fff; cursor: pointer; margin-bottom: 16px; width: 100%;
        justify-content: center;
    }
}
