/* ==========================================================================
   chatbot.css — Assistant « Une question ? » (bulle + fenêtre de discussion)
   ========================================================================== */

/* Bulle ronde dans le coin inférieur droit */
.chatbot { position: fixed; right: 20px; bottom: 20px; z-index: 90; font-size: .95rem; }

/* Bouton d'ouverture */
.chatbot__launcher {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 999px; border: 1px solid rgba(212, 162, 76, .5);
  background: var(--green); color: var(--cream); font-weight: 700; cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45); transition: transform .15s;
}
.chatbot__launcher:hover { transform: translateY(-2px); }
.chatbot__launcher-icon { font-size: 1.25rem; line-height: 1; }
.chatbot.is-open .chatbot__launcher { display: none; }

/* Fenêtre */
.chatbot__panel {
  position: absolute; right: 0; bottom: 0;
  width: 380px; height: min(600px, calc(100vh - 140px)); height: min(600px, calc(100dvh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ink-2); border: 1px solid rgba(212, 162, 76, .35); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.chatbot__panel[hidden] { display: none; }

.chatbot__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--green); }
.chatbot__head img { width: 40px; height: auto; flex-shrink: 0; }
.chatbot__head div { flex: 1; min-width: 0; line-height: 1.25; }
.chatbot__head b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.chatbot__head small { display: block; font-size: .74rem; color: #cfdcc4; }
.chatbot__close { width: 40px; height: 40px; color: var(--cream); font-size: 1.1rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .25); cursor: pointer; }

.chatbot__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chatbot__msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: .9rem; word-wrap: break-word; }
.chatbot__msg--bot { align-self: flex-start; background: var(--ink-3); border-bottom-left-radius: 4px; color: var(--cream); }
.chatbot__msg--user { align-self: flex-end; background: var(--brass); color: var(--ink); border-bottom-right-radius: 4px; font-weight: 500; }
.chatbot__msg a { color: var(--brass-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.chatbot__link { display: block; margin-top: 10px; }
.chatbot__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chatbot__actions a { text-decoration: none; padding: 7px 12px; border-radius: 99px; background: var(--ink); border: 1px solid var(--line-2); color: var(--cream); font-size: .82rem; }

.chatbot__typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.chatbot__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-dot 1s infinite ease-in-out; }
.chatbot__typing i:nth-child(2) { animation-delay: .15s; }
.chatbot__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.chatbot__chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.chatbot__chips::-webkit-scrollbar { display: none; }
.chatbot__chips button {
  flex-shrink: 0; padding: 9px 13px; border-radius: 99px; cursor: pointer; font-size: .8rem; font-weight: 600;
  background: var(--glass); border: 1px solid rgba(212, 162, 76, .35); color: var(--brass-2);
}

.chatbot__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--ink); }
.chatbot__form input { flex: 1; min-width: 0; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 11px 16px; font-size: 16px; }
.chatbot__form input:focus { outline: none; border-color: var(--brass); }
.chatbot__form button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--brass); color: var(--ink); font-size: 1rem; cursor: pointer; }
.chatbot__legal { padding: 0 14px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); font-size: .72rem; color: var(--muted); line-height: 1.4; }

/* Téléphone : bulle ronde tout en bas à droite, alignée dans la barre
   « Appeler / Réserver » (layout.css lui réserve la place) ; plein écran une fois ouverte */
@media (max-width: 960px) {
  .chatbot { right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chatbot__launcher { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .chatbot__launcher-label { display: none; }
  .chatbot.is-open { inset: 0; right: 0; bottom: 0; z-index: 120; }
  .chatbot__panel { position: fixed; inset: 0; width: auto; height: 100%; border-radius: 0; border: 0; }
}

/* Pendant la saisie dans un formulaire (téléphone), la bulle s'efface */
.is-typing .chatbot:not(.is-open) { display: none; }
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot { bottom: calc(12px + env(safe-area-inset-bottom)); right: max(14px, env(safe-area-inset-right)); }
}
