/* --- CONFIGURATION --- */
:root {
    --rogue-bg-color: #fff; /* Couleur de fond de la recherche */
    --rogue-text-color: #000000;
}

/* 1. LE CADRE DE RÉFÉRENCE */
/* On définit le header comme la limite absolue */
#bloglo-header {
    position: relative !important;
    /* On n'ajoute pas de z-index élevé ici pour rester SOUS la topbar */
}

/* 2. LIBÉRATION DES CONTRAINTES INTERNES */
/* Tous les éléments entre le header et la recherche doivent être neutres */
#bloglo-header-inner,
.bloglo-container,
.bloglo-header-widgets,
.bloglo-header-widget,
.bloglo-header-widget__search,
.bloglo-widget-wrapper {
    position: static !important;
}

/* 3. L'OVERLAY DE RECHERCHE */
/* Par défaut caché */
.bloglo-search-simple {
    display: none !important;
}

/* QUAND ACTIVÉ (Via la classe sur le Body) */
body.rogue-search-active .bloglo-search-simple {
    display: flex !important;
    
    /* Positionnement : Prend 100% de #bloglo-header */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    
    /* Style */
    background-color: var(--rogue-bg-color) !important;
    
    /* Z-INDEX CRUCIAL : 
       Assez haut pour couvrir le logo et le menu (souvent z-index 10 ou 100).
       Mais PAS trop haut pour ne pas passer devant les modals de la TopBar. */
    z-index: 500 !important; 
    
    /* Centrage du contenu */
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    
    /* Reset */
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important; /* Pas d'ombre pour rester discret */
}

/* 4. LE FORMULAIRE */
body.rogue-search-active .bloglo-search-form {
    width: 100%;
    max-width: 1380px;
    display: flex;
    align-items: center;
    position: relative;
    margin: 0 auto !important;
}

/* 5. INPUT TEXTE */
body.rogue-search-active .bloglo-input-search {
    background: transparent !important;
    border: none !important;
    /* Une ligne simple en bas */
    border-bottom: 2px solid #eaeaea !important; 
    font-size: 22px !important; /* Taille adaptée au header */
    font-weight: 600 !important;
    color: var(--rogue-text-color) !important;
    width: 100% !important;
    height: 50px !important; /* Hauteur contenue */
    outline: none !important;
    padding-right: 60px !important;
}

body.rogue-search-active .bloglo-input-search::placeholder {
    color: #ccc;
    font-weight: 400;
}

/* 6. BOUTON FERMER (LA CROIX NOIRE) */
body.rogue-search-active .bloglo-search-close {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    display: block !important;
    z-index: 10;
}
body.rogue-search-active .bloglo-search-close svg {
    width: 20px !important;
    height: 20px !important;
    fill: #333 !important;
    transition: fill 0.3s;
}
body.rogue-search-active .bloglo-search-close:hover svg {
    fill: var(--rh24-brand, #e04b43) !important; /* Rouge au survol */
}

/* 7. BOUTON LOUPE (Interne au champ) */
body.rogue-search-active .bloglo-animate-arrow {
    position: absolute !important;
    right: 40px !important; /* À gauche de la croix */
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
}
body.rogue-search-active .bloglo-animate-arrow svg {
    width: 24px !important;
    height: 24px !important;
    fill: #333 !important;
}

/* 8. MASQUER L'ICÔNE D'ORIGINE */
body.rogue-search-active .bloglo-header-widget__search > .bloglo-search {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 9. SUPPRIMER LA CROIX BLEUE AUTOMATIQUE */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none !important;
    -webkit-appearance: none !important;
}
