.cc-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cc-chatbot__title {
  font-weight: 600;
}

.cc-chatbot__toggle {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}
/* Etat réduit : on ne garde qu'une petite bulle */
.cc-chatbot.is-minimized {
  width: 64px;
  height: 64px;
  border-radius: 999px;
}

/* Cacher tout sauf le header quand réduit */
.cc-chatbot.is-minimized .cc-chatbot__messages,
.cc-chatbot.is-minimized .cc-chatbot__actions,
.cc-chatbot.is-minimized .cc-chatbot__form {
  display: none;
}

/* En mode réduit, header centré */
.cc-chatbot.is-minimized .cc-chatbot__header {
  height: 100%;
  border-bottom: 0;
  background: #fff;
  color: #fff;
  justify-content: center;
}

/* Cache le texte du titre en mode réduit (icone/bouton uniquement) */
.cc-chatbot.is-minimized .cc-chatbot__title {
  display: none;
}

/* Bouton en mode réduit : plus visible */
.cc-chatbot.is-minimized .cc-chatbot__toggle {
  border-color: rgba(255,255,255,0.35);
  background: transparent;
  color: #fff;
}

.cc-chatbot {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.cc-chatbot__header {
  padding: 0;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.cc-chatbot__messages {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.cc-msg { margin: 8px 0; display: flex; }
.cc-msg--user { justify-content: flex-end; }
.cc-msg--bot  { justify-content: flex-start; }

.cc-msg__bubble {
  max-width: 90%;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  white-space: pre-wrap;
  line-height: 1.2;
  font-size:15px;
}

.cc-msg--user .cc-msg__bubble {
  background: #f1ecec;
  color: #3a3939;
}

.cc-chatbot__actions {
  padding: 10px 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* .cc-action {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  cursor: pointer;
  font-size:15px;
}
*/

.cc-chatbot__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.cc-chatbot__input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
}

.cc-chatbot__send {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

/* Mobile: plein écran */
@media (max-width: 480px) {
  .cc-chatbot {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}
/* Bouton toggle */
.cc-chatbot__toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icône image */
.cc-chatbot__toggle-icon {
  width: 22px;
  height: 22px;
  display: none; /* cachée par défaut */
}

/* Tiret */
.cc-chatbot__toggle-minus {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  display: inline-block;
}

/* --- LOGIQUE D'AFFICHAGE --- */

/* Chatbot RÉDUIT → image visible, tiret caché */
.cc-chatbot.is-minimized .cc-chatbot__toggle-icon {
  display: block;
}

.cc-chatbot.is-minimized .cc-chatbot__toggle-minus {
  display: none;
}

/* Chatbot OUVERT → tiret visible, image cachée */
.cc-chatbot:not(.is-minimized) .cc-chatbot__toggle-icon {
  display: none!important;
}

.cc-chatbot:not(.is-minimized) .cc-chatbot__toggle-minus {
  display: inline-block;
}
/* ============================
   CHATBOT — AFFICHAGE MOBILE
   ============================ */

@media (max-width: 768px) {

  /* chatbot ouvert */
  #cc-chatbot:not(.is-minimized) {
    width: 70vw;
    height: 70vh;
    max-width: 70vw;
    max-height: 70vh;

    bottom: 15px;
    right: 15px;

    border-radius: 16px;
  }

  /* zone messages scrollable */
  #cc-chatbot:not(.is-minimized) .cc-chatbot__messages {
    height: calc(70vh - 120px);
    overflow-y: auto;
  }

}

.cc-msg__bubble--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cc-msg__bubble--actions .cc-action {
  background: #c92944;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.cc-msg__bubble--actions .cc-action:hover {
  opacity: 0.9;
}

/* typing bubble */
.cc-msg__bubble--typing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
}

/* 3 dots */
.cc-typing__dots {
  display: inline-flex;
  gap: 6px;
}

.cc-typing__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  animation: ccTypingDot 1s infinite;
}

.cc-typing__dot:nth-child(2) { animation-delay: 0.15s; }
.cc-typing__dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes ccTypingDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 0.9; }
}

