/* Assistant Ad2Go — feuille autonome (chargée sur toutes les pages, y compris l'accueil
   legacy). Toutes les classes sont préfixées ad2go- pour ne rien percuter. */

.ad2go-chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: #a2d111;
  color: #09241b;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(9, 36, 27, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ad2go-chat-fab:hover { transform: translateY(-3px) scale(1.04); }
.ad2go-chat-fab svg { width: 27px; height: 27px; }
.ad2go-chat-fab.is-open { background: #09241b; color: #fff; }

.ad2go-chat {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 9999;
  width: min(390px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 130px));
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 26px 70px rgba(9, 36, 27, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  font-family: inherit;
}
.ad2go-chat.is-open { opacity: 1; visibility: visible; transform: none; }

.ad2go-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #09241b;
  color: #fff;
}
.ad2go-chat-head > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ad2go-chat-head strong { font-size: 15px; font-weight: 600; }
.ad2go-chat-head span { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }
.ad2go-chat-head button {
  background: none; border: none; color: rgba(255, 255, 255, 0.72);
  cursor: pointer; padding: 4px; display: flex;
}
.ad2go-chat-head button svg { width: 18px; height: 18px; }
.ad2go-chat-avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: #a2d111; color: #09241b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}

.ad2go-chat-body {
  flex: 1;
  /* position:relative indispensable : c'est ce qui fait que offsetTop d'un message est
     mesuré depuis la zone de conversation, et non depuis le panneau entier (sinon le
     scroll automatique dépasse de la hauteur de l'en-tête). */
  position: relative;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f6f5f2;
}
.ad2go-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.6px;
  line-height: 1.62;
  white-space: normal;
  word-break: break-word;
}
.ad2go-msg strong { font-weight: 600; color: #09241b; }
.ad2go-msg em { font-style: normal; color: #5f6b66; font-size: 0.94em; }
.ad2go-bot-line { display: block; }
/* les lignes vides séparent les paragraphes d'une réponse longue */
.ad2go-bot-line:empty { height: 10px; }
/* une réponse de section est longue : on lui laisse toute la largeur utile */
.ad2go-msg-bot {
  max-width: 94%;
  align-self: flex-start;
  background: #fff;
  color: #16241f;
  border: 1px solid #e4e4de;
  border-bottom-left-radius: 5px;
}
.ad2go-msg-user {
  align-self: flex-end;
  background: #09241b;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.ad2go-typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.ad2go-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #9aa5a0;
  animation: ad2goTyping 1.2s infinite ease-in-out;
}
.ad2go-typing span:nth-child(2) { animation-delay: 0.15s; }
.ad2go-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ad2goTyping {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.ad2go-chat-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 12px 14px 4px;
  background: #f6f5f2;
  border-top: 1px solid #eceae4;
}
.ad2go-chip {
  border: 1px solid #d8dcd2; background: #fff; color: #16241f;
  border-radius: 999px; padding: 7px 13px; font-size: 12.3px; font-weight: 500;
  cursor: pointer; font-family: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.ad2go-chip:hover { border-color: #a2d111; background: #f4faE4; }
.ad2go-chip-wa { background: #25d366; border-color: #25d366; color: #fff; font-weight: 600; }
.ad2go-chip-wa:hover { background: #1fb757; border-color: #1fb757; }
.ad2go-chip-wa svg { width: 15px; height: 15px; }

.ad2go-chat-form {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px; background: #f6f5f2;
}
.ad2go-chat-form input {
  flex: 1; min-width: 0; border: 1px solid #dcdfd7; background: #fff;
  border-radius: 999px; padding: 11px 16px; font-size: 13.5px;
  color: #16241f; font-family: inherit; outline: none;
}
.ad2go-chat-form input:focus { border-color: #a2d111; }
.ad2go-chat-form button {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: #a2d111; color: #09241b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ad2go-chat-form button:disabled { opacity: 0.45; cursor: default; }
.ad2go-chat-form button svg { width: 18px; height: 18px; }

.ad2go-chat-note {
  margin: 0; padding: 0 16px 13px; background: #f6f5f2;
  font-size: 10.6px; color: #7b8580; text-align: center;
}
.ad2go-chat-note a { color: #5c7a12; text-decoration: underline; }

@media (max-width: 520px) {
  .ad2go-chat { right: 12px; left: 12px; width: auto; bottom: 86px; max-height: calc(100vh - 120px); }
  .ad2go-chat-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad2go-chat, .ad2go-chat-fab, .ad2go-typing span { transition: none; animation: none; }
}
