/* ============================================
   Styles pour la barre de recherche fonctionnelle
   Complète ton CSS existant (ne le remplace pas,
   ajoute ce bloc à la suite de ton fichier).
   ============================================ */

#searchBox {
    position: relative; /* nécessaire pour positionner le dropdown de suggestions */
}

/* Évite que le header (fixe) cache la recette visée par le lien #ancre */
.recette {
    scroll-margin-top: 120px; /* ajuste selon la hauteur réelle de ton header */
}

/* Lien affiché quand une seule recette est filtrée depuis la recherche */
.retour-recettes {
    display: inline-block;
    margin: 15px;
    padding: 8px 18px;
    background-color: rgb(240, 230, 140);
    color: #222;
    font-weight: bold;
    text-decoration: none;
    border-radius: 20px;
    transition: 0.3s ease-in-out;
}

.retour-recettes:hover {
    background-color: white;
}

/* On ne touche pas à la visibilité/largeur de #search :
   elle garde exactement le style que tu avais déjà. */

/* Liste de suggestions, créée automatiquement par le JS */
#searchSuggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    right: 15px; /* aligné avec le décalage de #search (right: 15px) */
    left: auto;
    min-width: 220px;
    background-color: rgb(240, 230, 140);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: none;
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
}

#searchSuggestions.active {
    display: block;
}

#searchSuggestions li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #222;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: 0.3s ease-in-out;
}

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

#searchSuggestions li:hover,
#searchSuggestions li.highlighted {
    background-color: white;
    color: #222;
}

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

#searchBox {
    /*position: relative;*/
    display: flex;
    /*justify-content: center;*/
    /*align-items: center;*/
    /*width: 300px;
    height: 60px;*/
}

#searchForm {
    display: flex;
}

form {
    width: 100%;
}

#search {
    z-index: 1;
    position: relative;
    right: 15px;
    /*width: 250px;*/
    /*height: 90%;*/
    border: none;
    border-bottom: 1px solid #ffffff;
    background-color: rgba(255, 255,255, 0.05);
    outline: none;
    color: white;
    /*border-radius: 50px;*/
    padding: 0px 0px 0px 40px;
    margin: 5px 0px 5px 0px;
    transition: 0.5s ease-in-out;
}

#search::placeholder {
    color: white;
}

#btn {
    z-index: 2;
    /*position: absolute;
    left: 0;
    top: 10px;*/
    border: 2px solid transparent;
    border-color: white;
    outline: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgb( 240, 230, 140);
    transition: 0.5s ease-in-out;
}

#btn:hover {
    background-color: white;
    border-color: transparent;
}
   

#btn img {
    width: 20px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    /* La mise en page du header mobile (hamburger + recherche à droite)
       est gérée dans style.css. On ne garde ici que les ajustements
       propres à la recherche elle-même. */
    #btn {
        width: 34px;
        height: 34px;
    }

    #btn img{
        width: 16px;
    }

    #search {
        padding-left: 30px;
        font-size: 0.9rem;
    }
}