/* Meta Services : actions rapides (barre mobile fixe, bouton WhatsApp flottant). */

.ms-action-bar {
  display: none;
}

/* Ordinateur et tablette : WhatsApp flottant, au-dessus de la bulle du chat en direct d'Odoo. */
.ms-whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 1040;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 36, 63, .18);
  transition: transform .15s ease, background-color .15s ease;
}

.ms-whatsapp-float:is(:hover, :focus-visible) {
  background: #1ebe5a;
  color: #fff;
  transform: translateY(-2px);
}

.ms-whatsapp-float:focus-visible {
  outline: 3px solid #163f81;
  outline-offset: 3px;
}

.ms-whatsapp-float svg {
  width: 30px;
  height: 30px;
}

/* Mobile : barre fixe en bas ; pas de bouton flottant ni de bulle de chat (la barre les remplace). */
@media (max-width: 767.98px) {
  .ms-whatsapp-float,
  .o-livechat-root {
    display: none !important;
  }

  .ms-action-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #dbe1e7;
    background: #fff;
    box-shadow: 0 -8px 22px rgba(16, 36, 63, .08);
  }

  .ms-action-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    border-radius: 8px;
    background: #f7f8fa;
    color: #163f81;
    font: 650 13px/1.2 Source, Arial, sans-serif;
    text-decoration: none;
  }

  .ms-action-bar__item:is(:hover, :focus-visible) {
    background: #eef3fb;
    color: #102f65;
  }

  .ms-action-bar__item svg {
    width: 22px;
    height: 22px;
  }

  .ms-action-bar__item--whatsapp {
    color: #128c4b;
  }

  .ms-action-bar__item--audit {
    background: linear-gradient(130deg, #164b9d, #163f81);
    color: #fff;
  }

  .ms-action-bar__item--audit:is(:hover, :focus-visible) {
    background: #102f65;
    color: #fff;
  }

  /* Laisse la place à la barre en bas de page (pied de page lisible jusqu'au bout). */
  #wrapwrap:has(.ms-action-bar) {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

/* Pas d'actions flottantes pendant l'édition dans Odoo. */
body.editor_enable :is(.ms-action-bar, .ms-whatsapp-float) {
  display: none !important;
}
