
/* ═══════════════════════════════════════
       CHAT WIDGET — STYLES
  ═══════════════════════════════════════ */

    /* ── Bouton bulle ── */
    #chatToggle {
      position: fixed;
      bottom: 28px;
      right: 28px;
      z-index: 9999;
      width: 58px;
      height: 58px;
      border-radius: 50%;
      background: #df437c;
      border: none;
      cursor: pointer;
      box-shadow: 0 8px 30px rgba(223, 67, 124, 0.45);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    #chatToggle:hover {
      transform: scale(1.08);
      box-shadow: 0 12px 40px rgba(223, 67, 124, 0.6);
    }
    #chatToggle svg { pointer-events: none; }

    /* Badge notification */
    #chatBadge {
      position: absolute;
      top: -4px;
      right: -4px;
      width: 18px;
      height: 18px;
      background: #ff4444;
      border-radius: 50%;
      border: 2px solid #0b0b0d;
      display: none;
    }
    #chatBadge.visible { display: block; }

    /* ── Panneau chat ── */
    #chatWidget {
      position: fixed;
      bottom: 100px;
      right: 28px;
      z-index: 9998;
      width: 370px;
      max-width: calc(100vw - 40px);
      border-radius: 20px;
      background: #0f0f11;
      border: 1px solid rgba(255,255,255,0.10);
      box-shadow: 0 24px 70px rgba(0,0,0,0.65);
      display: flex;
      flex-direction: column;
      overflow: hidden;

      /* État fermé */
      opacity: 0;
      transform: translateY(16px) scale(0.97);
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
    }
    #chatWidget.open {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: all;
    }

    /* Header */
    .cw-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 18px;
      background: rgba(223, 67, 124, 0.12);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .cw-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: linear-gradient(135deg, #df437c, #a0295a);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
    }
    .cw-title {
      flex: 1;
    }
    .cw-title strong {
      display: block;
      font-size: 14px;
      font-weight: 600;
      color: #f2f2f4;
      font-family: 'Inter', sans-serif;
    }
    .cw-title span {
      font-size: 11px;
      color: #22c55e;
      font-family: 'Inter', sans-serif;
    }
    .cw-title span::before {
      content: "●  ";
      font-size: 9px;
    }
    .cw-close {
      background: none;
      border: none;
      color: #9a9aa1;
      cursor: pointer;
      font-size: 20px;
      line-height: 1;
      padding: 4px;
      border-radius: 6px;
      transition: color 0.15s;
    }
    .cw-close:hover { color: #f2f2f4; }

    /* Messages */
    .cw-messages {
      height: 320px;
      overflow-y: auto;
      padding: 16px 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      scrollbar-width: thin;
      scrollbar-color: #2f2f33 transparent;
    }
    .cw-messages::-webkit-scrollbar { width: 4px; }
    .cw-messages::-webkit-scrollbar-thumb { background: #2f2f33; border-radius: 4px; }

    /* Bulles */
    .cw-msg {
      display: flex;
      flex-direction: column;
      max-width: 82%;
    }
    .cw-msg--bot { align-self: flex-start; }
    .cw-msg--user { align-self: flex-end; }

    .cw-msg__name {
      font-size: 10px;
      color: #9a9aa1;
      margin-bottom: 3px;
      font-family: 'Inter', sans-serif;
    }
    .cw-msg--user .cw-msg__name { text-align: right; }

    .cw-msg__bubble {
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 13px;
      line-height: 1.55;
      font-family: 'Inter', sans-serif;
      white-space: pre-line;
      word-break: break-word;
    }
    .cw-msg--bot .cw-msg__bubble {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.09);
      color: #e8e8ec;
      border-bottom-left-radius: 4px;
    }
    .cw-msg--user .cw-msg__bubble {
      background: #df437c;
      color: #fff;
      border-bottom-right-radius: 4px;
    }
    .cw-msg__time {
      font-size: 10px;
      color: #6b6b72;
      margin-top: 3px;
      font-family: 'Inter', sans-serif;
    }
    .cw-msg--user .cw-msg__time { text-align: right; }

    /* Indicateur typing */
    .cw-typing {
      align-self: flex-start;
      display: flex;
      gap: 4px;
      padding: 10px 14px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.09);
      border-radius: 16px;
      border-bottom-left-radius: 4px;
      opacity: 0;
      transition: opacity 0.2s;
    }
    .cw-typing.visible { opacity: 1; }
    .cw-typing span {
      width: 6px;
      height: 6px;
      background: #9a9aa1;
      border-radius: 50%;
      animation: cwBounce 1.2s ease infinite;
    }
    .cw-typing span:nth-child(2) { animation-delay: 0.2s; }
    .cw-typing span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes cwBounce {
      0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
      40%            { transform: translateY(-5px); opacity: 1; }
    }

    /* Input zone */
    .cw-footer {
      display: flex;
      gap: 8px;
      padding: 12px 14px;
      border-top: 1px solid rgba(255,255,255,0.08);
      background: rgba(0,0,0,0.3);
    }
    .cw-input {
      flex: 1;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.10);
      border-radius: 10px;
      color: #f2f2f4;
      font-size: 13px;
      font-family: 'Inter', sans-serif;
      padding: 9px 12px;
      outline: none;
      transition: border-color 0.2s;
    }
    .cw-input::placeholder { color: #6b6b72; }
    .cw-input:focus { border-color: #df437c; }

    .cw-send {
      background: #df437c;
      border: none;
      border-radius: 10px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s, transform 0.15s;
    }
    .cw-send:hover { background: #c73569; transform: scale(1.05); }
    .cw-send:active { transform: scale(0.95); }

    /* Mobile */
    @media (max-width: 480px) {
      #chatWidget { right: 16px; width: calc(100vw - 32px); bottom: 90px; }
      #chatToggle { right: 16px; bottom: 20px; }
    }