.ec-chatbot {
  bottom: 20px;
  color: #202124;
  font-family: Arial, sans-serif;
  position: fixed;
  right: 20px;
  z-index: 10002;
}

.ec-chatbot__toggle {
  background: #43a047;
  border: 0;
  border-radius: 22px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 18px;
  white-space: nowrap;
}

.ec-chatbot__toggle:hover,
.ec-chatbot__toggle:focus {
  background: #2e7d32;
}

.ec-chatbot__toggle-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  vertical-align: middle;
}

.ec-chatbot__form button {
  background: #c72026;
  border: 0;
  border-radius: 22px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 18px;
}

.ec-chatbot__panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  bottom: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  max-height: 520px;
  overflow: hidden;
  position: absolute;
  right: 0;
  max-width: calc(100vw - 30px);
  width: 370px;
}

.ec-chatbot__panel[hidden] {
  display: none;
}

.ec-chatbot__panel.ec-chatbot__panel--open {
  display: flex;
}

.ec-chatbot__panel.ec-chatbot__panel--expanded {
  bottom: 0;
  height: calc(100vh - 40px);
  max-height: 760px;
  max-width: calc(100vw - 40px);
  width: 760px;
}

.ec-chatbot__header {
  align-items: center;
  background: #222;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
}

.ec-chatbot__page-label {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  color: #444;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  padding: 7px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-chatbot__page-label[hidden] {
  display: none;
}

.ec-chatbot__header-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.ec-chatbot__close,
.ec-chatbot__expand,
.ec-chatbot__reset {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 2px 5px;
}

.ec-chatbot__close {
  font-size: 24px;
}

.ec-chatbot__expand,
.ec-chatbot__reset {
  font-size: 20px;
}

.ec-chatbot__topics-bar {
  align-items: center;
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 10px;
}

.ec-chatbot__topics-label {
  color: #888;
  font-size: 11px;
  white-space: nowrap;
}

.ec-chatbot__topic-chip {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 11px;
  color: #444;
  cursor: pointer;
  font-size: 11px;
  padding: 3px 9px;
  white-space: nowrap;
}

.ec-chatbot__topic-chip:hover,
.ec-chatbot__topic-chip:focus {
  background: #222;
  border-color: #222;
  color: #fff;
}

.ec-chatbot__messages {
  background: #f5f5f5;
  color: #202124;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.ec-chatbot__message {
  background: #fff;
  border-radius: 10px;
  color: #202124 !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 10px;
  max-width: 88%;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.ec-chatbot__typing {
  align-items: center;
  background: #fff;
  border-radius: 10px;
  display: flex;
  gap: 5px;
  margin: 0 0 10px;
  max-width: 70px;
  padding: 12px 14px;
}

.ec-chatbot__typing span {
  animation: ec-chatbot-bounce 1.2s infinite ease-in-out;
  background: #aaa;
  border-radius: 50%;
  display: block;
  height: 8px;
  width: 8px;
}

.ec-chatbot__typing span:nth-child(2) { animation-delay: 0.2s; }
.ec-chatbot__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ec-chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

.ec-chatbot__fallback {
  background: #fff;
  border-radius: 10px;
  color: #555;
  padding: 10px 12px;
}

.ec-chatbot__message--user {
  background: #222;
  color: #fff !important;
  margin-left: auto;
}

.ec-chatbot__message a {
  background: #c72026;
  border-radius: 5px;
  color: #fff !important;
  display: inline-block;
  font-weight: 700;
  margin: 2px 0 2px 4px;
  padding: 2px 7px;
  text-decoration: none;
}

.ec-chatbot__message a:hover,
.ec-chatbot__message a:focus {
  background: #9e171c;
  color: #fff !important;
  text-decoration: none;
}

/* Champ honeypot anti-bot : present dans le DOM mais hors ecran, jamais visible pour un client. */
.ec-chatbot__honeypot {
  height: 1px !important;
  left: -10000px !important;
  overflow: hidden !important;
  position: absolute !important;
  top: auto !important;
  width: 1px !important;
}

.ec-chatbot__form {
  display: flex;
  gap: 8px;
  padding: 10px;
}

.ec-chatbot__form textarea {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 8px;
  flex: 1;
  color: #202124 !important;
  font-size: 14px;
  padding: 9px;
  resize: none;
}

.ec-chatbot__form button {
  align-self: flex-end;
  border-radius: 8px;
  padding: 10px 12px;
}

.ec-chatbot__notice {
  background: #fff;
  color: #4b4b4b !important;
  padding: 0 10px 10px;
}

.ec-chatbot__active-product {
  align-items: center;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 10px;
}

.ec-chatbot__active-product[hidden] {
  display: none;
}

.ec-chatbot__active-product-name {
  color: #444;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-chatbot__active-product-change {
  background: #c72026;
  border: 1px solid #c72026;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 9px;
  white-space: nowrap;
}

.ec-chatbot__active-product-change:hover,
.ec-chatbot__active-product-change:focus {
  background: #9e171c;
  border-color: #9e171c;
}

.ec-chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 10px;
}

.ec-chatbot__suggestion {
  background: #fff;
  border: 1px solid #c72026;
  border-radius: 14px;
  color: #c72026;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-chatbot__suggestion:hover,
.ec-chatbot__suggestion:focus {
  background: #c72026;
  color: #fff;
}

.ec-chatbot__suggestion--selected {
  background: #c72026;
  border-color: #c72026;
  color: #fff;
}

.ec-chatbot__suggestions-hint {
  color: #666;
  font-size: 12px;
  margin: 0 0 6px;
  width: 100%;
}

@media (max-width: 1440px) and (min-width: 481px) {
  /* Au-dessus du bloc eKomi (bottom:0 right:2%) + taille réduite */
  .ec-chatbot {
    bottom: 77px;
    right: 2%;
  }

  .ec-chatbot__toggle {
    font-size: 11.5px;
    padding: 8px 8px;
  }
}

@media (max-width: 480px) {
  .ec-chatbot {
    bottom: 75px;
    right: 5px;
  }

  .ec-chatbot__toggle-text {
    display: none;
  }

  .ec-chatbot__toggle-icon {
    margin-right: 0;
  }

  .ec-chatbot__toggle-icon svg {
    width: 22px;
    height: 22px;
  }

  .ec-chatbot__toggle {
    border-radius: 50%;
    padding: 12px 14px;
  }

  /* En mode élargi sur mobile : panneau fixé en plein écran via position:fixed
     pour éviter qu'il dépasse les bords et que le bouton réduire reste accessible */
  .ec-chatbot__panel.ec-chatbot__panel--expanded {
    border-radius: 8px;
    bottom: 5px;
    height: 90dvh;
    height: 90vh;
    max-height: 90vh;
    max-width: 96vw;
    position: fixed;
    right: 2vw;
    width: 96vw;
    z-index: 10001;
  }
}

/* Accueil en bulles non cliquables v2.6.47 */
.ec-chatbot__welcome {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  padding: 14px;
}

.ec-chatbot__welcome-title {
  color: #252525;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.ec-chatbot__welcome-bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ec-chatbot__welcome-bubble {
  background: #f7f8fa;
  border: 1px solid #e1e4e8;
  border-left: 4px solid #f80823;
  border-radius: 10px;
  color: #303030;
  cursor: default;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 11px;
  user-select: text;
}

.ec-chatbot__page-label {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: row;
  gap: 5px;
  min-width: 0;
  padding: 8px 12px;
  white-space: nowrap;
}

.ec-chatbot__page-label-caption {
  color: #777;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ec-chatbot__page-label-name {
  color: #f80823;
  display: block;
  flex: 1;
  font-size: 14px;
  min-width: 0;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .ec-chatbot__welcome {
    padding: 12px;
  }

  .ec-chatbot__welcome-bubble {
    font-size: 12px;
    padding: 8px 10px;
  }
}
