/* =====================================================================
   Avatar de Linda — assistante virtuelle de la vitrine (css/avatar.css)
   ===================================================================== */
.lhaav-btn, .lhaav-panel, .lhaav-teaser { font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; box-sizing: border-box; }
.lhaav-panel *, .lhaav-teaser * { box-sizing: border-box; }

/* Bouton flottant (au-dessus du bouton « retour en haut ») */
.lhaav-btn {
  position: fixed; right: 14px; bottom: 0; z-index: 1000;
  width: 124px; aspect-ratio: 880 / 1168; padding: 0; margin: 0;
  border: 0; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s ease;
}
.lhaav-btn:hover, .lhaav-btn:focus-visible, .lhaav-btn.show { transform: translateY(-6px); }
/* Le personnage « sort » du bas de l'écran : le bouton « retour en haut » passe au-dessus de lui */
body.lhaav-on .back-to-top { bottom: 190px !important; right: 52px !important; }
/* Deux poses superposées : repos (mains le long du corps) / survol (main levée + spray) */
.lhaav-pose { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.lhaav-spray { opacity: 0; }
.lhaav-btn:hover .lhaav-spray, .lhaav-btn:focus-visible .lhaav-spray, .lhaav-btn.show .lhaav-spray { opacity: 1; }
.lhaav-btn:hover .lhaav-repos, .lhaav-btn:focus-visible .lhaav-repos, .lhaav-btn.show .lhaav-repos { opacity: 0; }
/* Bulle « Une question ? » */
.lhaav-bulle {
  position: absolute; right: 78%; top: 6%; z-index: 2; white-space: nowrap;
  background: #fff; color: #1A1A1A; font-weight: 700; font-size: .92rem; line-height: 1;
  padding: 11px 16px; border-radius: 18px 18px 4px 18px; border: 2px solid #C9A87C;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(6px) scale(.92); transform-origin: bottom right; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.lhaav-btn:hover .lhaav-bulle, .lhaav-btn:focus-visible .lhaav-bulle, .lhaav-btn.show .lhaav-bulle { opacity: 1; transform: none; }
.lhaav-btn:focus-visible { outline: 3px solid #C9A87C; outline-offset: 2px; border-radius: 14px; }
.lhaav-x:focus-visible, .lhaav-chip:focus-visible, .lhaav-send:focus-visible, .lhaav-in:focus-visible, .lhaav-lnk:focus-visible {
  outline: 3px solid #1A1A1A; outline-offset: 2px;
}
.lhaav-btn[aria-expanded="true"] { display: none; }

/* Petite bulle d'invitation */
.lhaav-teaser {
  position: fixed; right: 96px; bottom: 108px; z-index: 1000; max-width: 230px;
  background: #fff; color: #1A1A1A; border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; font-size: .86rem; line-height: 1.35; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,0,0,.2); border: 1px solid #eadfce;
  animation: lhaavIn .35s ease both;
}
.lhaav-teaser[hidden] { display: none; }

/* Fenêtre de discussion */
.lhaav-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 1200;
  width: 380px; max-width: calc(100vw - 24px); height: 590px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px; border: 1px solid #eadfce;
  box-shadow: 0 14px 50px rgba(0,0,0,.35);
  animation: lhaavIn .25s ease both;
}
.lhaav-panel[hidden] { display: none; }
.lhaav-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, #1A1A1A, #3a2a1c); color: #fff;
}
.lhaav-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 20%; border: 2px solid #C9A87C; flex: none; }
.lhaav-head .lhaav-t { flex: 1; min-width: 0; }
.lhaav-head strong { display: block; font-size: .98rem; font-family: 'Playfair Display', Georgia, serif; }
.lhaav-head span { display: block; font-size: .72rem; opacity: .8; }
.lhaav-x { background: rgba(255,255,255,.14); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.15rem; line-height: 1; cursor: pointer; border: 0; flex: none; }
.lhaav-x:hover { background: rgba(255,255,255,.28); }

.lhaav-msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: #fbf8f4; scroll-behavior: smooth; }
.lhaav-m { display: flex; margin: 0 0 10px; }
.lhaav-m.bot { justify-content: flex-start; }
.lhaav-m.user { justify-content: flex-end; }
.lhaav-bub {
  max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.5;
  overflow-wrap: anywhere; color: #1A1A1A;
}
.lhaav-m.bot .lhaav-bub { background: #fff; border: 1px solid #eadfce; border-bottom-left-radius: 4px; }
.lhaav-m.user .lhaav-bub { background: linear-gradient(135deg, #C9A87C, #a8854f); color: #fff; border-bottom-right-radius: 4px; }
.lhaav-bub p { margin: 0 0 7px; } .lhaav-bub p:last-child { margin-bottom: 0; }
.lhaav-bub ul { margin: 4px 0 7px 18px; padding: 0; } .lhaav-bub li { margin: 2px 0; }
.lhaav-bub a:not(.lhaav-lnk) { color: #8a5a1f; text-decoration: underline; }
.lhaav-bub small { color: #6b6b6b; display: block; margin-top: 6px; font-size: .74rem; line-height: 1.4; }
.lhaav-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.lhaav-lnk {
  display: inline-flex; align-items: center; gap: 6px; background: #1A1A1A; color: #fff !important;
  text-decoration: none !important; font-size: .78rem; font-weight: 700; padding: 7px 12px; border-radius: 20px;
}
.lhaav-lnk:hover { background: #8a5a1f; }
.lhaav-lnk.wa { background: #1f9d55; }
.lhaav-typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #b99a6b; animation: lhaavDot 1s infinite ease-in-out; }
.lhaav-typing span:nth-child(2) { animation-delay: .15s; } .lhaav-typing span:nth-child(3) { animation-delay: .3s; }

.lhaav-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 10px; background: #fbf8f4; max-height: 118px; overflow-y: auto; }
.lhaav-chip {
  background: #fff; color: #1A1A1A; border: 1px solid #C9A87C; border-radius: 18px;
  font-size: .78rem; padding: 6px 11px; cursor: pointer; font-family: inherit;
}
.lhaav-chip:hover { background: #C9A87C; color: #fff; }

.lhaav-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eadfce; background: #fff; }
.lhaav-in { flex: 1; min-width: 0; border: 1px solid #d9cbb6; border-radius: 22px; padding: 10px 14px; font-size: 16px; font-family: inherit; color: #1A1A1A; background: #fff; }
.lhaav-send { background: #C9A87C; color: #fff; border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 1rem; cursor: pointer; flex: none; }
.lhaav-send:hover { background: #a8854f; }
.lhaav-collab { display: inline-block; margin: 2px 0 5px; color: #8a5a1f; font-weight: 700; font-size: .74rem; text-decoration: underline; }
.lhaav-collab:hover { color: #1A1A1A; }
.lhaav-collab:focus-visible { outline: 3px solid #1A1A1A; outline-offset: 2px; }
.lhaav-foot { font-size: .68rem; color: #6b6b6b; text-align: center; padding: 0 12px 9px; background: #fff; line-height: 1.35; }

@keyframes lhaavIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lhaavDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lhaav-panel, .lhaav-teaser { animation: none; }
  .lhaav-typing span { animation: none; opacity: .8; }
  .lhaav-msgs { scroll-behavior: auto; }
  .lhaav-btn, .lhaav-bulle { transition: none; }
  .lhaav-btn:hover, .lhaav-btn:focus-visible, .lhaav-btn.show { transform: none; }
}

/* Mobile : fenêtre quasi plein écran */
@media (max-width: 600px) {
  .lhaav-btn { right: 8px; bottom: 0; width: 92px; }
  body.lhaav-on .back-to-top { bottom: 146px !important; right: 30px !important; width: 44px; height: 44px; }
  .lhaav-bulle { font-size: .82rem; padding: 9px 13px; right: 70%; }
  .lhaav-teaser { right: 80px; bottom: 98px; max-width: 200px; }
  .lhaav-panel { right: 6px; left: 6px; bottom: 6px; width: auto; max-width: none; height: calc(100dvh - 12px); max-height: 760px; border-radius: 16px; }
}
@media print { .lhaav-btn, .lhaav-panel, .lhaav-teaser { display: none !important; } }
