/* =========================================================
   Help Service — Widget de support
   ========================================================= */

.hss-widget{
  --hss-accent:#1f8a76;
  --hss-navy:#123047;
  --hss-bubble-bg:#dc3545;
  --hss-font-display:'Unbounded', system-ui, sans-serif;
  --hss-font-body:'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  position:fixed;
  z-index:99999;
  right:20px;
  bottom:20px;
  font-family:var(--hss-font-body);
}
.hss-widget *{ box-sizing:border-box; }

/* ---------- Bulle ---------- */
.hss-widget .hss-bubble {
  width:60px !important;
  height:60px !important;
  min-width:60px !important;
  min-height:60px !important;
  max-width:60px !important;
  max-height:60px !important;
  border-radius:50% !important;
  background:var(--hss-bubble-bg) !important;
  border:none !important;
  color:#fff !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:pointer !important;
  box-shadow:0 10px 28px rgba(18,48,71,.28) !important;
  transition:transform .2s ease, background .2s ease !important;
  position:relative !important;
  padding:0 !important;
  margin:0 !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  line-height:1 !important;
  flex-shrink:0 !important;
}
.hss-widget .hss-bubble:hover{ transform:translateY(-2px); }
.hss-widget .hss-bubble__icon{ width:26px !important; height:26px !important; flex-shrink:0 !important; }
.hss-widget .hss-bubble__icon-img{ width:30px !important; height:30px !important; object-fit:contain !important; border-radius:50% !important; flex-shrink:0 !important; }
.hss-widget .hss-bubble__close {
  position:absolute; inset:0;
  display:none; align-items:center; justify-content:center;
}
.hss-widget .hss-bubble__close svg{ width:22px !important; height:22px !important; }

.hss-widget.is-open .hss-bubble__icon,
.hss-widget.is-open .hss-bubble__icon-img{ display:none; }
.hss-widget.is-open .hss-bubble__close{ display:flex; }

/* ---------- Panneau ---------- */
.hss-widget .hss-panel {
  position:absolute;
  right:0; bottom:76px;
  width:360px;
  max-width:calc(100vw - 40px);
  height:520px;
  max-height:calc(100vh - 140px);
  background:#fff;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(18,48,71,.28);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  animation:hssPanelIn .2s ease;
}
.hss-widget .hss-panel[hidden] {
  display:none !important;
}
@keyframes hssPanelIn{
  from{ opacity:0; transform:translateY(12px); }
  to{ opacity:1; transform:translateY(0); }
}

.hss-widget .hss-panel__header {
  background:var(--hss-navy) !important;
  color:#fff !important;
  padding:16px 18px;
  display:flex; align-items:center; justify-content:space-between;
  flex:0 0 auto;
}
.hss-widget .hss-panel__header-text{ display:flex; flex-direction:column; gap:2px; }
.hss-widget .hss-panel__header-text strong {
  font-family:var(--hss-font-display) !important;
  font-weight:700 !important;
  font-size:14px !important;
  color:#fff !important;
}
.hss-widget .hss-panel__header-text span {
  font-family:var(--hss-font-body) !important;
  font-size:11.5px !important;
  color:rgba(255,255,255,.7) !important;
  display:flex; align-items:center; gap:5px;
}
.hss-widget .hss-panel__header-text span::before {
  content:"";
  width:6px; height:6px; border-radius:50%;
  background:#3fc9ab;
  display:inline-block;
}
.hss-widget .hss-panel__close {
  background:none !important; border:none !important;
  color:#fff !important; cursor:pointer;
  width:28px; height:28px;
  display:flex; align-items:center; justify-content:center;
  padding:0 !important;
  opacity:.8;
}
.hss-widget .hss-panel__close:hover{ opacity:1; }
.hss-widget .hss-panel__close svg{ width:16px; height:16px; }

/* ---------- Fil de conversation ---------- */
.hss-widget .hss-panel__body {
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  background:#f7faf9;
}

.hss-widget .hss-msg {
  max-width:85%;
  padding:10px 13px;
  border-radius:14px;
  font-family:var(--hss-font-body) !important;
  font-size:13.5px !important;
  line-height:1.5 !important;
}
.hss-widget .hss-msg--bot {
  align-self:flex-start;
  background:#ffffff;
  border:1px solid #e4e9e8;
  color:var(--hss-navy) !important;
  border-bottom-left-radius:4px;
}
.hss-widget .hss-msg--user {
  align-self:flex-end;
  background:var(--hss-accent) !important;
  color:#ffffff !important;
  border-bottom-right-radius:4px;
}

.hss-widget .hss-msg-link {
  display:inline-flex !important;
  align-items:center;
  gap:6px;
  margin-top:8px;
  padding:7px 12px !important;
  border-radius:8px !important;
  background:var(--hss-accent) !important;
  color:#fff !important;
  font-family:var(--hss-font-body) !important;
  font-size:12.5px !important;
  font-weight:600 !important;
  text-decoration:none !important;
}

.hss-widget .hss-fallback-actions {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.hss-widget .hss-fallback-btn {
  display:flex !important;
  align-items:center;
  gap:8px;
  padding:9px 12px !important;
  border-radius:9px !important;
  border:1.5px solid #e4e9e8 !important;
  background:#fff !important;
  color:var(--hss-navy) !important;
  font-family:var(--hss-font-body) !important;
  font-size:13px !important;
  font-weight:600 !important;
  text-decoration:none !important;
  cursor:pointer;
}
.hss-widget .hss-fallback-btn svg{ width:15px; height:15px; color:var(--hss-accent); flex:0 0 auto; }
.hss-widget .hss-fallback-btn--whatsapp{ border-color:rgba(37,211,102,.4) !important; }
.hss-widget .hss-fallback-btn--whatsapp svg{ color:#25D366; }

.hss-widget .hss-callback-form {
  display:flex;
  gap:6px;
  margin-top:8px;
}
.hss-widget .hss-callback-form input {
  flex:1;
  padding:8px 10px !important;
  border:1.5px solid #e4e9e8 !important;
  border-radius:8px !important;
  font-size:13px !important;
  font-family:var(--hss-font-body) !important;
}
.hss-widget .hss-callback-form button {
  background:var(--hss-accent) !important;
  color:#fff !important;
  border:none !important;
  border-radius:8px !important;
  padding:0 14px !important;
  font-size:12.5px !important;
  font-weight:600 !important;
  cursor:pointer;
}

/* ---------- Suggestions rapides ---------- */
.hss-widget .hss-panel__quick {
  flex:0 0 auto;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:10px 14px;
  border-top:1px solid #eef1f0;
  background:#fff;
}
.hss-widget .hss-chip {
  background:#f4faf8 !important;
  border:1px solid rgba(31,138,118,.3) !important;
  color:var(--hss-navy) !important;
  border-radius:20px !important;
  padding:6px 12px !important;
  font-size:12px !important;
  font-family:var(--hss-font-body) !important;
  font-weight:500 !important;
  cursor:pointer;
  white-space:nowrap;
}
.hss-widget .hss-chip:hover{ border-color:var(--hss-accent) !important; }

/* ---------- Champ de saisie ---------- */
.hss-widget .hss-panel__input {
  flex:0 0 auto;
  display:flex;
  gap:8px;
  padding:12px 14px;
  border-top:1px solid #eef1f0;
  background:#fff;
}
.hss-widget .hss-panel__input input {
  flex:1;
  min-width:0;
  padding:10px 12px !important;
  border:1.5px solid #e4e9e8 !important;
  border-radius:10px !important;
  font-family:var(--hss-font-body) !important;
  font-size:13.5px !important;
  color:var(--hss-navy) !important;
}
.hss-widget .hss-panel__input input:focus{ outline:none !important; border-color:var(--hss-accent) !important; }
.hss-widget .hss-panel__input button {
  width:38px; height:38px;
  flex:0 0 auto;
  background:var(--hss-accent) !important;
  border:none !important;
  border-radius:10px !important;
  color:#fff !important;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.hss-widget .hss-panel__input button svg{ width:16px; height:16px; }

/* ---------- Pied : appeler / whatsapp ---------- */
.hss-widget .hss-panel__footer {
  flex:0 0 auto;
  display:flex;
  gap:8px;
  padding:10px 14px 14px;
  background:#fff;
}
.hss-widget .hss-footer-btn {
  flex:1;
  display:flex !important;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:10px !important;
  border-radius:9px !important;
  background:var(--hss-navy) !important;
  color:#fff !important;
  font-family:var(--hss-font-body) !important;
  font-size:12.5px !important;
  font-weight:600 !important;
  text-decoration:none !important;
}
.hss-widget .hss-footer-btn svg{ width:15px; height:15px; }
.hss-widget .hss-footer-btn--whatsapp{ background:#25D366 !important; }

/* ---------- Responsive ---------- */
@media (max-width:480px){
  .hss-widget{ right:14px; bottom:14px; }
  .hss-widget .hss-panel {
    width:calc(100vw - 28px);
    height:calc(100vh - 110px);
    bottom:76px;
    right:0;
  }

  /* Important : sous 16px, Safari/Chrome mobile zooment automatiquement
     sur un champ au moment du focus, ce qui donne l'impression que la
     page "saute". On force donc 16px exactement ici, pas moins. */
  .hss-panel__input input,
  .hss-widget .hss-callback-form input {
    font-size:16px !important;
  }
}
