/* ── Assistant d'estimation — bulle flottante ── */
#chat-bulle{position:fixed;right:1.6rem;bottom:1.6rem;z-index:600;display:flex;align-items:center;gap:.6rem;
  padding:.75rem 1.3rem .75rem 1.05rem;border:0;border-radius:40px;cursor:pointer;overflow:hidden;
  font-family:'Jost',sans-serif;font-size:.66rem;letter-spacing:.13em;text-transform:uppercase;
  color:#FDF4E6;background:#630D13;box-shadow:0 10px 30px rgba(45,20,12,.32);
  transition:transform .3s cubic-bezier(.22,1,.36,1),box-shadow .3s,background .25s}
#chat-bulle:hover{transform:translateY(-2px);box-shadow:0 16px 40px rgba(45,20,12,.42);background:#7A4A2E}
#chat-bulle svg{width:17px;height:17px;fill:currentColor}
#chat-bulle span,#chat-bulle svg{position:relative;z-index:2}
/* même reflet doré que le bouton « Prendre rendez-vous » */
#chat-bulle::after{content:"";position:absolute;top:0;bottom:0;left:-40%;width:35%;z-index:1;pointer-events:none;
  background:linear-gradient(100deg,transparent,rgba(201,162,75,.42),transparent);
  animation:chatReflet 2.6s cubic-bezier(.4,0,.5,1) infinite}
#chat-bulle:hover::after{animation-play-state:paused;opacity:0}
@keyframes chatReflet{0%{left:-40%}27%{left:115%}100%{left:115%}}
#chat-bulle.cache{opacity:0;pointer-events:none;transform:scale(.9)}

/* ── Fenêtre ── */
#chat-fen{position:fixed;right:1.6rem;bottom:1.6rem;z-index:601;width:min(400px,calc(100vw - 2rem));
  height:min(620px,calc(100vh - 3rem));display:none;flex-direction:column;overflow:hidden;
  background:#FDF4E6;border:1px solid rgba(99,13,19,.16);border-radius:8px;
  box-shadow:0 30px 80px rgba(45,20,12,.4);font-family:'Jost',sans-serif}
#chat-fen.ouvert{display:flex;animation:chatPop .35s cubic-bezier(.22,1,.36,1)}
@keyframes chatPop{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:none}}

.chat-tete{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:.8rem;
  padding:.9rem 1.1rem;background:#F3E4CE;border-bottom:1px solid rgba(99,13,19,.14)}
.chat-tete .titre{font-family:'Cormorant Garamond',Georgia,serif;font-size:1.25rem;color:#630D13;line-height:1.1}
.chat-tete .sous{font-size:.56rem;letter-spacing:.14em;text-transform:uppercase;color:rgba(99,13,19,.6);margin-top:.15rem}
.chat-tete button{border:0;background:none;cursor:pointer;color:rgba(99,13,19,.6);font-size:1.1rem;line-height:1;
  padding:.3rem;transition:color .2s}
.chat-tete button:hover{color:#630D13}

.chat-fil{flex:1 1 auto;min-height:0;overflow-y:auto;padding:1.1rem;display:flex;flex-direction:column;gap:.7rem}
.chat-msg{position:relative;max-width:84%;padding:.75rem 1rem;font-size:.82rem;line-height:1.6;
  white-space:pre-wrap}
.chat-msg.bot{align-self:flex-start;background:#FFFDF9;border:1px solid rgba(99,13,19,.12);color:#3E1610;
  border-radius:14px 14px 14px 4px}
.chat-msg.moi{align-self:flex-end;background:#630D13;color:#FDF4E6;
  border-radius:14px 14px 4px 14px}
/* la pointe de la bulle */
.chat-msg.bot::before{content:"";position:absolute;left:-6px;bottom:0;width:12px;height:12px;
  background:#FFFDF9;border-left:1px solid rgba(99,13,19,.12);border-bottom:1px solid rgba(99,13,19,.12);
  border-bottom-left-radius:2px;transform:skewX(-22deg)}
.chat-msg.moi::before{content:"";position:absolute;right:-6px;bottom:0;width:12px;height:12px;
  background:#630D13;border-bottom-right-radius:2px;transform:skewX(22deg)}
.chat-msg img{display:block;width:100%;max-width:190px;border-radius:6px;margin-top:.4rem}
.chat-attente{align-self:flex-start;display:flex;gap:.3rem;padding:.8rem .9rem}
.chat-attente i{width:6px;height:6px;border-radius:50%;background:rgba(99,13,19,.4);animation:chatPoint 1.2s infinite}
.chat-attente i:nth-child(2){animation-delay:.15s}
.chat-attente i:nth-child(3){animation-delay:.3s}
@keyframes chatPoint{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

.chat-vignettes{display:flex;flex-wrap:wrap;gap:.35rem;padding:0 1.1rem .4rem}
.chat-vignettes div{position:relative;width:48px;height:48px;border-radius:4px;overflow:hidden;
  border:1px solid rgba(99,13,19,.18)}
.chat-vignettes img{width:100%;height:100%;object-fit:cover;display:block}
.chat-vignettes button{position:absolute;top:1px;right:1px;width:16px;height:16px;border:0;border-radius:50%;
  cursor:pointer;background:rgba(30,16,10,.82);color:#fff;font-size:.55rem;line-height:16px;padding:0}

.chat-bas{flex:0 0 auto;border-top:1px solid rgba(99,13,19,.14);padding:.7rem .8rem;background:#F9EEDD}
.chat-saisie{display:flex;align-items:flex-end;gap:.45rem}
.chat-saisie textarea{flex:1;resize:none;max-height:110px;font-family:'Jost',sans-serif;font-size:.82rem;
  color:#3E1610;background:#FFFDF9;border:1px solid rgba(99,13,19,.2);border-radius:20px;padding:.65rem 1rem;
  line-height:1.45}
.chat-saisie textarea:focus{outline:0;border-color:#7A4A2E}
.chat-saisie button{flex:0 0 auto;width:38px;height:38px;border:0;border-radius:50%;cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:background .2s,color .2s}
.chat-saisie .joindre{background:transparent;color:rgba(99,13,19,.6)}
.chat-saisie .joindre:hover{background:rgba(99,13,19,.08);color:#630D13}
.chat-saisie .envoyer{background:#630D13;color:#FDF4E6}
.chat-saisie .envoyer:hover{background:#7A4A2E}
.chat-saisie .envoyer:disabled{opacity:.4;cursor:default}
.chat-saisie svg{width:17px;height:17px;fill:currentColor}
.chat-note{font-size:.56rem;line-height:1.5;color:rgba(99,13,19,.5);margin-top:.5rem;text-align:center}

@media(max-width:640px){
  #chat-fen{right:0;bottom:0;width:100vw;height:100dvh;border-radius:0;border:0}
  #chat-bulle{right:1rem;bottom:1rem;padding:.7rem 1.1rem}
}
@media(prefers-reduced-motion:reduce){#chat-fen,#chat-bulle,#chat-bulle::after,.chat-attente i{animation:none!important;transition:none!important}}



/* ── Position du bouton « Poser votre question » ── */
#chat-bulle{
  position:fixed;
  right:1.6rem;
  left:auto;
  bottom:1.6rem;
  top:auto;
  z-index:603;
}
#chat-fen{
  right:1.6rem;
  left:auto;
}
@media(max-width:640px){
  #chat-bulle{right:1rem;left:auto;bottom:1rem}
  #chat-fen{left:0;right:0}
}


/* Taille identique au bouton « Prendre rendez-vous » */
#chat-bulle{
  width:210px;
  height:42px;
  min-width:210px;
  min-height:42px;
  max-width:210px;
  box-sizing:border-box;
  padding:0 1.05rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.6rem;
}
@media(max-width:640px){
  #chat-bulle{
    width:210px;
    min-width:210px;
    max-width:210px;
    height:42px;
    min-height:42px;
    padding:0 .9rem;
  }
}


/* Bouton « Poser votre question » lorsqu’il entre en contact avec le footer rouge */
#chat-bulle.sur-footer{
  background:#fff;
  color:#630D13;
  box-shadow:0 10px 30px rgba(45,20,12,.28);
}
#chat-bulle.sur-footer:hover{
  background:#fff;
  color:#630D13;
  box-shadow:0 16px 40px rgba(45,20,12,.34);
}
#chat-bulle.sur-footer::after{
  background:linear-gradient(100deg,transparent,rgba(99,13,19,.16),transparent);
}

/* ── Couleur unique des boutons + inversion au survol ── */
#chat-bulle{background:#630D13;color:#FDF4E6;border:1px solid #630D13;transition:transform .3s cubic-bezier(.22,1,.36,1),box-shadow .3s,background .25s,color .25s}
#chat-bulle:hover{background:transparent;color:#630D13;border-color:#630D13;box-shadow:none}
body:has(.hero-carousel) #chat-bulle:hover,body:has(.vr-fond) #chat-bulle:hover,
#chat-bulle.sur-footer:hover{background:transparent;color:#FDF4E6;border-color:#FDF4E6;box-shadow:none}
