/* === Corps de page === */
body{
    background: url('../images/fond_light.jpg') no-repeat center center;
    background-size: cover;
}

/* ======================
   PAGINATION MODERNE
====================== */

.pagination-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.pagination-new {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-new a,
.pagination-new span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;

    transition: all 0.25s ease;
}

/* Pages normales */
.pagination-new a {
    background: #f2f4f7;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Hover */
.pagination-new a:hover {
    background: #2d89ef;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(45,137,239,0.25);
}

/* Page active */
.pagination-new .current {
    background: linear-gradient(135deg, #2d89ef, #1b5fd9);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(45,137,239,0.35);
    cursor: default;
}

/* Boutons précédent / suivant */
.pagination-new a:first-child,
.pagination-new a:last-child {
    font-weight: 600;
    padding: 0 16px;
}

/* Responsive mobile */
@media (max-width: 600px) {
    .pagination-new {
        gap: 4px;
    }

    .pagination-new a,
    .pagination-new span {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        border-radius: 8px;
    }
}


/* === Conteneur annonces === */
.annonces-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    background: transparent;
    background-image: url('images/fond_light.jpg');
    padding: 20px;
}

/* Cartes d'annonce */
.annonce-card {
    width: 250px;
    border-radius: 10px;
    overflow: hidden;
/*    box-shadow: 0 4px 12px rgba(0,0,0,0.1);  */
    border: 1px solid #ddd;
/*     transition: transform 0.3s, box-shadow 0.3s;  */
    transition: transform 0.3s ease;

    position: relative;
    background: #fff;
}

.annonce-card:hover {
    transform: translateY(-5px);
/*    box-shadow: 0 8px 20px rgba(0,0,0,0.15);  */
}

/* Image annonce */
.annonce-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.annonce-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badges */
.badge-creator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(40,167,69,0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8em;
    z-index: 10;
    font-weight: bold;
}

.badge-images {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

.badge-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    z-index: 10;
    cursor: default;
    text-shadow: 0 0 5px rgba(0,0,0,0.6);
}

/* Infos annonce */
.annonce-info {
    padding: 10px;
}

.annonce-info h3 {
    font-size: 1.1em;
    margin: 0 0 5px;
    height: 38px;
    overflow: hidden;
}

.price {
    font-weight: bold;
    margin: 0 0 5px;
}

.dates {
    font-size: 0.85em;
    margin: 0 0 5px;
}

.date-created {
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.date-updated {
    color: #2176c7;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
}

.date-updated::before {
    content: "|";
    color: #999;
    margin-right: 5px;
}

.region {
    font-size: 0.9em;
    color: #555;
    margin: 0 0 8px;
}

.seller {
    margin: 0 0 10px;
}

.views {
    font-size: 0.85em;
    color: #444;
    margin-bottom: 5px;
}

.btn-view {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    background: #3498db;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #2176c7;
}

/* search.css pour desktop uniquement */
.search-banner-modern-premium {
    background: linear-gradient(145deg, #ddd, #336149);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    max-width: 1200px;
    margin: 0 auto;
}


    .search-banner-modern-premium form { 
        display: grid; 
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
        gap: 20px; 
} 

/* === form group pour les titres === */
.form-group {
    position: relative;
    font-family: 'Arial', sans-serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 16px 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.3s ease, transform 0.2s ease;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #4a90e2;
    box-shadow: 0 6px 15px rgba(74,144,226,0.2);
    transform: translateY(-2px);
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4a90e2;
    box-shadow: 0 8px 20px rgba(74,144,226,0.3);
    outline: none;
    transform: translateY(-2px);
}

.form-group label {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #888;
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
   /* background-color: #fff; */
    padding: 0 6px;
}

.form-group label i { margin-right: 6px; }

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
    top: -10px;
    left: 12px;
    font-size: 0.8rem;
    color: #000000;
}

.price-fields {
    display: flex;
    gap: 12px;
}

.price-fields .form-group { flex: 1; }

.btn-reset {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, #f44336, #d32f2f);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease, transform 0.2s ease;
    box-shadow: 0 6px 15px rgba(244,67,54,0.25);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244,67,54,0.35);
}

/* Suggestions auto-complete */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 2px;
    padding: 0;
    list-style: none;
}

.suggestions li {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestions li:hover { background-color: #f0f4f8; }

/* === Mobile drawer === */
.show-filters-btn {
    display: none;
    background: #3498db;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    margin: 15px auto;
    max-width: 250px;
}

.advanced-filters-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: linear-gradient(145deg, #ddd, #336149);
    padding: 20px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    padding-top: 80px; /* ajuste selon la hauteur de ton header */
}

.advanced-filters-drawer.active { left: 0; }

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 900;
}

.drawer-overlay.active { opacity: 1; pointer-events: all; }

.advanced-filters-drawer::-webkit-scrollbar {
    width: 6px;
}
.advanced-filters-drawer::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* Cache le bouton mobile par défaut sur desktop */
#resetFiltersDrawer {
    display: none;
}



/* === Champs Catégorie visibles sur mobile au-dessus du bouton === */
.mobile-top-categories {
    display: none; /* caché par défaut sur desktop */
}

@media (max-width: 768px) {
    .mobile-top-categories {
        display: block;
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        margin: 15px auto;
        max-width: 250px;
        width: 100%;
    }

    .mobile-top-categories .form-group select {
        width: 100%;
        padding: 12px 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.95rem;
        background: #fff;
        box-sizing: border-box;
    }

    .mobile-top-categories .form-group label {
        top: -10px;
        left: 12px;
        font-size: 0.8rem;
        color: #4a90e2;
        background: #fff;
        padding: 0 6px;
    }


      .mobile-top-types,
    .mobile-top-categories {
        display: block;
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        margin: 15px auto;
        max-width: 250px;
        width: 100%;
    }




    .mobile-buttons-wrapper {
        display: flex;
        gap: 10px;               /* espace entre les boutons */
        justify-content: center;  /* centre les boutons horizontalement */
        flex-wrap: wrap;          /* passe à la ligne si écran très étroit */
        margin: 15px auto;
        max-width: 250px;
        width: 100%;
    }

    .mobile-buttons-wrapper .show-filters-btn,
    .mobile-buttons-wrapper #resetFiltersDrawer {
        flex: 1;                 /* chaque bouton prend la moitié de la largeur */
        margin: 0;               /* supprime margin par défaut */
    }


    /* Mobile top types */
    .mobile-top-types {
        display: block;
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        margin: 15px auto 15px auto;
        max-width: 250px; /* même max-width que les boutons */
        width: 100%;            /* occupe toute la largeur possible dans max-width */ 
    }

/* Aligner types sur catégories */
.mobile-top-types .form-group select {
    width: 100%;
    padding: 12px 20px;       /* même padding que catégories */
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;       /* même font-size que catégories */
    background: #fff;
    box-sizing: border-box;
    height: auto;
}

.mobile-top-types .form-group label {
    top: -10px;               /* même top que catégories */
    left: 12px;
    font-size: 0.8rem;        /* même font-size que catégories */
    color: #4a90e2;
    background: #fff;
    padding: 0 6px;
}


    .form-group input,
    .form-group select {
        font-size: 16px; /* empêche le zoom */
    }

}




@media (max-width: 768px) {
    form { grid-template-columns: 1fr; }
    .price-fields { flex-direction: column; }
    .show-filters-btn { display: block; }
    .search-banner-modern-premium { display: none; }

    form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    }

    /* Bouton Réinitialiser mobile */
    #resetFiltersDrawer {
        display: block;
        background: linear-gradient(145deg, #f44336, #d32f2f);
        color: #fff;
        padding: 8px 20px;
        border-radius: 8px;
        text-align: center;
        cursor: pointer;
        font-weight: bold;
        margin: 15px auto;
        max-width: 250px;
        width: 100%;
        box-sizing: border-box;
    }

    #resetFilters {
        display: none !important;
    }




}

@media (min-width: 769px) {
    .mobile-top-types {
        display: none !important;
    }
}


/* Masquer la catégorie principale sur mobile */
@media (max-width: 768px) {
    #categorySelect {
        display: none !important;
    }
    
    /* Masquer aussi le label associé */
    label[for="categorySelect"] {
        display: none !important;
    }
}

/* Desktop : rien ne change, la catégorie reste visible */
@media (min-width: 769px) {
    #typeSelect,
    label[for="typeSelect"] {
        display: block;
    }
}


/* Masquer le type principale sur mobile */
@media (max-width: 768px) {
    #typeSelect {
        display: none !important;
    }
    
    /* Masquer aussi le label associé */
    label[for="typeSelect"] {
        display: none !important;
    }
}

/* Desktop : rien ne change, la catégorie reste visible */
@media (min-width: 769px) {
    #typeSelect,
    label[for="typeSelect"] {
        display: block;
    }
}



/* --- VERSION MOBILE COMPACTE (masquée sur desktop) --- */
    .annonce-mobile {
        display:none; /* caché par défaut */
    }

    @media(max-width:600px){

    /* ON CACHE LA VERSION ACTUELLE */
    .annonce-card {
        display:none !important;
    }        

    /* Empilement vertical des annonces */
    .annonces-container {
        display: block !important;   /* empile les annonces */
        gap: 0 !important;           /* supprime l’espace flex */
        padding: 0;                  /* supprime le padding éventuel */
        margin: 0 auto;              /* centrer si nécessaire */
    }     


        /* ON AFFICHE LA VERSION COMPACTE */
    .am-badge-creator {
        position:absolute;
        top:6px;
        right:38px; /* Décalage vers la gauche à côté du ❤️ */
        background:#28a745;
        color:#fff;
        padding:3px 6px;
        font-size:11px;
        border-radius:4px;
        font-weight:bold;
        z-index:10;
    }

    /* Sur mobile, badge images en haut à droite de la photo */
   .am-left {
        position: relative; /* nécessaire pour que le badge se positionne par rapport à l'image */
    } 
    .am-badge-images {
        position: absolute;
        top: 6px;      /* en haut */
        right: 6px;    /* à droite de l'image */
        background: rgba(0,0,0,0.6);
        color: #fff;
        font-size: 11px;
        padding: 2px 5px;
        border-radius: 4px;
        z-index: 10;
    }

    .am-badge-fav {
        position:absolute;
        top:6px;
        right:8px;
        font-size:20px;
        z-index:10;
    }

    .am-type {
        font-size:11px;
        color:green;
        margin-left:4px;
        font-weight:normal;
    }

    .am-btn-view {
        display:inline-block;
        margin-top:6px;
        padding:5px 8px;
        background:#3498db;
        color:white;
        border-radius:5px;
        font-size:12px;
        text-decoration:none;
    }


    .badge-see {
        position:absolute;
        top:40px;       /* en dessous du ❤️ */
        right:10px;
        background:#3498db;
        color:#fff;
        padding:3px 7px;
        font-size:12px;
        border-radius:4px;
        font-weight:bold;
        z-index:10;
        opacity:0.9;
        text-decoration: none; /* 🔵 enlève le soulignement */
    }

    .am-views-mobile {
        display: flex;
        align-items: center;
    }

    .am-views-mobile .am-price {
        font-weight: bold;
        color: #000;
        margin-bottom: 3px;
    }

    .am-views-mobile .views-count {
        font-size: 11px;
        color: #444;
        margin-left: 5px; /* espace entre prix et vues */
    }

        /* Version mobile compacte */
    .annonce-mobile {
        display:flex;
        flex-direction: row;
        width:100%;
        max-width:600px;
        background:white;
        border:1px solid #ddd;
        border-radius:8px;
        padding:8px;        /* réduit légèrement le padding interne */
        margin-bottom:8px;  /* réduit fortement l'espace entre annonces */
        box-shadow:0 2px 4px rgba(0,0,0,0.1); /* optionnel, plus léger */
        position:relative;
    }

    .annonce-mobile .am-left img {
        width:90px;
        height:80px;
        border-radius:6px;
        object-fit:cover;
    }

    .annonce-mobile .am-right {
        margin-left:10px;
        width:100%;
    }

    /* Titre mobile en normal */
    .annonce-mobile h4 {
        font-weight: normal;      /* 🔹 titre non gras */
        font-size: 15px;
        margin: 0 0 3px;
        line-height: 1.2;
    }

    .annonce-mobile .am-price {
        font-weight:bold;
        color:#000;
        margin-bottom:3px;
    }

    .annonce-mobile .am-region,
    .annonce-mobile .am-dates,
    .annonce-mobile .am-seller {
        font-size:12px;
        color:#555;
        margin-bottom:2px;
    }

    .annonce-mobile .am-fav {
        position:absolute;
        top:5px;
        right:8px;
        font-size:18px;
    }

    .annonce-mobile .am-views {
        font-size:11px;
        color:#444;
        margin-top:4px;
    }
}


