:root {
    --bg: #0a0a0b;
    --surface: #141416;
    --surface-2: #1c1c1f;
    --border: #2a2a2e;
    --text: #f0f0f2;
    --text-muted: #8a8a95;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.12);
    --orange: #f97316;
    --orange-glow: rgba(249, 115, 22, 0.12);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.12);
    --radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.page--wide {
    max-width: 1200px;
}

.page--narrow {
    max-width: 800px;
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.back-link:hover {
    color: var(--accent);
}

.header-center {
    text-align: center;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.vehicle-count {
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

/* Search */
.search-bar {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
}

/* Filters */
.filter-bar {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-group {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-shrink: 0;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-chip:hover {
    border-color: var(--accent);
}

.filter-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text);
}

/* Sort Bar */
.sort-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-count {
    font-size: 14px;
    color: var(--text-muted);
}

.sort-select {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    min-height: 44px;
}

.sort-select option {
    background: var(--surface-2);
    color: var(--text);
}

/* Vehicle Grid */
.vehicle-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .vehicle-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Vehicle Card */
.vehicle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
    display: block;
}

.vehicle-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59,130,246,0.1);
}

.card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-placeholder {
    width: 100%;
    height: 100%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.card-body {
    padding: 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.card-price {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
}

.card-meta {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.card-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-muted);
}

.card-badge--new {
    background: var(--green-glow);
    color: var(--green);
}

.card-miles {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    margin: 12px 0 8px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-cta {
    display: inline-block;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.empty-cta:hover {
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}

.empty-clear {
    display: block;
    margin: 12px auto 0;
    padding: 10px 20px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.empty-clear:hover {
    border-color: var(--accent);
    color: var(--text);
}

/* Gallery (vehicle.html) */
.gallery {
    margin-bottom: 24px;
}

.main-photo {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-photo-placeholder {
    width: 100%;
    height: 280px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    border-radius: 12px;
}

.thumbnail-strip {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-top: 8px;
}

.thumbnail-strip::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.thumbnail.active {
    border-color: var(--accent);
}

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

/* Vehicle Detail Sections */
.vehicle-header {
    margin-bottom: 20px;
}

.vehicle-title {
    font-size: 24px;
    font-weight: 700;
}

@media (min-width: 640px) {
    .vehicle-title {
        font-size: 28px;
    }
}

.vehicle-stock {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.vehicle-badges {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 8px;
}

.price-section {
    margin-bottom: 20px;
}

.vehicle-price {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    font-weight: 700;
}

/* Primary CTA */
.cta-primary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius);
    text-decoration: none;
    color: white;
    transition: all 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 24px rgba(59,130,246,0.2);
    margin-bottom: 24px;
}

.cta-primary:hover {
    box-shadow: 0 6px 32px rgba(59,130,246,0.35);
    border-color: rgba(59,130,246,0.5);
}

.cta-primary .action-title {
    color: white;
}

.cta-primary .action-subtitle {
    color: rgba(255,255,255,0.7);
}

.cta-primary .action-arrow {
    color: rgba(255,255,255,0.7);
}

.cta-primary:hover .action-arrow {
    color: white;
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 24px 0;
}

@media (min-width: 640px) {
    .specs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.spec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.spec-icon {
    font-size: 16px;
    margin-bottom: 6px;
}

.spec-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.spec-value {
    font-size: 14px;
    font-weight: 600;
}

/* Features */
.features-section {
    margin: 24px 0;
}

.features-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.feature-chip {
    display: inline-block;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px;
}

/* Description */
.description-section {
    margin: 24px 0;
}

.description-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Section Labels */
.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 4px;
}

/* Action Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.action-btn:hover {
    background: var(--surface-2);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59,130,246,0.1);
}

.action-btn:active {
    transform: translateY(0);
}

.action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.icon-primary { background: var(--accent-glow); }
.icon-green { background: var(--green-glow); }
.icon-orange { background: var(--orange-glow); }
.icon-purple { background: var(--purple-glow); }
.icon-white { background: rgba(255,255,255,0.15); }

.action-text {
    flex: 1;
    min-width: 0;
}

.action-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.action-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.action-arrow {
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.action-btn:hover .action-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* Dealer Link */
.dealer-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin: 20px 0;
    transition: color 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dealer-link:hover {
    color: var(--accent);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-brand {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
}

.footer-link {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 8px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.2s; }
.delay-4 { animation-delay: 0.25s; }
.delay-5 { animation-delay: 0.3s; }
.delay-6 { animation-delay: 0.35s; }
.delay-7 { animation-delay: 0.4s; }
