/* ================ 4 MODES D'AFFICHAGE ================ */

/* MODE 1: CAROUSEL HORIZONTAL (mode initial) */
.annonces-carousel.carousel-view {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 7px;
    padding: 1rem 0;
    padding-top: 0px;
    scrollbar-width: thin;
}

.annonces-carousel.carousel-view .annonce-card {
    margin-bottom: 0;
   /* flex: 0 0 205px;
    scroll-snap-align: start;
    height: 415px;
    flex: 0 0 185px;
    scroll-snap-align: start;
    height: 370px;  */  
    /*flex: 0 0 210px;*/
    scroll-snap-align: start;
    /*height: 527px;     */
    background: #fff;
}

.annonce-card .line-clamp-2 {
    line-height: 1.3 !important;
    font-size: 0.90rem;
    /* line-height: 1.3; */
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-top: 9px;
    min-height: 45px;
    margin-bottom: 0px;    
}



    
    /* Mode Mosaïque très mobile */
    .annonces-carousel.mosaic-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .annonces-carousel.mosaic-view .annonce-card {
        /*height: 220px;*/
    }
    
    /* Masquer certains éléments en mode mobile compact */
    .annonce-meta .action-btn:not(:first-child) {
        display: none;
    }
    
    .vendeur-stats-compact .count-item {
        display: none;
    }
    
    .subcategory-badges-container {
        flex-wrap: nowrap;
        overflow: hidden;
        display: none !important;
    }
    
    .subcategory-badge {
        max-width: 155px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


/* ================ TRANSITIONS FLUIDES ================ */
.annonces-carousel,
.annonce-card,
.view-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================ BOUTONS DE VUE (4 boutons) ================ */
.view-toggle {
    display: flex;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.view-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.view-btn.active {
    background: #0f8f3e;
    color: white;
}

.view-btn i {
    font-size: 1rem;
}

/* Petit écran : réduire l'espacement */
@media (max-width: 640px) {
    .view-btn {
        padding: 0.4rem 0.6rem;
        min-width: 40px;
    }
    
    .view-btn i {
        font-size: 0.9rem;
    }
}

/* ================ AMÉLIORATIONS VISUELLES ================ */
/*
.annonce-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
}
*/

.annonce-price {
    font-weight: 700;
    color: #0f8f3e;
}

.annonce-image-container {
  /*  border-radius: 10px;*/
}

/* Badges améliorés */
.subcategory-badge {
    backdrop-filter: blur(10px);
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-width: 1px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.2);
    border-image: initial;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
}

/* Scrollbar améliorée pour le mode carousel */
.annonces-carousel.carousel-view::-webkit-scrollbar {
    height: 6px;
}

.annonces-carousel.carousel-view::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.annonces-carousel.carousel-view::-webkit-scrollbar-thumb {
    background: #0f8f3e;
    border-radius: 3px;
}

.annonces-carousel.carousel-view::-webkit-scrollbar-thumb:hover {
    background: #c2410c;
}

/* Pour Firefox */
.annonces-carousel.carousel-view {
   /* scrollbar-width: thin;
    scrollbar-color: #0f8f3e #f1f1f1;*/
    overflow-x: hidden !important;
        scrollbar-width: none !important;
        overflow-y: hidden !important;     
}

/* Icône spécifique pour le mode carousel */
.fa-grip-horizontal:before {
    content: "\f58d";
}

/********** OPTIMISATION CSS ********/

/* RESET ET OPTIMISATION FORCÉE */
img {
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    max-width: 100%;
    height: auto;
    display: block;
    aspect-ratio: attr(width) / attr(height);
}

/* POUR MOBILE - QUALITÉ RÉDUITE */
@media (max-width: 768px) {
    img {
        image-rendering: optimizeSpeed;
        -webkit-optimize-contrast: economy;
    }
}

/* LAZY LOADING VISUEL */
img[loading="lazy"] {
    background: #fff;
    transition: opacity 0.3s;
}

/***********************/

