/* ===========================================
   MARCHÉ - Master-Village FONCÉ
   =========================================== */

/* RESET BODY */
body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    background-image: url(marchéordi.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    color: white;
    font-weight: bold;
    overflow-x: hidden; /* Supprime scrollbar horizontale */
}

/* TOP BANNER */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.h1inscri {
    font-size: 24px;
    margin: 0;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* FOOTER NAV */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.5);
}

.footer-nav .lignecobis {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav .lignecobis li {
    margin: 0;
}

.footer-nav .lignecobis a {
    color: #F4D03F;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    padding: 12px 25px;
    border-radius: 25px;
    background: rgba(244, 208, 63, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(244, 208, 63, 0.3);
    display: inline-block;
}

.footer-nav .lignecobis a:hover {
    background: #F4D03F;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.4);
}

/* FORM RECHERCHE (PREMIÈRE - VILLE/RAYON) */
.form-recherche:first-child {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column; /* Organise en colonne pour retour à la ligne */
    gap: 10px;
    justify-content: flex-start;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.form-recherche:first-child .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%; /* Chaque groupe sur une ligne */
}

/* FORM RECHERCHE (SECONDE - INSTALLEZ-VOUS) */
.form-recherche:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.form-recherche:nth-child(2) .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-recherche label {
    margin-right: 10px;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.form-recherche .td1, .form-recherche .td2 {
    margin-left: 0; /* Aligne "Rayon" et "Installez-vous" à gauche */
}

.form-recherche input[type="text"] {
    padding: 8px 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    transition: all 0.3s ease;
}

.form-recherche input[type="text"]:focus {
    outline: none;
    border-color: #F4D03F;
    box-shadow: 0 0 0 3px rgba(244, 208, 63, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-recherche input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-recherche input[type="text"]:focus::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#Ville {
    min-width: 150px;
    max-width: 300px;
}

#Rayon {
    width: 80px;
    max-width: 100px;
}

.form-recherche input[type="submit"] {
    padding: 8px 16px;
    background: linear-gradient(45deg, #F4D03F, #ffed4e);
    color: #333;
    font-weight: bold;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-recherche input[type="submit"]:hover {
    background: linear-gradient(45deg, #ffed4e, #F4D03F);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244, 208, 63, 0.4);
}

/* SUGGESTIONS VILLE */
.ville-group {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px; /* Limite la largeur de la zone de saisie */
    background-color: transparent;
}

.ville-group input {
    width: 100%;
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: rgba(20, 25, 35, 0.95);
    border: 1px solid #F4D03F;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 300px; /* Suit la largeur de #Ville */
}

#suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#suggestions li {
    padding: 10px 12px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

#suggestions li:hover {
    background: rgba(244, 208, 63, 0.2);
    color: #F4D03F;
}

#suggestions li:last-child {
    border-bottom: none;
}

/* CHARRETTE - MOBILE UNIQUEMENT */
#introMarche {
    display: none;
}

@media (max-width: 750px) {
    #introMarche {
        display: flex;
        position: fixed;
        top: 60%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 80px;
        background: rgba(255, 255, 255, 1);
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 9999;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        animation: popIn 0.8s ease-out;
    }

    #image-marche {
        width: 80%;
        height: 80%;
        object-fit: contain;
        display: block;
        opacity: 0;
        border: none;
        animation: fadeInMarche 0.8s ease-out forwards;
        animation-delay: 0.3s;
    }

    #contenuMarche {
        display: none;
    }
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes fadeInMarche {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* VIGNETTES */
.Vignette, .Vignettebis {
    background: #333;
    padding: 20px;
    padding-top: 30px;
    border: 4px solid #444; /* Bordure gris sombre */
    border-radius: 15px;
    display: inline-block;
    margin: 10px 5px; /* Marges réduites */
    flex-basis: calc(15% - 10px);
    height: auto;
    max-height: 17vw;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-sizing: border-box; /* Inclut bordures et padding */
}

.Vignette:hover, .Vignettebis:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.Vignette img, .Vignettebis img {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    border: 3px solid #4A4A4A; /* Bordure gris sombre pour images */
    border-radius: 10px;
    object-fit: cover;
}

.wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Aligne à gauche sur ordi */
    gap: 5px; /* Gap réduit pour mobile */
    margin-left: 15px; /* Décalage à gauche */
    overflow-x: hidden; /* Supprime scrollbar horizontale */
}

/* LIENS */
a {
    text-decoration: none;
    color: white;
}

a:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* MESSAGE "RIEN À PROXIMITÉ" */
#ras {
    color: #F4D03F;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    margin: 20px 0;
}

/* CONTENEUR BACKGROUND */
#background {
    border-radius: 20px;
    padding: 10px;
    max-width: 500px; /* Réduit la largeur sur ordi */
    background: rgba(20, 25, 35, 0.95);
    margin: 20px 0 20px 15px; /* Aligné à gauche */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    overflow-x: hidden; /* Supprime scrollbar horizontale */
}

/* ZOOM IMAGE */
.zoom {
    transition: transform 0.2s;
}

.zoom:hover {
    transform: scale(1.1);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    background-color: #1A1A1A; /* presque noir, très discret */
}

::-webkit-scrollbar-thumb {
    background-color: #444444; /* gris foncé, visible mais sobre */
    border-radius: 3px;
}

::-webkit-scrollbar-corner {
    background-color: #1A1A1A; /* même que le fond de la scrollbar */
}


/* MOBILE */
@media (max-width: 767px) {
    body {
        background-image: url(fondmarcheia.png);
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        padding: 0;
        overflow-x: hidden; /* Supprime scrollbar horizontale */
    }

    .form-recherche:first-child {
        flex-direction: column; /* Empile les éléments sur mobile */
    }

    .form-recherche:nth-child(2) {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    #background {
        margin: 20px 10px; /* Marges réduites, parfait */
        padding: 10px;
        max-width: 90vw; /* Adapté à l'écran */
        background: rgba(20, 25, 35, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .form-recherche input[type="text"] {
        width: 100%;
        max-width: 100%;
    }

    #Ville {
        min-width: 100px;
        max-width: 200px; /* Input Ville court */
    }

    #Rayon {
        width: 60px;
        max-width: 80px;
    }

    .ville-group {
        max-width: 200px; /* Réduit la zone de saisie */
    }

    #suggestions {
        max-width: 200px; /* Suggestions suivent #Ville */
    }

    .Vignette, .Vignettebis {
        padding: 10px;
        padding-top: 15px;
        margin: 5px; /* Marges réduites */
        flex-basis: calc(49% - 12px); /* 2 vignettes côte à côte */
        max-height: 55vw;
        box-sizing: border-box; /* Inclut bordures et padding */
    }

    .Vignette img, .Vignettebis img {
        width: 95%;
    }

    .wrap {
        margin-left: 5px; /* Réduit pour mobile */
        gap: 5px; /* Gap réduit pour 2 vignettes/ligne */
        justify-content: space-between; /* Optimise l'espace */
        overflow-x: hidden; /* Supprime scrollbar horizontale */
    }
}