* {
    box-sizing: border-box;
    margin: 0;
    user-select: none;
    outline: none;
    padding: 0;
}

:root {
    --bg-main: #0b0b12;
    --accent: #c2ae8e;
    --surface-glass: #fff1;
    --grid-gap: 10px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--accent);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
}

::-webkit-scrollbar{width: 4px;}
::-webkit-scrollbar-thumb{background: #fff2; border-radius: 10px;}

.app-container {
    width: 100%;
    max-width: 1400px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.badge {
    background: var(--accent);
    color: var(--bg-main);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Section Filtres Fluidifiée */
.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: var(--surface-glass);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--surface-glass);
}

.filter-group,
.custom-select-wrapper,
.price-group {
    flex: 1 1 220px;
    min-width: 0;
}

.search-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--accent);
    pointer-events: none;
}

.search-group input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: var(--bg-main);
    border: 1px solid var(--surface-glass);
    color: var(--accent);
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
}

.search-group input::placeholder {
    color: var(--accent);
    opacity: 0.6;
}

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

/* Select 100% Custom */
.custom-select-wrapper {
    position: relative;
    user-select: none;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-main);
    border: 1px solid var(--surface-glass);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--accent);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--accent);
}

.chevron-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-select.open .chevron-icon {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-main);
    border: 1px solid var(--surface-glass);
    border-radius: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    max-height: 200px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 10px 12px;
    font-size: 0.875rem;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-option:hover {
    background: var(--surface-glass);
}

.custom-option.selected {
    background: var(--surface-glass);
    font-weight: 600;
    border-left: 2px solid var(--accent);
}

/* Range Input */
.price-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.price-badge {
    color: var(--accent);
    font-weight: 600;
}

.price-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-main);
    border-radius: 3px;
    outline: none;
    border: 1px solid var(--surface-glass);
}

.price-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.vehicle-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    grid-auto-rows: calc((100% - var(--grid-gap)) / 2);
    gap: var(--grid-gap);
    overflow: hidden;
    padding-right: 4px;
}


.vehicle-grid {
    transition: opacity 0.15s ease;
}

.vehicle-grid.page-transitioning {
    opacity: 0;
}


@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(2px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vehicle-card {
    background: var(--surface-glass);
    border: 1px solid var(--surface-glass);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    animation: cardEnter 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.vehicle-card:nth-child(1)  { animation-delay: 0.02s; }
.vehicle-card:nth-child(2)  { animation-delay: 0.06s; }
.vehicle-card:nth-child(3)  { animation-delay: 0.10s; }
.vehicle-card:nth-child(4)  { animation-delay: 0.14s; }
.vehicle-card:nth-child(5)  { animation-delay: 0.18s; }
.vehicle-card:nth-child(6)  { animation-delay: 0.22s; }
.vehicle-card:nth-child(7)  { animation-delay: 0.26s; }
.vehicle-card:nth-child(8)  { animation-delay: 0.30s; }
.vehicle-card:nth-child(9)  { animation-delay: 0.34s; }
.vehicle-card:nth-child(10) { animation-delay: 0.38s; }
.vehicle-card:nth-child(11) { animation-delay: 0.42s; }
.vehicle-card:nth-child(12) { animation-delay: 0.46s; }
.vehicle-card:nth-child(13) { animation-delay: 0.50s; }
.vehicle-card:nth-child(14) { animation-delay: 0.54s; }
.vehicle-card:nth-child(15) { animation-delay: 0.58s; }
.vehicle-card:nth-child(16) { animation-delay: 0.62s; }
.vehicle-card:nth-child(17) { animation-delay: 0.66s; }
.vehicle-card:nth-child(18) { animation-delay: 0.70s; }
.vehicle-card:nth-child(19) { animation-delay: 0.74s; }
.vehicle-card:nth-child(20) { animation-delay: 0.78s; }

.image-container {
    width: 100%;
    height: 180px;
    display: flex;
    background: var(--bg-main);
    mask-image: linear-gradient(180deg, white 60%, transparent);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.vehicle-img {
    width: 100%;
    height: 100%;
    padding: 8%;
    object-fit: contain;
    flex-shrink: 0;
}

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.category-pill {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: var(--bg-main);
    border: 1px solid var(--surface-glass);
    border-radius: 6px;
    color: var(--accent);
    text-transform: capitalize;
    white-space: nowrap;
}

.card-model {
    font-size: 0.85rem;
    color: var(--accent);
    opacity: 0.8;
}

.card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: auto;
    padding-top: 8px;
}

/* Footer & Boutons */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--surface-glass);
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    background: var(--bg-main);
    color: var(--accent);
    border: 1px solid var(--surface-glass);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.btn:hover:not(:disabled) {
    background: var(--accent);
    color: var(--bg-main);
}

.btn:active:not(:disabled) {
    transform: scale(0.9);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


.page-info {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    display: flex; align-items: center;
}

.page-info span{
    background: #0006;
    min-width: 22px;
    border-radius: 4px;
    text-align: center;
    margin: 0 4px;
    padding: 4px;
}

/* Adaptations Smartphones */
@media (max-width: 600px) {
    .app-container {
        padding: 12px;
        gap: 12px;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group,
    .custom-select-wrapper,
    .price-group {
        flex: 1 1 100%;
        width: 100%;
    }

    .app-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .btn {
        width: 100%;
    }
}