/* ===========================================
   MARCHÉ - Master-Village
   Style "place du marché" : vignettes-étals à
   auvents rayés, carte crème, boutons soleil
   ===========================================
   Palette :
   - Crème murs   : #FBF3D8 → #F2E2B0
   - Brun trait   : #5C3A1E   Brun toit : #6B4226
   - Bleu fenêtre : #1E4A63
   - Jaune soleil : #F4D03F
   - Vert prés    : #4C8C2B
   - Rouge auvent : #C0522A
   - Texte        : #3E2A14
   =========================================== */

/* 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: #3E2A14;
    font-weight: bold;
    overflow-x: hidden;
}

/* TOP BANNER : poutre de bois, liseré soleil */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(62, 42, 20, 0.95);
    border-bottom: 3px solid #F4D03F;
    color: #FBF3D8;
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.h1inscri {
    font-size: 24px;
    margin: 0;
    color: #F4D03F;
    letter-spacing: 0.5px;
}

/* FOOTER NAV */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(62, 42, 20, 0.95);
    border-top: 3px solid #F4D03F;
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
}

.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: 10px 25px;
    border-radius: 25px;
    background: rgba(244, 208, 63, 0.12);
    transition: all 0.25s ease;
    border: 2px solid rgba(244, 208, 63, 0.4);
    display: inline-block;
}

.footer-nav .lignecobis a:hover {
    background: #F4D03F;
    color: #3E2A14;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.4);
    text-decoration: none;
}

/* FORM RECHERCHE (PREMIÈRE - VILLE/RAYON) */
.form-recherche:first-child {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    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%;
}

/* 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: #5C3A1E;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.form-recherche .td1, .form-recherche .td2 {
    margin-left: 0;
}

/* Inputs : fenêtres de la maison */
.form-recherche input[type="text"] {
    padding: 8px 12px;
    font-size: 14px;
    background: #FFFDF5;
    border: 2px solid #1E4A63;
    border-radius: 8px;
    color: #14324A;
    font-weight: normal;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 2px 3px rgba(30, 74, 99, 0.12);
}

.form-recherche input[type="text"]:focus {
    outline: none;
    border-color: #E0A800;
    box-shadow: 0 0 0 4px rgba(244, 208, 63, 0.35);
    background: #FFFFFF;
}

.form-recherche input[type="text"]::placeholder {
    color: rgba(20, 50, 74, 0.45);
}

.form-recherche input[type="text"]:focus::placeholder {
    color: rgba(20, 50, 74, 0.3);
}

.form-recherche input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #FFFDF5 inset;
    -webkit-text-fill-color: #14324A;
    transition: background-color 5000s ease-in-out 0s;
}

#Ville {
    min-width: 150px;
    max-width: 300px;
}

#Rayon {
    width: 80px;
    max-width: 100px;
}

/* Bouton : le soleil du village */
.form-recherche input[type="submit"] {
    padding: 8px 16px;
    background: linear-gradient(180deg, #FFE066 0%, #F4C531 100%);
    color: #3E2A14;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid #5C3A1E;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 0 #B98A1F;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.form-recherche input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #B98A1F, 0 8px 15px rgba(244, 208, 63, 0.45);
}

.form-recherche input[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #B98A1F;
}

/* SUGGESTIONS VILLE */
.ville-group {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px;
    background-color: transparent;
}

.ville-group input {
    width: 100%;
    box-sizing: border-box;
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #FFFDF5;
    border: 2px solid #1E4A63;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(20, 25, 35, 0.25);
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

#suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#suggestions li {
    padding: 10px 12px;
    color: #14324A;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    border-bottom: 1px solid rgba(30, 74, 99, 0.15);
    transition: all 0.2s ease;
}

#suggestions li:hover {
    background: rgba(244, 208, 63, 0.3);
    color: #3E2A14;
}

#suggestions li:last-child {
    border-bottom: none;
}

/* CHARRETTE D'INTRO : médaillon cliquable, sur TOUS les écrans
   (comme la loupe de recherche.php et la plume de depose.php).
   Le contenu du marché ne s'affiche qu'après le clic. */
#introMarche {
    display: flex;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: #FBF3D8;
    border: 3px solid #5C3A1E;
    border-radius: 50%;
    box-shadow: 0 6px 0 rgba(20, 25, 35, 0.30), 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: popIn 0.8s ease-out;
    box-sizing: border-box;
    transition: transform 0.2s ease;
}

#introMarche:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.marche-circle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-marche {
    width: 75%;
    height: 75%;
    object-fit: contain;
    display: block;
    opacity: 0;
    border: none;
    animation: fadeInMarche 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

/* Contenu masqué tant qu'on n'a pas cliqué sur la charrette
   (le JS de marche.php le passe en display:block au clic, et
   le révèle directement après une recherche) */
#contenuMarche {
    display: none;
}

@media (max-width: 750px) {
    #introMarche {
        top: 60%;
        width: 80px;
        height: 80px;
    }
}

@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 = ÉTALS DE MARCHÉ À AUVENT RAYÉ
   =========================================== */
.Vignette, .Vignettebis {
    position: relative;
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    padding: 20px;
    padding-top: 34px; /* place pour l'auvent */
    border: 3px solid #5C3A1E;
    border-radius: 10px;
    display: inline-block;
    margin: 10px 5px;
    flex-basis: calc(15% - 10px);
    height: auto;
    max-height: 17vw;
    overflow-y: auto;
    box-shadow:
        0 5px 0 rgba(20, 25, 35, 0.28),
        0 10px 20px rgba(20, 25, 35, 0.25);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-sizing: border-box;
}

/* L'auvent rayé (bande) */
.Vignette::before, .Vignettebis::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    background: repeating-linear-gradient(
        90deg,
        #C0522A 0 14px,
        #FBF3D8 14px 28px
    );
    border-bottom: 2px solid #5C3A1E;
}

/* Les festons de l'auvent */
.Vignette::after, .Vignettebis::after {
    content: "";
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        #C0522A 0 14px,
        #FBF3D8 14px 28px
    );
    -webkit-mask: radial-gradient(circle 7px at 7px 0, #000 97%, transparent) repeat-x;
    -webkit-mask-size: 14px 8px;
    mask: radial-gradient(circle 7px at 7px 0, #000 97%, transparent) repeat-x;
    mask-size: 14px 8px;
    pointer-events: none;
}

/* Les auvents alternent leurs couleurs, comme sur la place */
.wrap .Vignette:nth-child(3n+2)::before,
.wrap .Vignette:nth-child(3n+2)::after,
.wrap .Vignettebis:nth-child(3n+2)::before,
.wrap .Vignettebis:nth-child(3n+2)::after {
    background: repeating-linear-gradient(
        90deg,
        #4C8C2B 0 14px,
        #FBF3D8 14px 28px
    );
}

.wrap .Vignette:nth-child(3n)::before,
.wrap .Vignette:nth-child(3n)::after,
.wrap .Vignettebis:nth-child(3n)::before,
.wrap .Vignettebis:nth-child(3n)::after {
    background: repeating-linear-gradient(
        90deg,
        #E0A800 0 14px,
        #FBF3D8 14px 28px
    );
}

.Vignette:hover, .Vignettebis:hover {
    transform: scale(1.05);
    box-shadow:
        0 7px 0 rgba(20, 25, 35, 0.30),
        0 14px 28px rgba(20, 25, 35, 0.35);
}

.Vignette img, .Vignettebis img {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    border: 3px solid #5C3A1E;
    border-radius: 8px;
    object-fit: cover;
    background: #FFFDF5;
}

.wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
    margin-left: 15px;
    overflow-x: hidden;
}

/* LIENS (sur les étals crème) */
a {
    text-decoration: none;
    color: #3E2A14;
}

a:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* MESSAGE "RIEN À PROXIMITÉ" : pancarte crème lisible sur le fond */
#ras {
    display: inline-block;
    color: #A93226;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    margin: 20px 0;
    padding: 12px 25px;
    background: #FBF3D8;
    border: 3px solid #5C3A1E;
    border-radius: 10px;
    box-shadow: 0 5px 0 rgba(20, 25, 35, 0.28);
}

/* CONTENEUR RECHERCHE : carte crème à toit plat */
#background {
    border-radius: 12px 12px 16px 16px;
    padding: 10px;
    max-width: 500px;
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    border: 3px solid #5C3A1E;
    border-top: 12px solid #6B4226;
    margin: 20px 0 20px 15px;
    box-shadow:
        0 6px 0 rgba(20, 25, 35, 0.30),
        0 14px 28px rgba(20, 25, 35, 0.30);
    overflow-x: hidden;
}

/* ZOOM IMAGE */
.zoom {
    transition: transform 0.2s;
}

.zoom:hover {
    transform: scale(1.1);
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    background-color: #F2E2B0;
}

::-webkit-scrollbar-thumb {
    background-color: #6B4226;
    border-radius: 4px;
}

::-webkit-scrollbar-corner {
    background-color: #F2E2B0;
}


/* 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;
    }

    .form-recherche:first-child {
        flex-direction: column;
    }

    .form-recherche:nth-child(2) {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    #background {
        margin: 20px 10px;
        padding: 10px;
        max-width: 90vw;
    }

    .form-recherche input[type="text"] {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #Ville {
        min-width: 100px;
        max-width: 200px;
    }

    #Rayon {
        width: 60px;
        max-width: 80px;
    }

    .ville-group {
        max-width: 200px;
    }

    #suggestions {
        max-width: 200px;
    }

    .Vignette, .Vignettebis {
        padding: 10px;
        padding-top: 28px; /* place pour l'auvent */
        margin: 5px;
        flex-basis: calc(49% - 12px);
        max-height: 55vw;
        box-sizing: border-box;
    }

    .Vignette img, .Vignettebis img {
        width: 95%;
    }

    .wrap {
        margin-left: 5px;
        gap: 5px;
        justify-content: space-between;
        overflow-x: hidden;
    }
}


/* ===========================================
   BOUTONS MODIFIER / SUPPRIMER - MES VIGNETTES
   =========================================== */

/* Conteneur des boutons (empilés verticalement) */
.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

/* Style commun aux boutons */
.modif-button-annonce,
.delete-button-annonce {
    background: linear-gradient(180deg, #FFE066 0%, #F4C531 100%);
    color: #3E2A14;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid #5C3A1E;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 3px 0 #B98A1F;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 100px;
    width: 100%;
    max-width: 180px;
    text-align: center;
}

/* Bouton Supprimer → rouge tuile */
.delete-button-annonce {
    background: linear-gradient(180deg, #E06B4A 0%, #C0522A 100%);
    color: #FBF3D8;
    box-shadow: 0 3px 0 #8A3A1E;
}

/* Hover Modifier */
.modif-button-annonce:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #B98A1F, 0 8px 15px rgba(244, 208, 63, 0.45);
}

/* Hover spécifique Supprimer */
.delete-button-annonce:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #8A3A1E, 0 8px 15px rgba(192, 82, 42, 0.45);
}

.modif-button-annonce:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #B98A1F;
}

.delete-button-annonce:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #8A3A1E;
}

/* Accessibilité : moins d'animations si demandé par le système */
@media (prefers-reduced-motion: reduce) {
    #introMarche, #image-marche { animation: none; opacity: 1; transition: none; }
    .Vignette, .Vignettebis, .zoom { transition: none; }
}

/* Responsive mobile */
@media (max-width: 767px) {
    .modif-button-annonce,
    .delete-button-annonce {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 80px;
        max-width: 140px;
    }

    .button-container {
        gap: 6px;
        margin-top: 10px;
    }
}
