.cars-page {
    background-color: #f4f4f4;
    padding: 120px 2% 60px;
    min-height: 100vh;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

.header-text {
    margin-bottom: 50px;
}

.header-text h1 { 
    font-size: 2.5rem; 
    font-weight: 800; 
    margin-bottom: 10px; 
    color: #1a1a1a; 
}

.header-text p { 
    color: #666; 
    max-width: 600px; 
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.car-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
    transition: transform 0.3s ease, border-color 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.car-card:hover {
    transform: translateY(-8px);
    border-color: #008ac9;
}

.car-image {
    position: relative;
    height: 230px;
    overflow: hidden;
    background-color: #fff;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.car-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
    image-rendering: auto;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
}

.car-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: #008ac9;
    color: #fff;
    padding: 8px 15px;
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2;
}

.car-content {
    padding: 20px;
}

.car-content h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.car-sub {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.car-specs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.car-specs span {
    font-size: 0.8rem;
    color: #444;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.car-specs i {
    color: #008ac9;
}

.separator-small {
    border: none;
    border-top: 1px solid #eee;
    margin-bottom: 20px;
}

.btn-primary {
    display: block;
    width: 100%;
    background-color: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #008ac9;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #fff;
    margin: 5vh auto;
    width: 90%;
    max-width: 1100px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    z-index: 100;
    background: rgba(255,255,255,0.8);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-body {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: stretch;
}

.modal-gallery-wrapper {
    position: relative;
    display: flex;
    background: #000;
    height: 550px;
    min-width: 0;
    align-items: center;
    justify-content: center;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 45px;
    height: 60px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    z-index: 10;
}

.nav-arrow:hover { background: rgba(0, 0, 0, 0.8); }
.nav-arrow.prev { left: 0; border-radius: 0 5px 5px 0; }
.nav-arrow.next { right: 0; border-radius: 5px 0 0 5px; }

/* IMAGE MODAL : CORRECTIF PLEIN CADRE ET NETTETÉ */
.modal-image {
    width: 100% !important;
    height: 550px !important;
    display: block !important;
    overflow: hidden;
    background-color: #000;
}

#modalImg {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    /* Amélioration du rendu contre le grain */
    transform: translateZ(0); 
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 550px;
    overflow-y: auto;
    background: #fff;
}

.modal-info h2 { 
    font-size: 1.8rem; 
    margin-bottom: 10px; 
    color: #1a1a1a; 
    font-weight: 800;
}

.modal-price { 
    font-size: 2.2rem; 
    font-weight: 900; 
    color: #008ac9; 
    margin: 15px 0; 
}

.modal-details { 
    margin-bottom: 30px; 
}

.modal-details h3 { 
    font-size: 1rem; 
    margin-bottom: 15px; 
    color: #333; 
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-details ul { 
    list-style: none; 
    padding: 0;
}

.modal-details li { 
    margin-bottom: 10px; 
    font-size: 0.95rem; 
    color: #555; 
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.modal-details li::before { 
    content: "\f00c"; 
    font-family: "Font Awesome 6 Free"; 
    font-weight: 900; 
    color: #008ac9; 
    font-size: 0.8rem;
}

.btn-contact-modal {
    background-color: #008ac9;
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    transition: 0.3s;
    margin-top: auto;
}

.btn-contact-modal:hover { 
    background-color: #1a1a1a; 
}
/* RESPONSIVE */
@media (max-width: 1000px) {
    .modal-body { 
        grid-template-columns: 1fr; 
    }
    .modal-gallery-wrapper { 
        height: 400px; 
    }
    .modal-image {
        height: 400px !important;
    }
    .modal-info { 
        height: auto; 
        padding: 25px; 
    }
    .modal-content { 
        margin: 2vh auto; 
        width: 95%; 
        max-height: 95vh; 
        overflow-y: auto;
    }
}

@media (max-width: 600px) {
    .cars-grid { grid-template-columns: 1fr; }
    .header-text { text-align: center; }
    .header-text h1 { font-size: 2rem; }
    .modal-gallery-wrapper { height: 300px; }
    .modal-image { height: 300px !important; }
    .modal-info h2 { font-size: 1.5rem; }
}