/* Conteneur principal */

body {
    background-color: #F8F8FF;
    
}

header * {
    position: relative;
    z-index: 1;
}
/* HEADER */
header {
    padding: 30px 20px;
}
header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0,0,0,0.4); /* ombre pour lisibilité */
    color: #FFD580; /* doré clair */
}
/* Version responsive mobile */
@media screen and (max-width: 600px) {
    
	header h1 {
		top:50px;
	}
}

#container-recherche {
    display: flex;
    justify-content: flex-start; /* Aligner les éléments sans espace entre eux */
    padding: 0;
    box-sizing: border-box; /* Assurer que padding et border sont inclus dans la largeur */
    gap: 25px; /* Pas de gap entre les éléments */
    align-items: flex-start; /* Alignement vertical des éléments */
	    background-color: #F8F8FF;

}


/* Liste des appartements */
#container-recherche .appartements-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    overflow-y: auto;
    max-height: 80vh;
    margin: 0; /* Ajouter pour supprimer les marges résiduelles */
    padding: 0; /* Ajouter pour supprimer les paddings */
}

/* Carte de l’appartement */
#container-recherche .appartement-recherche {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    background-color: #f9f9f9;
    height: 150px; 
    overflow: hidden;
    margin: 0; /* Assurer qu'il n'y a pas de marge entre les éléments */

}

/* Conteneur des informations */
#container-recherche .nom-recherche {
    width: 65%;
    padding-left: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.9rem;
    overflow: hidden;
    margin: 0; /* Enlever les marges résiduelles */
}

/* Empêcher débordement de texte */
#container-recherche .equipements,
#container-recherche .product-info {
    font-size: 0.8rem;
    margin-bottom: 4px;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0; /* Ajouter cette ligne pour supprimer les marges */
}

/* Images */
#container-recherche .images {
    width: 35%; 
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Enlever les marges résiduelles */
}

/* Image de l'appartement */
#container-recherche .images img {
    max-width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 5px;
    display: block; /* Assurer qu'il n'y a pas de marges ou espacements */
    margin: 0; /* Enlever les marges éventuelles autour de l'image */
}

/* Bouton pour postuler */
#container-recherche .application-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    background-color: transparent;
    color: white;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    max-height: 30px;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-radius: 3px;
    margin: 0; /* Ajouter pour supprimer les marges résiduelles */
}

/* Carte interactive */
#map {
    width: 58%;
    height: 600px;
}

/* Wrapper vertical pour desktop */
.appartements-wrapper {
    display: flex;
    flex-direction: column; /* Empile appartements + pagination */
    width: 41%; /* Même largeur que .appartements-list */
	overflow-y: auto;
    max-height: 80vh;
}

/* Pagination centrée */
.pagination {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}
#container-recherche .images img {
        width: 100% !important;   /* forcé */
        height: 100% !important;  /* forcé */
        object-fit: cover;         /* couvre le conteneur */
        object-position: center;
        display: block;
        max-width: none;           /* supprime les restrictions */
        max-height: none;
    }



@media (max-width: 768px) {

    /* Conteneur principal : on garde vertical mais appartements en scroll horizontal */
    #container-recherche {
        flex-direction: column;
        align-items: center;
        padding: 10px;
        gap: 10px;
    }

    /* Liste des appartements : horizontal scroll */
    #container-recherche .appartements-list {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;      /* Pas de retour à la ligne */
        overflow-x: auto;       /* Scroll horizontal */
        -webkit-overflow-scrolling: touch; /* Inertie tactile iOS */
        gap: 10px;
        margin-bottom: 10px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory; /* optionnel pour "snap" */
    }

    /* Style pour chaque appartement : largeur fixe, snap */
    #container-recherche .appartement-recherche {
        flex: 0 0 250px;         /* Largeur fixe, ne rétrécit pas */
        scroll-snap-align: start; /* Alignement snap */
        flex-direction: column;  /* Empiler image + texte */
        align-items: center;
        height: auto;
        box-shadow: 0 0 5px rgba(0,0,0,0.1);
    }

    /* Images en pleine largeur */
    #container-recherche .images {
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    #container-recherche .images img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        display: block;
    }

    /* Texte centré */
    #container-recherche .nom-recherche {
        width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        font-size: 0.85rem;
    }

   /* Liste équipements avec scroll vertical */
#container-recherche .equipements {
    font-size: 0.8rem;
    max-height: 60px;   /* hauteur max avant d’activer le scroll */
    overflow-y: auto;   /* scroll vertical */
    overflow-x: hidden; /* pas de scroll horizontal */
    margin: 0;
	padding:0px;
    white-space: normal; /* permet retour à la ligne */
}

#container-recherche .product-info {
    
    gap: 25px; /* Ajouter cette ligne pour supprimer les marges */
}

    /* Bouton pleine largeur */
    #container-recherche .application-btn {
        width: 100%;
        font-size: 0.9rem;
        color: white;
        border: none;
        cursor: pointer;
        text-decoration: none;
        display: inline-block;
        text-align: center;
    }

    /* Optionnel : cacher la scrollbar horizontale (non obligatoire) */
    #container-recherche .appartements-list::-webkit-scrollbar {
        height: 6px;
    }
    #container-recherche .appartements-list::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.2);
        border-radius: 3px;
    }
	header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
	
	#map {
        width: 100%;
        height: 400px;
        margin-top: 0px;
    }
	
	.appartements-wrapper {
        width: 100%; /* pleine largeur */
    }
	
	/* 🔒 Conteneur image avec ratio fixe */
    #container-recherche .images {
        width: 100%;
        aspect-ratio: 4 / 3;   /* ✅ même ratio pour toutes */
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #eaeaea;
        border-radius: 8px;
    }
 #container-recherche .images img {
        width: 100% !important;   /* forcé */
        height: 100% !important;  /* forcé */
        object-fit: cover;         /* couvre le conteneur */
        object-position: center;
        display: block;
        max-width: none;           /* supprime les restrictions */
        max-height: none;
    }
	
}

label{
        color:black;
    }


	
.btn-reset {
    background-color: blue;
    color: #000;
	padding: 8px 8px;
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    height: 45px;
    align-self: center;
}
.btn-reset:hover {
    background-color: #aaa;
}

#btn-open-filter{
    display: none;
}
.btn-close-filter {
    display: none;
}


/* Masquer le formulaire sur mobile */
@media screen and (max-width: 768px) {
	
	#btn-open-filter{
    display: block;
}

	.quick-filter {
    margin: 10px auto;
    padding: 10px;
    background: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 60%;
    text-align: center;
}
   .quick-filter form {
        display: none;
        position: fixed;
        top: 80px;
        left: 10%;
        width: 80%;
        max-height: 80%;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #ccc;
        padding: 15px;
        z-index: 100000;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        backface-visibility: hidden;
        transform: translateZ(0);
    }

    .quick-filter input,
    .quick-filter select,
    .quick-filter textarea {
        font-size: 16px; /* minimum pour éviter le zoom automatique sur mobile */
    }


    /* Bouton pour ouvrir le filtre */
    #btn-open-filter {
        display: block;
        width: 90%;
        margin: 10px auto;
        padding: 10px 0;
        font-size: 16px;
        background-color: #007bff;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        text-align: center;
    }
	
	header {
        position: relative;
        padding-top: 20px; /* espace entre le h1 et le haut */
    }

    .quick-filter {
        margin-top: 10px; /* espace entre le h1 et le bouton/formulaire */
    }

    .quick-filter form {
        top: 90px; /* décale le formulaire sous le h1 */
    }
	 header h1 {
        font-size: 1.8rem;
        text-align: center;
        position: relative;
        z-index: 1;
    }

    .quick-filter {
        margin-top: 50px; /* déjà présent */
        z-index: 2; /* au-dessus du header */
    }
	header {
    overflow: visible !important;
}
	
	 .btn-close-filter {
        display: block;
        width: 45%;
        margin-top: 5px;
        padding: 12px;
        background-color: #d9534f;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
    }

}

.badge-boost {
    position: absolute;      /* Se place par rapport au slideshow-container */
    bottom: 3px;               /* Même top que corner-info */
    left: 0px;              /* Décalage depuis le coin gauche */
    background-color: #FFD700; /* Jaune doré */
    color: black;
    padding: 4px 8px;
    font-weight: bold;
    border-radius: 5px;
    font-size: 0.75rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    z-index: 12;             /* Au-dessus des images et des coins-info */
    pointer-events: none;    /* Ne bloque pas les clics sur le slideshow */
}

.boosted-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 15px 0 25px;
}

.btn-boost {
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    background: #eee;
    color: #333;
    font-weight: 600;
}

.btn-boost.active {
    background: #ff6b6b;
    color: #fff;
}

.slideshow-container {
    position: relative; /* OBLIGATOIRE pour position absolute */
}

/* Disponibilité (coin gauche haut) */
.corner-info {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    z-index: 10;
}

/* Superficie (coin droit haut) */
.corner-info.left {
    left: auto;
    right: 8px;
}


.slideshow-container {
    position: relative;      /* déjà présent */
    width: 100%;
    height: 150px;           /* ou la hauteur souhaitée */
    overflow: hidden;        /* ✅ empêche les images de déborder */
}
.slideshow-container .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.corner-info {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;             /* plus haut que l'image */
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    white-space: nowrap;
}
