/* Correctif ciblé badge notifications : taille compacte, alignement propre, jamais derrière la photo profil.
   Uniquement CSS. Aucune règle métier ni page PHP modifiée. */

/* Badge de la cloche dans la barre du haut */
.notification-bell{
  position:relative !important;
  overflow:visible !important;
  z-index:40 !important;
  flex:0 0 auto !important;
}

.topbar-right .notification-bell .badge,
.notification-bell > .badge{
  position:absolute !important;
  top:2px !important;
  right:1px !important;
  left:auto !important;
  bottom:auto !important;
  transform:translate(35%,-35%) !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:16px !important;
  width:auto !important;
  height:16px !important;
  min-height:16px !important;
  max-height:16px !important;
  padding:0 4px !important;
  border-radius:999px !important;
  border:2px solid #fff !important;
  box-sizing:border-box !important;
  font-family:Arial, Helvetica, sans-serif !important;
  font-size:9px !important;
  font-weight:800 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
  text-align:center !important;
  white-space:nowrap !important;
  z-index:999 !important;
  pointer-events:none !important;
  box-shadow:0 1px 4px rgba(15,23,42,.25) !important;
}

.topbar-right .profile-chip{
  position:relative !important;
  z-index:20 !important;
}

/* Badge de la barre basse mobile/tablette */
.mobile-bottom-nav-facebook,
.mobile-bottom-nav-facebook .mobile-bottom-notification-item,
.mobile-bottom-nav-facebook .bottom-nav-icon-wrap{
  overflow:visible !important;
}

.mobile-bottom-nav-facebook .mobile-bottom-notification-item{
  position:relative !important;
  z-index:35 !important;
}

.mobile-bottom-nav-facebook .mobile-bottom-profile-item{
  position:relative !important;
  z-index:20 !important;
}

.mobile-bottom-nav-facebook .bottom-nav-icon-wrap{
  position:relative !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:24px !important;
  height:24px !important;
  min-width:24px !important;
  margin:0 auto 2px auto !important;
}

.mobile-bottom-nav-facebook .bottom-nav-badge{
  position:absolute !important;
  top:-5px !important;
  right:-8px !important;
  left:auto !important;
  bottom:auto !important;
  transform:none !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:13px !important;
  width:auto !important;
  height:13px !important;
  min-height:13px !important;
  max-height:13px !important;
  padding:0 3px !important;
  border-radius:999px !important;
  border:1.5px solid #fff !important;
  box-sizing:border-box !important;
  background:#dc2626 !important;
  color:#fff !important;
  font-family:Arial, Helvetica, sans-serif !important;
  font-size:7.5px !important;
  font-weight:800 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
  text-align:center !important;
  white-space:nowrap !important;
  z-index:999 !important;
  pointer-events:none !important;
  box-shadow:0 1px 3px rgba(15,23,42,.25) !important;
}

@media screen and (max-width:480px){
  .mobile-bottom-nav-facebook .bottom-nav-icon-wrap{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
  }

  .mobile-bottom-nav-facebook .bottom-nav-badge{
    top:-4px !important;
    right:-7px !important;
    min-width:12px !important;
    height:12px !important;
    min-height:12px !important;
    max-height:12px !important;
    padding:0 2.5px !important;
    font-size:7px !important;
  }

  .mobile-bottom-nav-facebook .bottom-nav-avatar{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    min-height:22px !important;
  }
}

@media screen and (max-width:360px){
  .mobile-bottom-nav-facebook .bottom-nav-badge{
    right:-6px !important;
    min-width:11px !important;
    height:11px !important;
    min-height:11px !important;
    max-height:11px !important;
    font-size:6.5px !important;
  }
}

/* Correctif 2 ciblé depuis capture écran :
   - la barre basse contient 6 menus, donc chaque bouton = 1/6 de largeur ;
   - le badge reste dans la zone Notif. et ne peut plus passer sous Profil ;
   - quand il y a une notification, l'icône Notif. change de couleur. */
@media screen and (max-width:768px){
  body nav.mobile-bottom-nav-facebook{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    justify-content:space-between !important;
    align-items:stretch !important;
    overflow:visible !important;
  }

  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-item,
  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-notification-item,
  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-profile-item{
    flex:0 0 16.6667% !important;
    width:16.6667% !important;
    max-width:16.6667% !important;
    min-width:0 !important;
    overflow:visible !important;
    position:relative !important;
    box-sizing:border-box !important;
  }

  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-notification-item{
    z-index:1000 !important;
  }

  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-profile-item{
    z-index:900 !important;
  }

  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item .bottom-nav-icon-wrap{
    position:relative !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:24px !important;
    min-width:24px !important;
    height:24px !important;
    margin:0 auto 3px auto !important;
    overflow:visible !important;
  }

  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item .bottom-nav-badge{
    position:absolute !important;
    top:-3px !important;
    right:-6px !important;
    left:auto !important;
    bottom:auto !important;
    transform:none !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:12px !important;
    width:auto !important;
    height:12px !important;
    min-height:12px !important;
    max-height:12px !important;
    padding:0 3px !important;
    border-radius:999px !important;
    border:1.5px solid #fff !important;
    background:#dc2626 !important;
    color:#fff !important;
    font-size:7px !important;
    font-weight:900 !important;
    line-height:1 !important;
    text-align:center !important;
    white-space:nowrap !important;
    z-index:2147483647 !important;
    pointer-events:none !important;
    box-shadow:0 1px 3px rgba(15,23,42,.28) !important;
  }

  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item.has-notification,
  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item:has(.bottom-nav-badge){
    color:#dc2626 !important;
  }

  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item.has-notification i,
  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item.has-notification > span:last-child,
  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item:has(.bottom-nav-badge) i,
  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item:has(.bottom-nav-badge) > span:last-child{
    color:#dc2626 !important;
  }
}

@media screen and (max-width:390px){
  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-item,
  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-notification-item,
  body nav.mobile-bottom-nav-facebook > a.mobile-bottom-profile-item{
    flex-basis:16.6667% !important;
    width:16.6667% !important;
    max-width:16.6667% !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }

  body nav.mobile-bottom-nav-facebook .mobile-bottom-notification-item .bottom-nav-badge{
    top:-3px !important;
    right:-5px !important;
    min-width:11px !important;
    height:11px !important;
    min-height:11px !important;
    max-height:11px !important;
    padding:0 2px !important;
    font-size:6.5px !important;
  }
}

/* Barre du haut : couleur de la cloche quand une notification existe. */
.notification-bell.has-notification,
.notification-bell:has(.badge){
  color:#dc2626 !important;
}
.notification-bell.has-notification i,
.notification-bell:has(.badge) i{
  color:#dc2626 !important;
}
