/**
 * Styles pour le widget de recherche en plein écran
 */

/* Réinitialisation des styles pour éviter les conflits */
.fullscreen-search-overlay *,
.fullscreen-search-overlay *::before,
.fullscreen-search-overlay *::after {
    box-sizing: border-box;
}

/* Icône de recherche */
.fullscreen-search-trigger {
    display: inline-flex;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.fullscreen-search-trigger i,
.fullscreen-search-trigger svg {
    transition: color 0.3s ease, fill 0.3s ease;
}

/* Overlay de recherche en plein écran */
.fullscreen-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fullscreen-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Animation d'entrée */
.fullscreen-search-overlay.active .search-overlay-content {
    transform: translateY(0);
    opacity: 1;
}

/* Contenu de l'overlay */
.search-overlay-content {
    width: 80%;
    max-width: 800px;
    text-align: center;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.5s ease;
    position: relative;
}

/* Formulaire de recherche */
.fullscreen-search-form {
    margin-bottom: 30px;
}

/* Conteneur pour le champ de recherche et le bouton */
.search-input-container {
    position: relative;
    width: 100%;
}

/* Champ de recherche */
.fullscreen-search-overlay .search-field {
    width: 100%;
    background-color: transparent;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: #fff;
    font-size: 2rem;
    padding: 15px 0;
    text-align: center;
    outline: none !important;
    transition: border-color 0.3s ease;
    box-shadow: none !important;
    border-radius: 0 !important;
    -webkit-appearance: none;
    margin: 0;
    font-family: inherit;
    line-height: normal;
    box-sizing: border-box;
}

.fullscreen-search-overlay .search-field:focus {
    border-color: var(--e-global-color-primary, #ff9690);
    outline: none;
    box-shadow: none;
}

.fullscreen-search-overlay .search-field::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

/* Bouton de soumission */
.fullscreen-search-overlay .search-submit {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease;
}

.fullscreen-search-overlay .search-submit:hover,
.fullscreen-search-overlay .search-submit:focus {
    color: var(--e-global-color-primary, #ff9690);
    outline: none;
}

.fullscreen-search-overlay .search-submit i,
.fullscreen-search-overlay .search-submit svg {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    transition: color 0.3s ease;
    color: inherit;
    fill: currentColor;
}

/* Masquer spécifiquement le bouton d'effacement (croix) dans les champs de recherche */
.fullscreen-search-overlay .search-field::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

/* Pour Microsoft Edge */
.fullscreen-search-overlay .search-field::-ms-clear {
    display: none;
}

/* Pour Firefox */
.fullscreen-search-overlay .search-field {
    /* Firefox peut utiliser un autre système, cette propriété aide à contrôler les éléments internes */
    appearance: textfield;
}

/* Bouton de fermeture */
.fullscreen-search-overlay .close-search {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 15px;
    margin-top: 20px;
    transition: color 0.3s ease, background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    box-shadow: none;
    font-family: inherit;
    line-height: normal;
    border-radius: 0;
}

.fullscreen-search-overlay .close-search:hover,
.fullscreen-search-overlay .close-search:focus {
    color: var(--e-global-color-primary, #ff9690);
    outline: none;
    box-shadow: none;
    background-color: transparent;
}

/* Styles spécifiques pour l'icône de fermeture */
.fullscreen-search-overlay .close-search i,
.fullscreen-search-overlay .close-search svg {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transition: color 0.3s ease !important;
    color: inherit !important;
    fill: currentColor !important;
}

/* Surcharger les styles de l'icône */
.fullscreen-search-overlay .close-search svg path,
.fullscreen-search-overlay .close-search svg line,
.fullscreen-search-overlay .close-search svg circle,
.fullscreen-search-overlay .close-search svg rect,
.fullscreen-search-overlay .close-search svg polygon {
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Animation pour verrouiller le défilement du body quand l'overlay est actif */
body.search-overlay-open {
    overflow: hidden;
}

/* Styles pour les appareils mobiles */
@media (max-width: 767px) {
    .fullscreen-search-overlay .search-field {
        font-size: 1.5rem;
        padding: 10px 0;
    }

    .search-overlay-content {
        width: 90%;
    }

    /* Améliorations pour mobile */
    .fullscreen-search-overlay .close-search {
        padding: 15px;
        margin-top: 30px;
        font-size: 16px;
    }

    .fullscreen-search-overlay .close-search i,
    .fullscreen-search-overlay .close-search svg {
        font-size: 28px !important;
        width: 28px !important;
        height: 28px !important;
    }

    /* Ajuster la taille du placeholder pour mobile */
    .fullscreen-search-overlay .search-field::placeholder {
        font-size: 1.2rem;
    }

    /* Assurer une zone de toucher suffisante */
    .fullscreen-search-trigger {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fullscreen-search-overlay .search-submit i,
    .fullscreen-search-overlay .search-submit svg {
        width: 20px;
        height: 20px;
    }

    .fullscreen-search-overlay .search-field {
        padding-right: 40px;
    }
}