/* Styles de base pour le corps */
/* Désactiver complètement le défilement horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    background: #fff;
}

/* Structure principale */
.main-layout {
    display: flex;
    height: calc(100vh - 80px); /* 80px = hauteur du header */
    overflow: hidden; /* Désactive tout débordement */
}

/* Style de base - ascenseurs cachés */
.annonces-content,
.filters-sidebar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Masquer la scrollbar WebKit par défaut */
.annonces-content::-webkit-scrollbar,
.filters-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

/* Afficher la scrollbar au focus/hover */
.annonces-content:focus::-webkit-scrollbar,
.annonces-content:hover::-webkit-scrollbar,
.filters-sidebar:focus::-webkit-scrollbar,
.filters-sidebar:hover::-webkit-scrollbar {
    display: block;
    width: 8px;
    height: 8px;
}

/* Style de la scrollbar visible */
.annonces-content::-webkit-scrollbar-thumb,
.filters-sidebar::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.4);
    border-radius: 4px;
}

.annonces-content::-webkit-scrollbar-thumb:hover,
.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.8);
}

/* Assurer que le contenu reste scrollable */
.annonces-content,
.filters-sidebar {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Animation fluide */
.annonces-content,
.filters-sidebar {
    transition: scrollbar-color 0.3s ease; /* Firefox */
}

.annonces-content:hover,
.filters-sidebar:hover,
.annonces-content:focus,
.filters-sidebar:focus {
    scrollbar-color: rgba(249, 115, 22, 0.4) transparent; /* Firefox */
}

/* Style pendant le défilement */
.scrolling-active {
    outline: 2px solid rgba(249, 115, 22, 0.3);
    outline-offset: -2px;
}

/* Transition fluide */
.annonces-content,
.filters-sidebar {
    transition: outline 0.2s ease, scrollbar-color 0.3s ease;
}

@supports (scrollbar-color: auto) {
    .annonces-content,
    .filters-sidebar {
        scrollbar-color: transparent transparent;
        scrollbar-width: thin;
    }
    
    .annonces-content:hover,
    .annonces-content:focus,
    .filters-sidebar:hover,
    .filters-sidebar:focus {
        scrollbar-color: rgba(249, 115, 22, 0.4) transparent;
    }
}

/*********************MENU GAUCHE - ASCENSEUR************/

/* Style général du sidebar */
#categories-panel {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(249, 115, 22, 0.2) transparent; /* Firefox plus transparent */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* WebKit Scrollbar (Chrome, Safari, Edge) */
#categories-panel::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#categories-panel::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

#categories-panel::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.15); /* Transparence augmentée */
    border-radius: 3px;
    border: 1px solid transparent; /* Bordure transparente */
    transition: background 0.3s ease;
}

#categories-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.3); /* Légèrement plus visible au hover */
}

/* Style pour le mode compact */
#categories-panel.sidebar-compact::-webkit-scrollbar {
    width: 4px;
}

#categories-panel.sidebar-compact::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.1); /* Encore plus discret en mode compact */
}

/* Animation fluide */
#categories-panel {
    transition: scrollbar-color 0.3s ease;
}

#categories-panel:hover {
    scrollbar-color: rgba(249, 115, 22, 0.25) transparent; /* Firefox */
}

/* Style mobile spécifique */
@media (max-width: 1024px) {
    #categories-panel {
        scrollbar-width: none;
    }
    
    #categories-panel::-webkit-scrollbar {
        display: none;
    }
    
    #categories-panel.mobile-visible {
        scrollbar-width: thin;
        scrollbar-color: rgba(249, 115, 22, 0.15) transparent;
    }
    
    #categories-panel.mobile-visible::-webkit-scrollbar {
        display: block;
        width: 4px;
    }
    
    #categories-panel.mobile-visible::-webkit-scrollbar-thumb {
        background: rgba(249, 115, 22, 0.15);
    }
}

/*******************************************
*******************************************/

/* Colonne des annonces */
.annonces-content {
    flex: 1;
    overflow-y: auto; /* Ascenseur vertical seulement */
    overflow-x: hidden;
    padding: 1rem;
}

/* Panneau des filtres */
.filters-sidebar {
    overflow-y: auto; /* Ascenseur vertical indépendant */
    overflow-x: hidden;
    height: calc(100vh - 80px);
}

/* Correction pour mobile */
/* Nouveau style mobile */
@media (max-width: 1025px) {
    .main-layout {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 80px); /* S'adapte au contenu */
    }
    
    .annonces-content {
        flex: 1;
        overflow-y: visible; /* Scroll naturel */
        padding: 0.5rem;
    }
    
    /* Correction pour le header fixe */
    body {
        padding-top: 0px; /* Compense le header fixe */
    }
}
/* Styles de l'en-tête */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Style pour le conteneur de recherche */
.search-container {
    position: relative;
    flex: 1 1 auto;
    transition: width 0.3s ease;
}

.search-input {
    width: 105%;
    padding: 10px 12px 11px 36px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: rgba(75, 85, 99, var(--tw-text-opacity));
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.3s ease;
}

.search-input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px #ea580c;
}

.search-container .fa-search {
    position: absolute;
    font-size: 0.875rem;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 10rem;
    overflow-y: auto;
    z-index: 100;
}

.search-suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.search-suggestion-item:hover {
    background: #ea580c;
    color: white;
}

/* Styles des boutons de navigation */
.nav-btn {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #333333;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
    gap: 8px;
}

.nav-btn:hover {
    background: #ea580c;
    color: #ffffff;
}

.nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ea580c;
}

/* Style spécifique pour le bouton Publier */
#publish-btn {
    background: #ea580c;
    color: #ffffff;
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    min-width: 225px !important;
}

#publish-btn:hover {
    background: #E05D00;
    transform: scale(1.02);
}

#publish-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ea580c;
}

#publish-btn i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* Styles pour le panneau de catégories */
/* ==================== SIDEBAR ==================== */
#categories-panel {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 300px;
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#categories-panel::-webkit-scrollbar {
    width: 0;
    transition: width 0.2s ease;
}

#categories-panel:hover::-webkit-scrollbar {
    width: 8px;
}

#categories-panel::-webkit-scrollbar-track {
    background: transparent;
}

#categories-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

#categories-panel:hover {
    scrollbar-width: thin;
}

#sidebar-hover-zone {
    width: 20px;
    height: 100%;
    position: absolute;
    left: 0;
}

/* Sidebar compact mode */
#categories-panel.sidebar-compact {
    width: 60px;
    padding: 16px 8px;
    z-index: 10;
}

#categories-panel.sidebar-compact .sidebar-text,
#categories-panel.sidebar-compact .panel-title,
#categories-panel.sidebar-compact .category-title,
#categories-panel.sidebar-compact .payment-methods {
    display: none;
}

#categories-panel.sidebar-compact .category-item,
#categories-panel.sidebar-compact .ad-type-item,
#categories-panel.sidebar-compact .tontine-item {
    justify-content: center;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 8px;
}

#categories-panel.sidebar-compact .category-item i,
#categories-panel.sidebar-compact .ad-type-item span.w-2,
#categories-panel.sidebar-compact .tontine-item i {
    font-size: 1em;
}

#categories-panel.sidebar-compact .pin-sidebar {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 8px;
}

#sidebar-toggle.active,
#sidebar-state-toggle.active,
#pin-sidebar.pinned {
    background: #4b5563;
    color: white;
    padding-left: 4px;
    padding-right: 4px;
}

/* Sidebar items */
.category-item,
.ad-type-item,
.tontine-item {
    transition: all 0.2s ease;
}

.category-item:hover,
.ad-type-item:hover,
.tontine-item:hover {
    background-color: #fed7aa;
    transform: scale(1.05);
}

#categories-panel.sidebar-compact .category-item:hover,
#categories-panel.sidebar-compact .ad-type-item:hover,
#categories-panel.sidebar-compact .tontine-item:hover {
    background-color: #fed7aa;
    transform: scale(1.05);
}

#categories-panel.sidebar-compact .category-item.active,
#categories-panel.sidebar-compact .ad-type-item.active,
#categories-panel.sidebar-compact .tontine-item.active {
    background-color: #ea580c;
    color: white;
}

#categories-panel.sidebar-compact .panel-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

#categories-panel.sidebar-compact .category-section::after,
#categories-panel.sidebar-compact .ad-type-section::after,
#categories-panel.sidebar-compact .tontine-section::after {
    content: '';
    display: block;
    width: 80%;
    height: 1px;
    background-color: #e5e7eb;
    margin: 12px auto;
}

/* Styles pour les contrôles de la carte */
.map-controls {
    position: fixed;
    bottom: 6.5rem;
    right: 0.5rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: all 200ms ease;
}

.control-btn:hover,
.control-btn.active,
.control-btn:active {
    background-color: #ea580c;
    color: #ffffff;
}

.control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ea580c;
}

.control-btn i {
    font-size: 1.125rem;
}

/* Style pour le copyright */
.copyright {
    position: fixed;
    bottom: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    font-size: 0.75rem;
    padding: 3px 20px;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: 'Arial', sans-serif;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    min-width: 250px;
}

.copyright a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
}

.copyright a:hover {
    text-decoration: underline;
}

/* Styles spécifiques à annonces.php */
/*************************************************/

/* REMPLACER VOTRE CSS EXISTANT PAR CES MODIFICATIONS */

/* Layout principal - inchangé */
.main-layout {
    display: flex;
    flex-direction: row;
    margin-top: 80px;
    margin-left: 300px;
    transition: margin-left 0.3s ease;
}

.main-layout.sidebar-compact {
    margin-left: 60px;
}

.annonces-content {
    flex-grow: 1;
    padding: 1rem; /* Réduit de 1.5rem à 1rem */
    box-sizing: border-box;
    z-index: 20;
}

/* Vue grille - OPTIMISÉE pour plus d'annonces */
.annonces-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

/* Cartes d'annonces compactes */
.annonce-card {
    height: 280px;
    display: flex;
    flex-direction: column;
}

.annonce-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.annonce-card {
  will-change: transform, opacity;
}


/* Style pour le badge sponsorisé */
.type-badge.bg-purple-600 {
    background-color: #6B46C1; /* Violet pour le badge sponsorisé */
}



/* Titre compact */
.annonce-card h2 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Prix en évidence mais compact */
.annonce-card .text-xl {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Info compacte (catégorie + date) */
.annonce-card .text-sm {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

/* Rating compact */
.rating {
    margin-bottom: 0.5rem;
    gap: 1px;
}

.rating i {
    font-size: 0.75rem;
}

/* Description compacte */
.annonce-card .line-clamp-2 {
    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: 5px;    
}

/* Boutons d'action compacts */
.annonce-card .flex.gap-2 {
    gap: 0.25rem;
    margin-top: auto;
}

.action-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-height: 32px;
}

.action-btn i {
    font-size: 0.75rem;
}

/* Badges compacts */
.type-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
}

.absolute.top-3.right-3 {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem;
}

.absolute.top-3.left-3 {
    top: 0.5rem;
    left: 0.5rem;
}

/* Vue liste - optimisée pour annonces normales et sponsorisées */
.annonces-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.annonces-grid.list-view .annonce-card,
.annonces-grid.list-view .sponsored-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.annonces-grid.list-view .annonce-image {
    width: 180px;
    height: 120px;
    flex-shrink: 0;
}

/* Vue mosaïque - optimisée pour annonces normales et sponsorisées */
.annonces-grid.mosaic-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.annonces-grid.mosaic-view .annonce-card,
.annonces-grid.mosaic-view .sponsored-card {
    height: 200px;
}

.annonces-grid.mosaic-view .annonce-image {
    height: 100px;
}

/* RESPONSIVE - Optimisations mobiles */
@media (max-width: 1200px) {
    .annonces-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* RESPONSIVE MOBILE - Vues miniatures */
@media (max-width: 640px) {
    .px-4 {
        padding-left: 0rem;
        padding-right: 0rem;
    }
    
    /* Vue grille mobile - miniature */
    .annonces-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    
    .annonces-grid.grid-view .annonce-card,
    .annonces-grid.grid-view .sponsored-card {
        height: 200px;
        border-radius: 6px;
    }
    
    .annonces-grid.grid-view .annonce-image {
        height: 80px;
    }
    
    .annonces-grid.grid-view .p-4 {
        padding: 0.5rem;
    }
    
    .annonces-grid.grid-view h2 {
        font-size: 0.75rem;
        line-height: 1.1;
        -webkit-line-clamp: 1;
        margin-bottom: 0.25rem;
    }
    
    .annonces-grid.grid-view .text-xl {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .annonces-grid.grid-view .text-sm {
        font-size: 0.625rem;
        gap: 0.25rem;
        margin-bottom: 0.25rem;
    }
    
    .annonces-grid.grid-view .rating {
        margin-bottom: 0.25rem;
        overflow: hidden;
    }
    
    .annonces-grid.grid-view .rating i {
        font-size: 0.625rem;
    }
    
    .annonces-grid.grid-view .line-clamp-2 {
        font-size: 0.625rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 1;
    }
    
    .annonces-grid.grid-view .action-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.625rem;
        min-height: 24px;
    }
    
    .annonces-grid.grid-view .action-btn i {
        font-size: 0.625rem;
    }
    
    /* Vue liste mobile - miniature */
    .annonces-grid.list-view {
        gap: 0.5rem;
    }
    
    .annonces-grid.list-view .annonce-card,
    .annonces-grid.list-view .sponsored-card {
        height: 80px;
        border-radius: 6px;
    }
    
    .annonces-grid.list-view .annonce-image {
        width: 100px;
        height: 80px;
    }
    
    .annonces-grid.list-view .p-4 {
        padding: 0.5rem;
        justify-content: space-between;
    }
    
    .annonces-grid.list-view h2 {
        font-size: 0.75rem;
        line-height: 1.1;
        -webkit-line-clamp: 1;
        margin-bottom: 0.125rem;
    }
    
    .annonces-grid.list-view .text-xl {
        font-size: 0.875rem;
        margin-bottom: 0.125rem;
    }
    
    .annonces-grid.list-view .text-sm {
        font-size: 0.625rem;
        gap: 0.25rem;
        margin-bottom: 0.125rem;
    }
    
    .annonces-grid.list-view .rating {
        margin-bottom: 0.125rem;
        overflow: hidden;
    }
    
    .annonces-grid.list-view .rating i {
        font-size: 0.625rem;
    }
    
    .annonces-grid.list-view .line-clamp-2 {
        display: none;
    }
    
    .annonces-grid.list-view .flex.gap-2 {
        gap: 0.125rem;
        flex-wrap: nowrap;
    }
    
    .annonces-grid.list-view .action-btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.625rem;
        min-height: 20px;
        flex: 1;
    }
    
    .annonces-grid.list-view .action-btn i {
        font-size: 0.625rem;
        margin-right: 0.125rem;
    }
    
    /* Vue mosaïque mobile - miniature */
    .annonces-grid.mosaic-view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.375rem;
    }
    
    .annonces-grid.mosaic-view .annonce-card,
    .annonces-grid.mosaic-view .sponsored-card {
        height: 140px;
        border-radius: 6px;
    }
    
    .annonces-grid.mosaic-view .annonce-image {
        height: 60px;
    }
    
    .annonces-grid.mosaic-view .p-4 {
        padding: 0.375rem;
    }
    
    .annonces-grid.mosaic-view h2 {
        font-size: 0.625rem;
        line-height: 1.1;
        -webkit-line-clamp: 1;
        margin-bottom: 0.125rem;
    }
    
    .annonces-grid.mosaic-view .text-xl {
        font-size: 0.75rem;
        margin-bottom: 0.125rem;
    }
    
    .annonces-grid.mosaic-view .text-sm {
        display: none;
    }
    
    .annonces-grid.mosaic-view .rating {
        margin-bottom: 0.125rem;
        overflow: hidden;
    }
    
    .annonces-grid.mosaic-view .rating i {
        font-size: 0.5rem;
    }
    
    .annonces-grid.mosaic-view .line-clamp-2 {
        display: none;
    }
    
    .annonces-grid.mosaic-view .flex.gap-2 {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .annonces-grid.mosaic-view .action-btn {
        padding: 0.25rem;
        font-size: 0.5rem;
        min-height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .annonces-grid.mosaic-view .action-btn i {
        font-size: 0.5rem;
        margin-right: 0;
    }
    
    .annonces-grid.mosaic-view .action-btn:first-child {
        flex: 1;
    }
    
    .annonces-grid.mosaic-view .action-btn:not(:first-child) {
        width: 100%;
        padding: 0.125rem;
    }
}
    

/******************************ANNONCES SPONSORISES***************************/

/****************************** ANNONCES SPONSORISÉES ***************************/

/* Style de base pour les cartes sponsorisées */


/* Badge "Sponsorisé" */
.type-badge.bg-purple-600 {
    background-color: #6B46C1 !important;
}

/* Couleurs spécifiques pour les sponsors */
.sponsored-card .text-yellow-600 {
    color: #D97706 !important;
}

.sponsored-card .text-yellow-500 {
    color: #F59E0B !important;
}

.sponsored-card .bg-yellow-500 {
    background-color: #F59E0B !important;
}

.sponsored-card .hover\:bg-yellow-600:hover {
    background-color: #D97706 !important;
}

.sponsored-card .focus\:ring-yellow-500:focus {
    --tw-ring-color: #F59E0B !important;
}

.sponsored-card .group-hover\:text-yellow-600:hover {
    color: #D97706 !important;
}

/* Animation discrète pour les cartes sponsorisées */
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.sponsored-card:hover {
 /*   animation: subtlePulse 1.5s infinite;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);*/
}

/* Icône étoile pour les sponsors */
.sponsored-card .fa-star {
    color: #F59E0B !important;
}

/* Style des boutons pour les sponsors */
.sponsored-card .action-btn {
    transition: all 0.2s ease;
}

/* Styles spécifiques pour chaque vue */

/* VUE GRILLE */
.annonces-grid.grid-view .sponsored-card {
    height: 280px;
    display: flex;
    flex-direction: column;
}

/* VUE LISTE */
.annonces-grid.list-view .sponsored-card {
    display: flex;
    flex-direction: row;
    height: 120px;
}

.annonces-grid.list-view .sponsored-card .annonce-image {
    width: 180px;
    height: 120px;
}

/* VUE MOSAIQUE */
.annonces-grid.mosaic-view .sponsored-card {
    height: 200px;
}

.annonces-grid.mosaic-view .sponsored-card .annonce-image {
    height: 100px;
}

/* RESPONSIVE MOBILE */
@media (max-width: 640px) {
    /* Vue grille mobile */
    .annonces-grid.grid-view .sponsored-card {
        height: 200px;
    }
    
    /* Vue liste mobile */
    .annonces-grid.list-view .sponsored-card {
        height: 80px;
    }
    
    .annonces-grid.list-view .sponsored-card .annonce-image {
        width: 100px;
        height: 80px;
    }
    
    /* Vue mosaïque mobile */
    .annonces-grid.mosaic-view .sponsored-card {
        height: 140px;
    }
    
    .annonces-grid.mosaic-view .sponsored-card .annonce-image {
        height: 60px;
    }
}

/* Effet de surbrillance au survol */
.sponsored-card:hover {
  /*  box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.2), 
                0 4px 6px -4px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);*/
}

/* Style du badge catégorie pour les sponsors */
.sponsored-card .absolute.top-3.right-3 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style du texte de description */
.sponsored-card .text-gray-600 {
    color: #4B5563 !important;
}

/* Style des icônes d'information */
.sponsored-card .text-gray-500 {
    color: #6B7280 !important;
}

/* Style des boutons secondaires */
.sponsored-card .bg-gray-100 {
    background-color: #F3F4F6 !important;
}

.sponsored-card .hover\:bg-red-100:hover {
    background-color: #FEE2E2 !important;
}

.sponsored-card .hover\:bg-blue-100:hover {
    background-color: #DBEAFE !important;
}

    /* Badges mobiles - tous les modes */
    /***************************************************************************/
    .type-badge {
        padding: 0.125rem 0.25rem;
        font-size: 0.5rem;
        border-radius: 0.25rem;
    }
    
    .absolute.top-3.right-3 {
        top: 0.25rem;
        right: 0.25rem;
        padding: 0.125rem;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .absolute.top-3.right-3 i {
        font-size: 0.5rem;
    }
    
    .absolute.top-3.left-3 {
        top: 0.25rem;
        left: 0.25rem;
    }
    
    /* État vide mobile */
    .empty-state {
        padding: 2rem 1rem !important;
    }
    
    .empty-state i {
        font-size: 2rem !important;
    }
    
    .empty-state h3 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
    }
}

/* Breakpoint très petit écran (iPhone SE, etc.) */
@media (max-width: 375px) {
    .annonces-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .annonces-grid.mosaic-view {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .annonces-grid.list-view .annonce-image {
        width: 80px;
    }
}


/*section des boutons de vue :*/
/*********************************************/
.view-btn {
    min-width: 36px; /* Empêche la disparition */
    transition: all 0.2s ease;
}

.view-toggle {
    min-width: fit-content; /* Garde la taille constante */
}

.view-btn.active {
    background-color: #ea580c;
    color: white;
}

/* Styles pour le panneau de filtres */
.filters-sidebar {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

.filters-sidebar.hidden {
    transform: translateX(100%);
    opacity: 0;
    width: 0;
    border: none;
}

.main-layout.filters-hidden {
    margin-right: 0;
}

/* Bouton toggle filters */
#toggle-filters-sidebar.active {
    background-color: #ea580c;
    color: white;
}

@media (max-width: 1025px) {
    .filters-sidebar {
        position: fixed;
        top: 80px;
        right: 0;
        bottom: 0;
        z-index: 40;
        transform: translateX(100%);
    }
    
    .filters-sidebar.visible {
        transform: translateX(0);
    }
}

/* Bouton filtre mobile */
#toggle-filters-mobile {
    display: none; /* Caché par défaut */
}

@media (max-width: 1024px) {
    #toggle-filters-mobile {
        display: flex; /* Visible seulement sur mobile/tablette */
    }
    
    #toggle-filters-sidebar {
        display: none; /* Cache le bouton desktop sur mobile */
    }
    
    /* Ajustement du padding pour compenser le header fixe */
    .annonces-content {
        padding-top: 0.5rem;
    }
}

/* Style spécifique pour l'icône du bouton filtre mobile */
#toggle-filters-mobile i.fa-filter {
    font-size: 1.1rem; /* Taille légèrement plus grande */
    color: white; /* Couleur blanche explicite */
    transition: transform 0.2s ease;
}

#toggle-filters-mobile:hover i.fa-filter {
    transform: scale(1.1); /* Effet de zoom au survol */
}

/* Style pour le bouton desktop */
#toggle-filters-sidebar i {
    font-size: 1rem;
    color: #4b5563; /* Couleur grise pour le mode desktop */
    transition: all 0.2s ease;
}

#toggle-filters-sidebar:hover i {
    color: white; /* Devient blanc au survol */
}

#toggle-filters-sidebar.active i {
    color: white; /* Blanc quand actif */
}

/* Styles pour les popups Leaflet */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: 280px;
}

.region-popup, .ad-popup, .user-location-popup {
    background: transparent;
}

.region-popup .interactive, .ad-popup .interactive, .user-location-popup .interactive {
    pointer-events: none;
    width: 100%;
}

.region-popup .labels-container, .ad-popup .labels-container, .user-location-popup .labels-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.region-popup .labels-container:hover, .ad-popup .labels-container:hover, .user-location-popup .labels-container:hover {
    background: rgba(255, 165, 0, 0.1);
}

.region-popup .buttons-container, .ad-popup .buttons-container, .user-location-popup .buttons-container {
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.region-popup button, .ad-popup button, .user-location-popup button {
    pointer-events: auto;
    flex: 1 1 calc(50% - 3px);
    padding: 6px 8px;
    font-size: 0.75rem;
    line-height: 1.25;
}

.region-popup .text-content, .ad-popup .text-content, .user-location-popup .text-content,
.ad-popup img {
    pointer-events: none;
}

/* Styles pour le menu mobile */
#toggle-categories {
    display: none !important;
}

#map-btn span, #alerts-btn span, #favorites-btn span {
    display: block;
}

/* Media queries */
@media (max-width: 1095px) {
    .search-input {
        width: 100% !important;
    }
    
}
/* Media queries */
@media (max-width: 640px) {
    .app-header {
        height: auto;
        min-height: 120px;
        padding: 8px;
    }

    .header-left {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .header-right {
        margin-top: 8px;
        justify-content: center;
        gap: 8px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .nav-btn i {
        font-size: 0.8rem;
        margin-right: 4px;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        padding: 6px 12px 6px 36px;
        font-size: 0.75rem;
    }

    .search-input:focus {
        width: 100%;
    }

    .search-container .fa-search {
        font-size: 0.75rem;
        left: 10px;
    }

    #publish-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        width: 100%;
        justify-content: center;
    }

    #publish-btn i {
        font-size: 0.8rem;
    }

    .categories-sidebar, .filters-sidebar {
        display: none;
    }

    .main-layout {
        margin-left: 0 !important;
        margin-top: 100px;
    }

    .map-controls {
        bottom: 6rem;
        gap: 0.75rem;
    }

    .control-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .control-btn i {
        font-size: 1rem;
    }

    .copyright {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    #categories-panel {
        width: 100%;
        transform: translateX(-100%);
        z-index: 60;
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }

    #categories-panel.mobile-visible {
        transform: translateX(0);
    }

    #categories-panel.sidebar-compact {
        display: none;
    }

    #pin-sidebar {
        display: none;
    }

    .sidebar-overlay {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 50;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    #toggle-categories {
        display: block !important;
    }

    #map-btn span, #alerts-btn span, #favorites-btn span {
        display: none;
    }
}


@media (min-width: 641px) and (max-width: 1026px) { 
    .app-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 80px;
        padding: 8px 12px;
    }

    .header-left {
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
    }

    .search-container {
        flex: 1;
        min-width: 200px;
        max-width: 350px;
    }

    .header-right {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 8px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .nav-btn i {
        font-size: 0.9rem;
        margin-right: 4px;
    }

    #publish-btn {
       /* padding: 6px 12px;
        font-size: 0.8rem;*/
    }

    #publish-btn i {
        font-size: 0.9rem;
    }

    .search-input {
        padding: 10px 12px 11px 36px;
        font-size: 0.8rem;
    }

    .search-container .fa-search {
        font-size: 0.8rem;
        left: 10px;
    }
}

@media (min-width: 1026px) {
    .app-header {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .header-left {
        width: auto;
        flex-wrap: nowrap;
    }

    .search-container {
        min-width: 300px;
        max-width: 500px;
    }

    .header-right {
        margin-top: 0;
        gap: 8px;
    }
}

@media (min-width: 1391px) {
    .search-container {
        min-width: 300px;
        max-width: 500px;
    }

    .search-input:focus {
        width: 600px;
        border-color: transparent;
        box-shadow: 0 0 0 2px #ea580c;
    }
}

/*****************************************/
/******************************************/

.annonce-image {
    height: 160px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

.placeholder-icon {
    background: 
        linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.8)),
        repeating-linear-gradient(
            -45deg,
            #f3f4f6,
            #f3f4f6 10px,
            #e5e7eb 10px,
            #e5e7eb 20px
        );
    z-index: 1;
}

/* Style pour les annonces sponsorisées */
.sponsored-card .placeholder-icon {
    background: 
        linear-gradient(rgba(255,248,225,0.8), rgba(255,248,225,0.8)),
        repeating-linear-gradient(
            -45deg,
            #fffbeb,
            #fffbeb 10px,
            #fef3c7 10px,
            #fef3c7 20px
        );
}

.sponsored-card .placeholder-icon i {
    color: #d97706 !important;
}

/* Version mobile */
@media (max-width: 640px) {
    .annonce-image {
        height: 120px;
    }
    .placeholder-icon i {
        font-size: 2rem;
    }
    .placeholder-icon span {
        font-size: 0.7rem;
    }
}

/***************************************************
****************************************************/

/* Style du placeholder (inspiré d'Unsplash) */
.placeholder-content {
    background-image: 
        linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(245,245,245,0.8) 100%),
        repeating-linear-gradient(
            45deg,
            rgba(229, 231, 235, 0.5),
            rgba(229, 231, 235, 0.5) 10px,
            rgba(243, 244, 246, 0.5) 10px,
            rgba(243, 244, 246, 0.5) 20px
        );
}

/* Version sponsorisée */
.sponsored-card .placeholder-content {
    background-image: 
        linear-gradient(135deg, rgba(255, 251, 235, 0.8) 0%, rgba(254, 243, 199, 0.8) 100%),
        repeating-linear-gradient(
            45deg,
            rgba(253, 230, 138, 0.4),
            rgba(253, 230, 138, 0.4) 10px,
            rgba(254, 243, 199, 0.4) 10px,
            rgba(254, 243, 199, 0.4) 20px
        );
}

/* Mobile */
@media (max-width: 640px) {
    .annonce-image { height: 120px; }
    .placeholder-content i { font-size: 2.5rem; }
}

/***********************************/

/* Styles améliorés pour les badges d'annonces */
.type-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    background-color: #3b82f6;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Badge pour les annonces sponsorisées */
.type-badge.bg-purple-600 {
    background: linear-gradient(135deg, #7c3aed 0%, #6b46c1 100%);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 6px rgba(107, 70, 193, 0.4);
}

/* Badge pour les offres */
.type-badge[data-type="offre"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Badge pour les demandes */
.type-badge[data-type="demande"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Badge pour les échanges */
.type-badge[data-type="echange"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
}

/* Badge pour les urgents */
.type-badge[data-type="urgent"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 2s infinite;
}

/* Badge pour les gratuits */
.type-badge[data-type="gratuit"] {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Animation pour les urgents */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Effet au survol */
.type-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Styles spécifiques pour chaque vue */

/* Vue grille */
.annonces-grid.grid-view .type-badge {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.65rem;
    max-width: 70px;
}

/* Vue liste */
.annonces-grid.list-view .type-badge {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.6rem;
    min-width: 65px;
}

/* Vue mosaïque */
.annonces-grid.mosaic-view .type-badge {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.55rem;
    min-width: 60px;
}

/* Responsive mobile */
@media (max-width: 640px) {
    .type-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.55rem;
        min-width: 55px;
        border-radius: 4px;
    }

    .annonces-grid.grid-view .type-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.55rem;
        min-width: 55px;
    }

    .annonces-grid.list-view .type-badge {
        top: 0.4rem;
        right: 0.4rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.5rem;
        min-width: 50px;
    }

    .annonces-grid.mosaic-view .type-badge {
        top: 0.3rem;
        right: 0.3rem;
        padding: 0.15rem 0.3rem;
        font-size: 0.45rem;
        min-width: 45px;
    }
}

/* Très petits écrans */
@media (max-width: 375px) {
    .type-badge {
        top: 0.4rem;
        right: 0.4rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.5rem;
        min-width: 50px;
    }

    .annonces-grid.grid-view .type-badge {
        min-width: 45px;
    }

    .annonces-grid.list-view .type-badge,
    .annonces-grid.mosaic-view .type-badge {
        min-width: 40px;
        font-size: 0.4rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Style pour le badge "Sponsorisé" */
.sponsored-card .type-badge {
    top: 0.5rem;
    left: 0.5rem;
    right: auto;
    background: linear-gradient(135deg, #8b5cf6 0%, #6b46c1 100%);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    font-weight: 700;
}

/* Icône pour le badge sponsorisé */
.sponsored-card .type-badge::before {
    content: "? ";
    font-size: 0.7em;
    vertical-align: middle;
}

/* Position différente pour les cartes en mode liste */
.annonces-grid.list-view .sponsored-card .type-badge {
    top: 0.75rem;
    left: 0.5rem;
    right: auto;
}

/* ---- Badge Principal (Type) ---- */
.type-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Couleurs par type */
.type-offre {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.type-demande {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.type-urgent {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 1.5s infinite;
}

/* ---- Badge Sponsor (secondaire) ---- */
.sponsor-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.55rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
    border-radius: 3px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-transform: uppercase;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .type-badge {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.55rem;
    }
    
    .sponsor-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.5rem;
    }
}

/* Animation pour "urgent" */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/*********************/

/* Style de base pour le conteneur d'image */
.annonce-image {
    position: relative;
    height: 160px;
    background-color: #f3f4f6;
    overflow: hidden;
}

/* Style de l'image qui s'applique seulement si elle charge */
.annonce-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Placeholder qui s'affiche par défaut */
.annonce-image .image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(243,244,246,0.9) 0%, rgba(229,231,235,0.9) 100%);
    z-index: 0;
}

/* Quand l'image charge, on cache le placeholder */
.annonce-image img:not([src=""]) + .image-fallback {
    display: none;
}

/* Icône et texte du placeholder */
.image-fallback i {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.image-fallback span {
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 500;
}

/* Version pour annonces sponsorisées */
.sponsored-card .image-fallback {
    background: linear-gradient(135deg, rgba(254,243,199,0.9) 0%, rgba(253,230,138,0.9) 100%);
}

/* Conteneur principal des annonces par catégorie */
.annonces-by-category {
    margin-bottom: 2rem;
}

/* Titre de catégorie */
.category-title-container {
    padding-bottom: 0.5rem;
 /*   border-bottom: 2px solid #ea580c;*/
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.category-title {
   /* font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;*/
}

/* Section des annonces sponsorisées */
.sponsored-section {
    margin-bottom: 1.5rem;
}

.sponsored-section h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    padding-left: 0.5rem;
    border-left: 3px solid #f59e0b;
    margin-bottom: 0.75rem;
}

/* Section des annonces normales */
.regular-section {
    margin-bottom: 1.5rem;
}

.regular-section h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    padding-left: 0.5rem;
    border-left: 3px solid #3b82f6;
    margin-bottom: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .category-title-container {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .category-title {
        font-size: 1.1rem;
    }

    .sponsored-section h3,
    .regular-section h3 {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .sponsored-section,
    .regular-section {
        margin-bottom: 1rem;
    }
}

/* Style pour les sections de catégorie */
.category-section {
    /*padding: 1rem; 
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
}

.category-title-container {
    padding-bottom: 0.5rem;
   /* border-bottom: 2px solid #ea580c;*/
}

/* Style pour les sections sponsorisées */
.sponsored-section {
    background: #fff9e6;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #ffe8a1;
}

/* Style pour le titre des annonces sponsorisées */
.sponsored-section h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    padding-left: 0.5rem;
    border-left: 3px solid #f59e0b;
}

/* Styles pour le carrousel d'annonces */
.annonces-carousel-container {
    padding: 0 2rem;
    margin: 0 -1rem;
}

.annonces-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 0;
    margin: 0;
}

.annonces-carousel::-webkit-scrollbar {
    display: none; /* Masque la scrollbar pour Chrome/Safari */
}


.carousel-arrow i {
    font-size: 1.2rem;
}

.voir-plus-btn {
    flex: 0 0 220px;
    height: 280px;
    scroll-snap-align: start;
}

/* Masquer les flèches sur mobile */
@media (max-width: 640px) {
    .carousel-arrow {
        display: none;
    }
    
    .annonces-carousel-container {
        padding: 0;
    }
}


/* Animation discrète pour les cartes sponsorisées */
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.sponsored-card:hover {
 /*   animation: subtlePulse 1.5s infinite;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);*/
}

/* Style du badge sponsor */
.sponsor-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.55rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1f2937;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-transform: uppercase;
        width: 70px !important;
}

/* Style du prix pour les sponsorisées */
.sponsored-card .text-yellow-600 {
    color: #D97706 !important;
}

/* Style des boutons pour les sponsorisées */
.sponsored-card .bg-yellow-500 {
    background-color: #F59E0B !important;
}

.sponsored-card .hover\:bg-yellow-600:hover {
    background-color: #D97706 !important;
}

/* Responsive */
@media (max-width: 640px) {
    .sponsor-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.5rem;
    }
}



.annonce-card:hover {
 /* transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);*/
}

/* Conteneur image (60% de la carte) */
.annonce-image-container {
  position: relative;
  height: 60%;
  overflow: hidden;
}

.annonce-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.annonce-card:hover .annonce-image {
  /*transform: scale(1.05);*/
}

/* Overlay sur l'image */
.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
      padding: 10px !important;
}

.annonce-price {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.annonce-badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-category {
  background: rgba(255,255,255,0.9);
  color: #333;
}


/* Bouton favori */
.favorite-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.favorite-btn:hover {
  background: #ea580c;
  color: white;
  transform: scale(1.1);
}


.annonce-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.annonce-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #666;
}

.meta-item i {
  margin-right: 5px;
  color: #ea580c;
}

.annonce-excerpt {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 15px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.annonce-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: #ea580c;
  color: white;
  border: none;
  flex-grow: 1;
  justify-content: center;
}

.action-btn.primary:hover {
  background: #E05D00;
}

.action-btn.secondary {
  background: white;
  color: #555;
  border: 1px solid #ddd;
  width: 40px;
  justify-content: center;
}

.action-btn.secondary:hover {
  background: #f5f5f5;
  color: #ea580c;
}

/**************************************/

.search-input {
    background-color: #f0f2f5 !important;
    font-size: 1.05em !important;
    color: #424b5e;
    outline: none;
}

.search-input::placeholder {
    color: rgba(75, 85, 99, var(--tw-text-opacity)) ;
    opacity: 1;
}

.search-input:focus {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.5);
}

.search-container:hover .search-input {
    background-color: #e8eaf1 !important;
}

@media (max-width: 513px) {
    .search-input {
        width: 90% !important;
    }
}


@media (min-width: 1140px) {
    #toggle-categories {
        display: none !important;
    }
    #categories-panel {
        display: block !important;
    }
    .main-layout {
        display: flex;
        flex-direction: row;
        margin-top: 80px;
        margin-left: 300px;
    }    
}

@media (max-width: 1139px) {
    #toggle-categories {
        display: block !important;
    }
    #categories-panel {
        display: none !important;
    }
    .main-layout {
        display: flex;
        flex-direction: row;
       /* margin-top: 30px;*/
        margin-left: 20px;
    }
}


.annonces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 768px) {
    .annonces-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

.annonces-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Conteneur principal des annonces */
.annonces-carousel {
  display: grid;
  gap: 4.5rem 1.5rem;
  width: 100%;
  overflow-x: visible;
}

/* Configuration responsive */
@media (min-width: 1024px) { /* écrans larges */
  .annonces-carousel {
    grid-template-columns: repeat(3, 1fr); /* 3 cartes par ligne */
  }
}

@media (min-width: 1536px) { /* très grands écrans */
  .annonces-carousel {
    grid-template-columns: repeat(4, 1fr); /* 5 cartes par ligne */
  }
}

@media (min-width: 1836px) { /* très grands écrans */
  .annonces-carousel {
    grid-template-columns: repeat(5, 1fr); /* 5 cartes par ligne */
  }
}

@media (max-width: 1023px) { /* tablettes */
  .annonces-carousel {
    grid-template-columns: repeat(2, 1fr); /* 2 cartes par ligne */
  }
}

@media (max-width: 640px) { /* mobiles */
  .annonces-carousel {
    grid-template-columns: 1fr; /* 1 carte par ligne */
  }
}

/* Suppression du comportement de carrousel */
.annonces-carousel-container {
  padding: 0;
  margin: 0;
}

/* Suppression des flèches de navigation */
.carousel-arrow {
  display: none !important;
}



/***************************************************/

/* Conteneur principal des annonces */
.annonces-carousel.grid-view {
    display: grid;
    gap: 70px 0.7rem !important;/**/
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(215px, 215px));
    justify-content: center;/*right; */
}



/* Pour les écrans très petits */
@media (max-width: 480px) {
    .annonces-carousel.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .annonce-card {
        flex: 0 0 160px;
        height: 300px;
    }
}


.max-w-5xl {
    max-width: 100% !important;
}

/*************************************************************/

/* Styles pour les infos vendeur (avant l'image, fond #f3f4f6) */
.vendeur-info {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    align-items: center;
    gap: 8px; /* Space between elements */
    padding: 6px 0px; /* Compact padding */
    background: #f3f4f6; /* Light gray background */
    border-radius: 6px; /* Rounded corners */
    margin: 0 12px 8px 12px; /* Align with content padding */
    width: calc(100% - 24px); /* Full width minus margins */
   /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow */
   background: #fff !important;
}

/* Seller initial bubble */
/* Seller initial bubble */
.vendeur-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50%;
    text-transform: uppercase;
}

/* Seller name styling */
.vendeur-name {
    font-weight: 600;
    font-size: 0.85rem; /* Readable but compact */
    color: #222; /* Dark color for contrast */
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Handle long names */
}

/* Seller rating styling */
.vendeur-rating {
    font-size: 0.8rem;
    color: #444; /* Darker gray for readability */
    font-weight: 500;
}

/* Seller stats styling */
.vendeur-stats {
    font-size: 0.75rem;
    color: #555; /* Medium gray for secondary info */
    font-weight: 500;
}

/* PRO badge styling */
.pro-badge {
    background: #ea580c; /* Orange badge for PRO */
    padding: 2px 2px;
    border-radius: 4px;
    font-size: 0.5rem;
    font-weight: 600;
    margin: 0px;
    color:#fff;
    width: 42px;
}



/* Image container styling */
.annonce-image-container {
    position: relative;
    overflow: hidden;
    height: 60%; /* Maintain original height */
    margin: 0; /* No margins to align with card top */
}

/* Image scaling for hover effect */
.annonce-image-container img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.annonce-card:hover .annonce-image-container img {
  /*  transform: scale(1.05); /* Keep the zoom effect */
}


/* Responsive adjustments for smaller screens */
@media (max-width: 640px) {
    .vendeur-info {
        padding: 4px 8px;
        margin: 0 8px 6px 8px;
        width: calc(100% - 16px);
    }
    .vendeur-initial {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
    .vendeur-name {
        font-size: 0.75rem;
    }
    .vendeur-rating {
        font-size: 0.7rem;
    }
    .vendeur-stats {
        font-size: 0.65rem;
    }
    .pro-badge {
        font-size: 0.65rem;
        padding: 1px 5px;
    }
    .annonce-card {
        border-radius: 6px;
    }
    .annonce-content {
        padding: 8px;
    }
}

/******************************/

/* Structure de base 
.annonce-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 380px;
  display: flex;
  flex-direction: column;
  background: white;
}


.annonce-card {
  height: 380px; 
  display: flex;
  flex-direction: column;
}

.annonce-card {
     width: 215px;
    height: 340px;
    scroll-snap-align: start;
    transition: all 0.3s ease;
}


.annonce-content {
    padding: 12px; 
    height: 40%;
    display: flex;
    flex-direction: column;
}

.annonce-card {
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    border: 1px solid #e5e7eb; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); 
    display: flex;
    flex-direction: column;
}

.annonce-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}
/* Content area styling */

/* Image container styling with rounded corners */
.annonce-image-container {
    position: relative;
    overflow: hidden;
    height: 60%; /* Maintain original height */
    margin: 0; /* No margins to align with card top */
    border-radius: 16px 16px 16px 16px; /* Round all four corners */
}

/* Image styling to follow container's rounded corners */
.annonce-image-container img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px 8px 8px 8px; /* Round all four corners */
}

.annonces-carousel.grid-view .annonce-card {
   width: 205px;
    scroll-snap-align: start;
    height: 455px;
    background: #f3f4f6;
    background: #fff;
}

/* Contenu compact */
.annonce-card .p-4 {
    padding: 0rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Contenu texte (40% de la carte) */
.annonce-content {
  padding: 18px;
  height: 0%;
  display: flex;
  flex-direction: column;
    background: #fff;
    border-radius: 0px 0px 16px 16px; /* Round all four corners */
}

/***************************************/

.sponsored-card {
    background: #fffef0;
    background: #fff;
}
.sponsored-card {
    border: 0px solid #FFD700 !important; 
    background-color: #f3f4f6 ;
    background: #fff !important;
    position: relative;
}


.badge-type {
  background: #ea580c;
  color: white;
}

/* Badge type styling */
.badge-type {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    padding-top: 3px;
}

.badge-type[data-type="offre"] {
    background: #28A745; /* Vert pour les offres */
}

.badge-type[data-type="demande"] {
    background: #DC3545; /* Rouge pour les demandes */
}

.image-container img {
    image-rendering: -webkit-optimize-contrast; /* Webkit */
    image-rendering: crisp-edges; /* Firefox */
    image-rendering: pixelated; /* Fallback */
    backface-visibility: hidden; /* Améliore le rendu des transformations */
}

/**************************/

.category-item:focus,
.subcategory-item:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

.category-item[tabindex="0"],
.subcategory-item[tabindex="0"] {
    cursor: pointer;
}