/* Style général */
#mat360-chat {
  width: 350px;
  max-height: 70vh;
  height: 70vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  z-index: 9999;
}

/* ✅ Mobile = plein écran */
@media (max-width: 768px) {
  #mat360-chat {
    width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}

#mat360-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff5c7a;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 9999;
}

#mat360-chat.hidden {
  display: none;
}

#mat360-chat .chat-header {
  background: #ff5c7a;
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Messages */
.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f5f5f7;
}

.chat-message {
  margin-bottom: 8px;
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 15px;
  clear: both;
}

.chat-message.user {
  background: #FF5C7A;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 2px;
  text-align: right;
}

.chat-message.other {
  background: #e5e5ea;
  color: #000;
  margin-right: auto;
  border-bottom-left-radius: 2px;
  text-align: left;
}

/* Input */
.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

#chat-message {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
}

#mat360-chat .chat-message {
  white-space: normal;    /* ou pre-wrap si tu veux respecter aussi les doubles espaces */
  word-break: break-word;
}


#chat-send {
  background: #FF5C7A;
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
}

/* ✅ Bouton WhatsApp */
.chat-whatsapp-btn {
  display: block;
  background: #25d366;
  color: #fff;
  padding: 10px;
  /* margin: 10px auto; */
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}
.chat-whatsapp-btn:hover {
  background: #1ebe5d;
}

/* Bouton rappel */
.chat-btn-rappel {
  display: inline-block;
  background: linear-gradient(45deg, #ff5c7a, #ff7b92);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 15px;
  cursor: pointer;
  margin-top: 8px;
  font-weight: bold;
  transition: all 0.3s ease;
}
.chat-btn-rappel:hover {
  background: transparent;
  border: 1px solid #ff5c7a;
  color: #ff5c7a;
}

#rappel-form {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 14px;
}

#rappel-form input,
#rappel-form select,
#rappel-form button {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#rappel-form button {
  background: var(--gradient, linear-gradient(45deg, #ff5c7a, #ff7b92));
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

#rappel-form button:hover {
  background: transparent;
  border: 1px solid #ff5c7a;
  color: #ff5c7a;
}

/* Bloc plein largeur pour le formulaire (hors bulle) */
.chat-message.full {
  max-width: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

/* Carte récap produit au-dessus du form */
.rappel-summary {
  background: #fff;
  border: 1px solid #e9e9ee;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.rappel-summary .muted { color: #666; font-size: 12px; }

/* Le formulaire prend déjà 100% via tes règles, on affine juste l’espacement */
#rappel-form label { display:block; margin: 6px 0 4px; }
#rappel-form input, #rappel-form select, #rappel-form button { width:100%; }
