/* -------- RESET & BASE -------- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

/* Flexbox sur le body pour bloquer le footer en bas */
body { 
    font-family: Arial, sans-serif; 
    background: #f4f6f8; 
    color: #333; 
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Prend toute la hauteur de l'écran */
}

/* -------- HEADER -------- */
header { 
    background: #003366; 
    color: white; 
    padding: 12px 20px; 
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1200px; 
    margin: auto; 
}

.logo a { 
    color: white; 
    text-decoration: none; 
    font-size: 1.5rem; 
    font-weight: bold; 
}

nav a { 
    margin-left: 20px; 
    color: white; 
    text-decoration: none; 
    font-size: 1rem; 
}

nav a:hover { 
    text-decoration: underline; 
}

/* -------- CONTENU PRINCIPAL -------- */
main {
    flex: 1; /* S'étire pour occuper l'espace et pousser le footer */
}

/* -------- FORMULAIRES UNIFIES -------- */
.responsive-form {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    padding: 30px 35px;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.responsive-form.small {
    max-width: 900px;
    padding: 25px 30px;
}

.responsive-form h2 {
    text-align: center;
    font-size: 1.8rem;
    color: #003366;
    margin-bottom: 15px;
    font-weight: bold;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.responsive-form label {
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
    color: #003366;
    font-size: 0.95rem;
}

.input-icon { position: relative; }

.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 1.1rem;
}

.input-icon input,
.input-icon select,
.input-icon textarea,
.responsive-form input,
.responsive-form select,
.responsive-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s, box-shadow 0.3s;
    background: #fafafa;
}

.input-icon input { padding-left: 42px; }
.responsive-form textarea { resize: vertical; min-height: 100px; }

.responsive-form input:focus,
.responsive-form select:focus,
.responsive-form textarea:focus {
    border-color: #003366;
    box-shadow: 0 0 6px rgba(0, 51, 102, 0.25);
    outline: none;
    background: #fff;
}

.responsive-form button {
    background: linear-gradient(135deg, #003366, #0055aa);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    width: 100%;
    text-align: center;
}

.responsive-form button:hover {
    background: linear-gradient(135deg, #0055aa, #0077cc);
    transform: translateY(-2px);
}

/* ✅ Spécial recherche : champ + bouton alignés */
.search-group {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.search-group input {
    flex-grow: 1;
    min-width: 250px;
}

.search-group button {
    width: auto;
    padding: 12px 24px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* -------- GRID & LISTINGS -------- */
.annonces { 
    padding: 30px; 
    max-width: 1200px; 
    margin: auto; 
}

.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px; 
}

.card { 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    display: flex; 
    flex-direction: column; 
}

.image-slider { position: relative; width: 100%; height: 220px; overflow: hidden; }
.image-slider img { position: absolute; top: 0; left: 0; width: 100%; height: 220px; object-fit: cover; opacity: 0; transition: opacity 0.6s ease-in-out; }
.image-slider img.active { opacity: 1; z-index: 2; }
.image-slider button { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 1.5rem; padding: 6px 12px; cursor: pointer; border-radius: 50%; z-index: 3; }
.image-slider .prev { left: 10px; }
.image-slider .next { right: 10px; }

.card-body { padding: 15px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; color: #003366; }
.card .ville { color: #555; font-weight: normal; }
.card p { margin-bottom: 10px; color: #444; }
.card .price { display: block; margin: 10px 0; font-size: 1.2rem; color: #d32f2f; font-weight: bold; }

.actions { margin-top: auto; padding: 15px; display: flex; justify-content: space-between; }
.actions .btn { background: #003366; color: white; padding: 8px 12px; text-decoration: none; border-radius: 8px; font-size: 0.9rem; transition: background 0.3s; }
.actions .btn:hover { background: #0055aa; }

/* -------- FOOTER -------- */
footer { 
    background: #003366; 
    color: white; 
    padding: 20px 15px; 
    text-align: center; 
    margin-top: auto; 
}

/* ======================================= */
/* ====== OPTIMISATION SMARTPHONE ======== */
/* ======================================= */

@media (max-width: 768px) {
    /* Header mobile */
    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    nav a {
        margin: 0;
        font-size: 0.9rem;
        background: rgba(255,255,255,0.1);
        padding: 5px 10px;
        border-radius: 5px;
    }

    /* Formulaire de recherche mobile */
    .responsive-form.small {
        margin: 15px;
        padding: 20px;
    }

    .search-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-group input {
        width: 100%;
        min-width: 0;
    }

    .search-group button {
        width: 100%;
        padding: 12px;
    }

    /* Grille d'annonces mobile (1 colonne) */
    .annonces {
        padding: 15px 10px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .image-slider {
        height: 200px;
    }
    
    /* Promo mobile */
    .promo {
        font-size: 1rem !important;
        padding: 15px !important;
    }
}
@media (max-width: 768px) {
    .grid-container {
        display: grid;
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
        gap: 20px;
        padding: 10px;
    }
}