header#headerPage{
    z-index: 100;
    width: 100%;
    height: 95px;
    position: fixed;
    top: 0;
    left: 0;
    background: #FFF;
    border-bottom: none;
}
header#headerPage.has-arrow {
    height: 105px;
}
header#headerPage #headerHolder{
    display: flex;
    align-items: center;
    max-width: 1398px;
    width: 93.5%;
    margin: 0 auto;
    height: 105px;
    padding-bottom: 20px;
}
header#headerPage #headerHolder.has-arrow {
    padding-bottom: 30px !important;
}
header#headerPage #headerHolder #logoKiwiiz{
    width: 85px;
}
header#headerPage .partie{
    display: flex;
    align-items: center;
    gap: 16px;
}
header#headerPage #part1{
    margin-left: 20px;
}
header#headerPage #part2,header#headerPage #part3{
    margin-left: auto;
}
header#headerPage #part3{
    gap: min(2.611325vw, 38px);
}
#SearchBarHolder,
.SearchBarHolder{
    position: relative;
    box-sizing: border-box;
    padding: 4px 4px 4px 17px;
    width: min(42vw, 610px);
    height: 51px;
    border-radius: 50px;
    border:1px solid #ecedf0;
    background: #FFF;
    display: flex;
}
#SearchBarHolder form,
.SearchBarHolder form{
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin: 0;
    --transition-searchBar: 0.5s ease-out;
    position: relative;
}
#SearchBarHolder form input,
.SearchBarHolder form input{
    border: none;
    color: #8D98A8;
    font-family: Quicksand;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding: 0;
    height: -webkit-fill-available;
}
#SearchBarHolder form input:focus-visible,
.SearchBarHolder form input:focus-visible{
    outline: none;
    background-color: white;
}
#SearchBarHolder form #shownewmenu{
    width: 0;
    transition: var(--transition-searchBar);
}
#SearchBarHolder form #util_cp{
    width: 0;
    transition: var(--transition-searchBar);
}
.SearchBarHolder form .js-search-text{
    width: 0;
    transition: var(--transition-searchBar);
}
.SearchBarHolder form .js-util-cp{
    width: 0;
    transition: var(--transition-searchBar);
}
#SearchBarHolder form #util_cp.currentlyDisplayed,
.SearchBarHolder form .js-util-cp.currentlyDisplayed{
    min-width: 190px;
}
#SearchBarHolder form .currentlyDisplayed,
.SearchBarHolder form .currentlyDisplayed{
    flex-grow: 1;
}
#SearchBarHolder form img,
.SearchBarHolder form img{
    width: 22px;
    height: 32px;
    margin: 0 16px;
    cursor: pointer;
}
#SearchBarHolder #rechercher,
.SearchBarHolder .rechercher{
    background:linear-gradient(72deg, #F907FC 0.03%, #0779FF 100%);
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    border: none;
    margin-top:5px;
    margin-right:5px;
}
.SearchBarHolder .rechercher{
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.SearchBarHolderLanding{
    margin: 16px auto 0 auto;
    max-width: 610px;
    width: min(84vw, 610px);
    box-shadow: 5px 7px 20px -18px black;
}
#locationHint {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    bottom: -30px;
    right: calc(32px + 5px + 12px + 8px);
    /* Aligne avec l'icône de localisation */
    z-index: 1;
}
#locationHint #arrowLocation {
    width: 56px;
    height: 28px;
    display: block;
    flex-shrink: 0;
}
#locationHint p {
    color: #1D3253;
    font-family: Quicksand;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin: 0;
    white-space: nowrap;
}
header#headerPage #postAnnonceHeader{
    display: flex;
    align-items: center;
    column-gap: 12px;
    margin-left: min(1.3889vw, 20px);
    margin-right: min(1.3889vw, 20px);
    padding: 16px min(2.2222vw, 38px);
    border-radius: 37px;
    background: linear-gradient(72deg, #F907FC 0.03%, #0779FF 100%);
    transition: 0.3s;
}
header#headerPage #postAnnonceHeader:hover{
    text-decoration: none;
    box-shadow: 0px 0px 2px 6px rgba(253, 159, 254, 0.40);
}
header#headerPage #postAnnonceHeader img{
    filter: invert(1);
    width: 14px;
    height: 16px;
}
header#headerPage #postAnnonceHeader p{
    margin: 0;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-family: Quicksand;
}
header#headerPage #inscription,header#headerPage #connection{
    display: block;
    color: #1D3253;
    font-family: Quicksand;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    padding: 16px min(2.2222vw, 28px);
    border-radius: 37px;
    border: 0.5px solid #1D3253;
    background: #FFF;
    box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.05);
    transition: 0.5s;
    text-align: center;
}
header#headerPage #inscription{
    color: #FFF;
    background: #1D3253;
    border: none;
}
header#headerPage #inscription:hover{
    background: #617087;
    text-decoration: none;
}
header#headerPage #connection:hover{
    text-decoration: none;
    background: #E8EAEE;
    border: 1px solid transparent;
}
header#headerPage .iconLink{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
header#headerPage .iconLink img{
    width: auto;
    height: 32px;   
}
header#headerPage .iconLink img#clubButtonHeader{
    width: 57px;
    height: auto;
}

header#headerPage .iconLink > p{
    color: #1D3253;
    font-family: Quicksand;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    margin: 0;
    text-align: center;
}


header#headerPage .iconLink:hover{
    text-decoration: none;
}
header#headerPage .iconLink > div{
    position: relative;
    height: 32px;
}
header#headerPage .iconLink #notification{
    animation: bounce 0.35s ease infinite alternate;
    position: absolute;
    right: -5px;
    top: 0;
    margin: 0;
    border-radius: 100px;
    background-color: red;
    color: #FFF;
    width: 20px;
    height: 20px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #FFF;
}
header#headerPage #profilPicture img{
    width: 57px;
    height: 57px;
    border-radius: 100px;
}

/* S'assurer que la photo de profil garde sa taille normale sur la page profil (règle générale) */
/* Forcer la taille exacte comme sur les autres pages */
body:has(.profil-container) header#headerPage #profilPicture,
#AllSite:has(.profil-container) header#headerPage #profilPicture {
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}
body:has(.profil-container) header#headerPage #profilPicture img,
#AllSite:has(.profil-container) header#headerPage #profilPicture img {
    width: 57px !important;
    height: 57px !important;
    min-width: 57px !important;
    min-height: 57px !important;
    max-width: 57px !important;
    max-height: 57px !important;
    display: block !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
}

/* Desktop : compenser la hauteur du header fixe */
/* Hauteur du header sur desktop : 95px (ou 105px avec la flèche) */
#AllSite {
    padding-top: 95px !important;
}
#AllSite:has(header#headerPage.has-arrow),
#AllSite.has-header-arrow {
    padding-top: 105px !important;
}

/* Annuler le padding-top sur la page messagerie */
/* Cette page gère son propre espacement */
#AllSite:has(.header-messagerie),
#AllSite:has(#messagerie) {
    padding-top: 0 !important;
}

/* Masquer la flèche CP mobile sur desktop (affichée dans le header) */
@media screen and (min-width: 1025px) {
    .locationHint-mobile-wrapper,
    .locationHint-mobile {
        display: none !important;
    }
}

/* S'assurer que le header garde sa hauteur normale sur desktop pour la page profil */
/* Même si la classe mobil-hidden est présente, elle ne doit affecter que le mobile */
@media screen and (min-width: 1025px) {
    header#headerPage.mobil-hidden {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        height: 95px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    header#headerPage.mobil-hidden.has-arrow {
        height: 105px !important;
    }
    header#headerPage.mobil-hidden #headerHolder {
        height: 105px !important;
        display: flex !important;
        visibility: visible !important;
        width: 93.5% !important;
    }
    header#headerPage.mobil-hidden #headerHolder > * {
        display: flex !important;
        visibility: visible !important;
    }
    header#headerPage.mobil-hidden .partie {
        display: flex !important;
        visibility: visible !important;
    }
    
    /* S'assurer que le header sur la page profil a exactement la même hauteur et position que sur les autres pages */
    /* Ajouter un espace au-dessus du header sur la page profil pour correspondre aux autres pages */
    #AllSite:has(.profil-container) header#headerPage {
        height: 95px !important;
        position: fixed !important;
        padding-top: 10px !important;
        left: 0 !important;
    }
    #AllSite:has(.profil-container) header#headerPage.has-arrow {
        height: 105px !important;
    }
    #AllSite:has(.profil-container) header#headerPage #headerHolder {
        height: 105px !important;
    }
    
    /* S'assurer que la photo de profil dans le header garde sa taille normale sur la page profil */
    #AllSite:has(.profil-container) header#headerPage #profilPicture {
        width: auto !important;
        height: auto !important;
        display: block !important;
    }
    #AllSite:has(.profil-container) header#headerPage #profilPicture img {
        width: 57px !important;
        height: 57px !important;
        min-width: 57px !important;
        min-height: 57px !important;
        max-width: 57px !important;
        max-height: 57px !important;
        display: block !important;
    }
}

@media screen and (max-width: 1024px) {

    /* Masquer la flèche CP du header sur mobile - elle est affichée dans le contenu scrollable (locationHint-mobile) */
    header#headerPage #SearchBarHolder #locationHint.locationHint-desktop {
        display: none !important;
    }
    /* Afficher la flèche CP dans le contenu pour qu'elle défile avec les sous-catégories */
    .locationHint-mobile-wrapper {
        display: block;
    }
    .locationHint-mobile-wrapper:empty {
        display: none !important;
    }
    .locationHint-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 0;
        margin: 0;
    }
    .locationHint-mobile .arrowLocation {
        width: 56px;
        height: 28px;
        flex-shrink: 0;
    }
    .locationHint-mobile p {
        color: #1D3253;
        font-family: Quicksand;
        font-size: 14px;
        font-style: normal;
        font-weight: 700;
        line-height: normal;
        margin: 0;
        white-space: nowrap;
    }

    header#headerPage #inscription,header#headerPage #connection{
        padding: 10px 17px 10px 17px;
    }
     header#headerPage #inscription{
        border:0;
     }
    .scrollUp{
        top: -50px !important;
    }
    header#headerPage{
        height: fit-content;
        transition: 0.1s;
    }
    /* S'assurer que #part3 avec mobil-hidden est bien caché sur mobile */
    header#headerPage #part3.mobil-hidden {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
    }
    header#headerPage #headerHolder{
        flex-direction: column;
        gap: 11px;
        height: auto;
        padding: 11px 0 20px 0;
    }
    header#headerPage #headerHolder.has-arrow {
        padding: 11px 0 20px 0;
    }
    header#headerPage #headerHolder div:has(> a #logoKiwiiz){
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin-bottom: 0;
        height: 35px;
    }
    header#headerPage #headerHolder #logoKiwiiz{
        width: 72px;
    }
    header#headerPage #headerHolder div:has(> a #logoKiwiiz) > #connectionMobile{
        display: flex !important;
        gap: 14px;
        margin-left: auto;
        justify-content: flex-end;
    }
    header#headerPage div:has(> a #logoKiwiiz) > #connectionMobile #inscription, header#headerPage  div:has(> a #logoKiwiiz) > #connectionMobile #connection{
        font-size: 14px;
        display: flex;
        align-items: center;
    }
    /* header#headerPage div:has(> a #logoKiwiiz) > #connectionMobile #connection{
        color:#fff;
        background:#1D3253;
        border:0.5px solid #1D3253;
    } */

    header#headerPage #part1{
        width: 100%;
        margin-left: 0;
    }
    #SearchBarHolder{
        width: 100%;
        margin-bottom: 0;
        position: relative;
        z-index: 1; /* Assure que la barre de recherche reste en dessous des catégories */
    }
    /* Ajouter un padding-top au contenu principal pour compenser la hauteur du header fixe */
    /* Hauteur approximative du header sur mobile : logo (35px) + gap (11px) + searchBar (51px) + padding bottom (20px) = ~117px */
    /* Sur mobile la flèche CP est dans le contenu scrollable, pas dans le header */
    #AllSite {
        padding-top: 117px;
    }
    #AllSite:has(header#headerPage.has-arrow) {
        padding-top: 117px;
    }
    /* Page profil : prendre en compte le safe-area (encoche) */
    #AllSite:has(.profil-container) {
        padding-top: calc(117px + env(safe-area-inset-top, 0px));
    }
    
    /* Annuler le padding-top sur les pages messagerie sur mobile */
    #AllSite:has(.header-messagerie),
    #AllSite:has(#messagerie),
    #AllSite:has(#messagerie) {
        padding-top: 0 !important;
    }
    
    /* Masquer la barre de recherche sur mobile pour la page FAQ */
    body:has(#faq) header#headerPage #part1,
    body:has(#faq) header#headerPage #SearchBarHolder {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Masquer la barre de recherche et le bouton poster sur mobile pour la page messagerie */
    body:has(#messagerie) header#headerPage #part1,
    body:has(#messagerie) header#headerPage #SearchBarHolder,
    body:has(#messagerie) header#headerPage #postAnnonceHeader {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ajuster le padding-top pour la page FAQ sur mobile */
    body:has(#faq) #AllSite {
        padding-top: 60px !important;
    }
}