/* ── CHATBOT WIDGET ── */
#chat-trigger {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}


/* ── FLÈCHE ANIMÉE CHATBOT ── */
#chat-arrow {
  position: fixed;
  bottom: 115px;
  right: 12rem;
  z-index: 199;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  animation: arrowBounce 1.5s ease-in-out infinite, fadeSlideIn 0.6s ease forwards 2.5s;
  opacity: 0;
}
#chat-arrow span {
  font-family: 'Cormorant', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
}
#chat-arrow svg {
  flex-shrink: 0;
  stroke-width: 2.5;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(6px); }
}
#chat-arrow.hidden { display: none; }

/* Loupe = cercle + handle */
#chat-trigger-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  position: relative;
  flex-direction: column;
}

#chat-trigger-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 32px rgba(13,27,110,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}
#chat-trigger-circle::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: 0.3;
  pointer-events: none;
}
#chat-trigger-handle {
  width: 1.5px;
  height: 28px;
  background: linear-gradient(to bottom, var(--border), transparent);
  margin-top: -2px;
  transform: rotate(45deg);
  transform-origin: top center;
  position: relative;
  z-index: 0;
}
#chat-trigger:hover #chat-trigger-circle {
  border-color: var(--gold);
}
#chat-trigger:hover #chat-trigger-handle {
  background: linear-gradient(to bottom, var(--gold), transparent);
}
#chat-trigger-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
}
#chat-trigger-eyebrow {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
#chat-trigger-text {
  font-family: 'Cormorant', serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
#chat-trigger-icon {
  width: 28px;
  height: 28px;
  background: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s ease;
}
#chat-trigger:hover #chat-trigger-inner {
  transform: translateY(-1px);
}
#chat-trigger:hover #chat-trigger-icon { background: var(--gold); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#chat-trigger { animation: fadeSlideIn 0.6s ease forwards 2s; opacity: 0; }

#chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  z-index: 200;
  width: 380px;
  max-height: 560px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 48px rgba(13,27,110,0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#chat-panel.open { display: flex; }

.chat-header {
  background: var(--ink);
  color: var(--bg);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-left { display: flex; flex-direction: column; gap: 0.15rem; }
.chat-header-title {
  font-family: 'Cormorant', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.chat-header-sub {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,244,238,0.55);
}
.chat-close {
  background: none;
  border: none;
  color: var(--bg);
  cursor: pointer;
  opacity: 0.6;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s;
}
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); }

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 88%;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-msg.assistant { align-self: flex-start; align-items: flex-start; }
.chat-msg.assistant:first-child { align-self: center; align-items: center; max-width: 100%; }
.chat-welcome-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.2rem;
}
.chat-welcome-logo {
  width: 22px;
  height: 22px;
  border-radius: 3px;
}

.chat-bubble {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  line-height: 1.65;
  font-family: 'Instrument Sans', sans-serif;
}
.chat-msg.user .chat-bubble {
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
}
.chat-msg.assistant .chat-bubble {
  background: white;
  color: var(--ink);
  border: 1px solid var(--border);
}
.chat-cta-btn {
  display: block;
  margin-top: 0.8rem;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  border-radius: 0.35rem;
  transition: background 0.2s ease;
}
.chat-cta-btn:hover {
  background: var(--gold);
  color: white;
}
.chat-msg-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.2rem;
}

.chat-suggestions {
  padding: 0 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}
.chat-suggestion {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.chat-suggestion:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.chat-input-row {
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}
#chat-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.78rem;
  background: var(--bg);
  color: var(--ink);
  resize: none;
}
#chat-input::placeholder { color: var(--muted); opacity: 0.6; }
#chat-send {
  background: var(--ink);
  border: none;
  color: var(--bg);
  padding: 0 1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}
#chat-send:hover { background: var(--gold); }
#chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  width: fit-content;
}
.chat-typing span {
  width: 5px; height: 5px;
  background: var(--muted);
  border-radius: 50%;
  animation: dot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

.chat-footer-note {
  font-size: 0.48rem;
  text-align: center;
  color: var(--muted);
  opacity: 0.55;
  padding: 0.4rem 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── RESPONSIVE TABLETTE (≤1024px) ── */
@media (max-width: 1024px) {
  #chat-trigger { bottom: 2rem; right: 2rem; }
  #chat-trigger-circle { width: 110px; height: 110px; }
  #chat-trigger-circle::after { inset: 3px; }
  #chat-trigger-handle { height: 22px; }
  #chat-arrow { right: 10rem; bottom: 100px; }
  #chat-panel { width: 340px; right: 1.5rem; bottom: 5rem; max-height: 520px; }
}

/* ── RESPONSIVE MOBILE (≤768px) ── */
@media (max-width: 768px) {
  #chat-trigger { bottom: 1.2rem; right: 1.2rem; }
  #chat-trigger-circle {
    width: 85px;
    height: 85px;
    box-shadow: 0 2px 16px rgba(13,27,110,0.10);
  }
  #chat-trigger-circle::after { inset: 3px; }
  #chat-trigger-circle svg { width: 20px; height: 20px; }
  #chat-trigger-circle .brand-name { font-size: 0.6rem !important; letter-spacing: 0.2em !important; }
  #chat-trigger-handle { height: 18px; }
  #chat-arrow { display: none; }
  #chat-panel {
    width: calc(100vw - 1.5rem);
    right: 0.75rem;
    bottom: 0.75rem;
    max-height: 75vh;
  }
  .chat-header { padding: 0.8rem 1rem; }
  .chat-header-title { font-size: 0.9rem; }
  .chat-messages { padding: 0.8rem; gap: 0.6rem; }
  .chat-msg { max-width: 92%; }
  .chat-suggestions { padding: 0 0.8rem 0.6rem; }
  .chat-suggestion { padding: 0.5rem 0.7rem; font-size: 0.6rem; }
  #chat-input { padding: 0.7rem 0.8rem; font-size: 0.75rem; }
}

/* ── RESPONSIVE PETIT MOBILE (≤380px) ── */
@media (max-width: 380px) {
  #chat-trigger { bottom: 1rem; right: 1rem; }
  #chat-trigger-circle { width: 72px; height: 72px; }
  #chat-trigger-circle svg { width: 14px; height: 14px; margin-bottom: 0.1rem !important; }
  #chat-trigger-circle .brand-name { font-size: 0.48rem !important; letter-spacing: 0.15em !important; }
  #chat-trigger-handle { height: 14px; }
  #chat-panel {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    bottom: 0.5rem;
    max-height: 80vh;
  }
}
