/* Chat IA Piscine WebStore */
#pwschat-bulle, #pwschat-panneau, #pwschat-encart { font-family: "Open Sans", Arial, sans-serif; box-sizing: border-box; }
#pwschat-panneau *, #pwschat-encart * { box-sizing: border-box; }
/* Protection contre les styles globaux du thème (boutons, champs) */
#pwschat-bulle, #pwschat-panneau button, #pwschat-encart button, #pwschat-panneau textarea, #pwschat-panneau input {
  margin: 0; min-width: 0; min-height: 0; text-transform: none; letter-spacing: normal; text-shadow: none;
  box-shadow: none; float: none; font-family: inherit; line-height: normal; width: auto; height: auto;
}
#pwschat-bulle, #pwschat-panneau button, body #pwschat-encart button { padding: 0; }

body #pwschat-bulle {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000000;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: #922990; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; transition: transform .2s;
}
#pwschat-bulle:hover { transform: scale(1.06); }
#pwschat-bulle svg { width: 30px; height: 30px; fill: #fff; }
#pwschat-bulle .pwschat-x { display: none; }
body.pwschat-ouvert #pwschat-bulle .pwschat-ico { display: none; }
body.pwschat-ouvert #pwschat-bulle .pwschat-x { display: block; }

#pwschat-panneau {
  position: fixed; right: 20px; bottom: 92px; z-index: 1000000;
  width: 380px; height: 600px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: none; flex-direction: column; overflow: hidden;
}
body.pwschat-ouvert #pwschat-panneau { display: flex; }

.pwschat-tete { background: #922990; color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.pwschat-tete-txt { flex: 1; min-width: 0; }
.pwschat-tete strong { display: block; font-size: 16px; line-height: 1.2; }
.pwschat-tete span { display: block; font-size: 12px; opacity: .9; }
#pwschat-panneau .pwschat-fermer { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }

.pwschat-fil { flex: 1; overflow-y: auto; padding: 14px; background: #faf7fa; }
.pwschat-msg { max-width: 85%; margin: 0 0 10px; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.pwschat-msg.bot { background: #fff; color: #222; border: 1px solid #eadfea; border-bottom-left-radius: 4px; }
.pwschat-msg.client { background: #922990; color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.pwschat-msg a { color: inherit; text-decoration: underline; }
.pwschat-msg.bot a { color: #922990; }
.pwschat-msg ul { margin: 6px 0; padding-left: 18px; }

.pwschat-attente { display: inline-flex; gap: 4px; padding: 12px 14px; }
.pwschat-attente i { width: 7px; height: 7px; border-radius: 50%; background: #b88ab7; animation: pwschat-pt 1.2s infinite; }
.pwschat-attente i:nth-child(2) { animation-delay: .2s; }
.pwschat-attente i:nth-child(3) { animation-delay: .4s; }
@keyframes pwschat-pt { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.pwschat-choix { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
#pwschat-panneau .pwschat-choix button { border: 1px solid #922990; background: #fff; color: #922990; border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
#pwschat-panneau .pwschat-choix button:hover { background: #922990; color: #fff; }

.pwschat-saisie { border-top: 1px solid #eee; padding: 10px; background: #fff; }
.pwschat-ligne { display: flex; gap: 8px; align-items: flex-end; }
#pwschat-panneau .pwschat-ligne textarea {
  flex: 1; resize: none; border: 1px solid #ddd; border-radius: 10px; padding: 9px 11px;
  font: inherit; font-size: 14px; line-height: 1.35; max-height: 110px; min-height: 40px; outline: none;
}
#pwschat-panneau .pwschat-ligne textarea:focus { border-color: #922990; }
#pwschat-panneau .pwschat-envoyer { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #922990; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
#pwschat-panneau .pwschat-envoyer:disabled { opacity: .45; cursor: default; }
#pwschat-panneau .pwschat-envoyer svg { width: 20px; height: 20px; fill: #fff; }
.pwschat-mention { font-size: 11px; color: #888; margin: 6px 2px 0; line-height: 1.3; }
.pwschat-mention a { color: #888; }

.pwschat-form { background: #fff; border: 1px solid #eadfea; border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.pwschat-form p { margin: 0 0 8px; font-size: 13px; color: #444; }
#pwschat-panneau .pwschat-form input, #pwschat-panneau .pwschat-form textarea { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; margin: 0 0 6px; }
.pwschat-form .pwschat-2col { display: flex; gap: 6px; }
#pwschat-panneau .pwschat-form button { width: 100%; border: 0; border-radius: 8px; background: #922990; color: #fff; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.pwschat-form .pwschat-err { color: #c0392b; font-size: 13px; }

#pwschat-encart {
  position: fixed; right: 20px; bottom: 92px; z-index: 1000001; width: 280px;
  background: #fff; color: #222; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  padding: 14px 36px 14px 16px; cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s;
}
#pwschat-encart.pwschat-visible { opacity: 1; transform: none; }
#pwschat-encart strong { display: block; font-size: 15px; margin-bottom: 4px; color: #922990; }
#pwschat-encart span { display: block; font-size: 13px; line-height: 1.4; }
#pwschat-encart em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 13px; font-weight: 600; background: #922990; color: #fff; border-radius: 6px; padding: 6px 12px; }
body #pwschat-encart button { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 18px; line-height: 1; color: #888; cursor: pointer; padding: 4px; }
#pwschat-encart:after { content: ""; position: absolute; bottom: -7px; right: 22px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }

/* Mobile et tablette : bulle remontée pour ne pas cacher « Ajouter au panier », panneau plein écran */
@media (max-width: 991px) {
  body #pwschat-bulle { bottom: 80px; right: 14px; width: 56px; height: 56px; }
  #pwschat-encart { display: none; }
  #pwschat-panneau { bottom: 146px; max-height: calc(100vh - 166px); } /* au-dessus de la bulle remontée */
}
@media (max-width: 600px) {
  #pwschat-panneau { right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; }
  body.pwschat-ouvert #pwschat-bulle { display: none; }
  body.pwschat-ouvert { overflow: hidden; }
  #pwschat-panneau .pwschat-ligne textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
}
