/*
 * Pulsanti flottanti sempre visibili (WhatsApp + assistente chatbot) e
 * pannello del chatbot. Markup generato da assets/js/whatsapp-widget.js,
 * che non lo inserisce affatto se whatsappNumero non è configurato.
 */
.adb-float-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.adb-float-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  color: var(--cream, #faf6ee);
  box-shadow: 0 10px 26px rgba(10, 9, 8, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}
.adb-float-btn:hover { transform: translateY(-2px); opacity: 1; }
.adb-float-wa { background: #25d366; }
.adb-float-chat { background: var(--green, #4a7c59); }

@media (max-width: 640px) {
  .adb-float-wrap { right: 14px; bottom: 14px; gap: 10px; }
  .adb-float-btn { width: 48px; height: 48px; font-size: 22px; }
}

/* === Pannello chatbot === */
.adb-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 91;
  width: min(340px, calc(100vw - 40px));
  max-height: min(480px, calc(100vh - 140px));
  background: var(--paper, #fffdf8);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 9, 8, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* L'attributo hidden ha specificità pari a una classe: senza questa regola
   la regola sopra (stesso peso, dichiarata prima) vince e il pannello resta
   visibile anche quando panel.hidden = true viene impostato da JS. */
.adb-chat-panel[hidden] { display: none; }
.adb-chat-head {
  background: var(--black, #0a0908);
  color: var(--cream, #faf6ee);
  padding: 14px 16px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.adb-chat-close {
  background: none;
  border: none;
  color: var(--cream, #faf6ee);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.adb-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adb-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
}
.adb-chat-msg-bot {
  align-self: flex-start;
  background: var(--cream, #faf6ee);
  border: 1px solid var(--line, rgba(10,9,8,0.08));
  color: var(--black, #0a0908);
}
.adb-chat-msg-user {
  align-self: flex-end;
  background: var(--green, #4a7c59);
  color: var(--cream, #faf6ee);
}
.adb-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line, rgba(10,9,8,0.08));
}
.adb-chat-form input {
  flex: 1;
  border: 1px solid var(--line, rgba(10,9,8,0.08));
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--cream, #faf6ee);
  color: var(--black, #0a0908);
}
.adb-chat-form input:focus { outline: none; border-color: var(--green, #4a7c59); }
.adb-chat-form button {
  width: 40px;
  border: none;
  border-radius: 8px;
  background: var(--green, #4a7c59);
  color: var(--cream, #faf6ee);
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.adb-chat-form button:hover { background: var(--green-deep, #2f5233); }

@media (max-width: 640px) {
  .adb-chat-panel { right: 14px; bottom: 74px; }
}
