/* Styles pour les images de la page matériel */

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.listing-image:hover {
    transform: scale(1.05);
}

/* Gestion des images manquantes */
.listing-image[src*="voiture.jpg"] {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.listing-image[src*="voiture.jpg"]::after {
    content: "🖼️";
    font-size: 2rem;
    color: #6c757d;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Animation de chargement des images */
.listing-image {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gestion des erreurs d'images */
.listing-image.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.listing-image.error::after {
    content: "❌";
    font-size: 1.5rem;
    color: #721c24;
}

/* Responsive design pour les images */
@media (max-width: 768px) {
    .listing-image {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .listing-image {
        height: 120px;
    }
}

/* Amélioration de l'affichage des grilles d'images */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.listing-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Styles pour les images de fallback */
.image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
    min-height: 200px;
}

.image-fallback-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}
