/* ============================================================
   MOMENTI INTERIOR — wa-widget.css
   WhatsApp Chat Widget — stili condivisi tra tutte le pagine
   ============================================================ */

/* ── BOTTONE FLOTTANTE ── */
.wa-btn {
  position: fixed !important;
  bottom: 200px !important;
  right: 28px !important;
  left: auto !important;
  width: 58px !important;
  height: 58px !important;
  background: #25D366 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 3px rgba(37,211,102,0.3) !important;
  z-index: 99999 !important;
  border: 3px solid #fff !important;
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.wa-btn:hover {
  background: #1ebe5d !important;
  box-shadow: 0 6px 28px rgba(0,0,0,0.45), 0 0 0 4px rgba(37,211,102,0.4) !important;
  transform: translateY(-3px) !important;
}

.wa-btn svg {
  width: 30px !important;
  height: 30px !important;
  fill: #fff !important;
  filter: none !important;
  flex-shrink: 0;
}

.wa-btn__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  background: #ff3b30;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: wa-pulse 1.8s ease infinite;
}

@keyframes wa-pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
  50%       { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(255,59,48,0); }
}

/* ── FINESTRA CHAT ── */
.wa-chat {
  position: fixed !important;
  bottom: 210px !important;
  right: 28px !important;
  left: auto !important;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  z-index: 99998 !important;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
}

.wa-chat.is-open {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.wa-chat__header {
  background: #075E54;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-chat__avatar {
  width: 42px; height: 42px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wa-chat__avatar svg { width: 22px; height: 22px; fill: #fff !important; filter: none !important; }

.wa-chat__info  { flex: 1; }
.wa-chat__name  { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.2; }
.wa-chat__status { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }

.wa-chat__close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); padding: 4px;
  display: flex; align-items: center; transition: color 0.2s;
}
.wa-chat__close:hover { color: #fff; }

.wa-chat__body {
  background: #ECE5DD;
  padding: 16px;
  min-height: 130px;
  display: flex; flex-direction: column; gap: 8px;
}

.wa-msg {
  background: #fff;
  border-radius: 0 8px 8px 8px;
  padding: 10px 12px; max-width: 85%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  animation: wa-msg-in 0.3s ease;
}

@keyframes wa-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wa-msg__sender { font-size: 11px; font-weight: 600; color: #075E54; margin-bottom: 4px; }
.wa-msg__text   { font-size: 13px; color: #303030; line-height: 1.5; }
.wa-msg__time   { font-size: 10px; color: #999; text-align: right; margin-top: 4px; }

.wa-typing {
  background: #fff; border-radius: 0 8px 8px 8px;
  padding: 10px 14px; width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  display: flex; gap: 4px; align-items: center;
}
.wa-typing span { width: 7px; height: 7px; background: #aaa; border-radius: 50%; animation: wa-dot 1.2s ease infinite; }
.wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wa-dot {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

.wa-chat__footer { background: #F0F0F0; padding: 12px 16px; border-top: 1px solid #ddd; }

.wa-chat__send {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 24px; padding: 10px 16px; gap: 10px;
  cursor: pointer; border: none; width: 100%;
  transition: background 0.2s; text-decoration: none;
}
.wa-chat__send:hover    { background: #f0f0f0; }
.wa-chat__send-text     { font-size: 13px; color: #555; flex: 1; text-align: left; }

.wa-chat__send-icon {
  width: 32px; height: 32px; background: #25D366;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wa-chat__send-icon svg { width: 16px; height: 16px; fill: #fff !important; filter: none !important; }

.wa-chat__privacy { font-size: 10px; color: #999; text-align: center; margin-top: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .wa-chat { width: calc(100vw - 24px) !important; right: 12px !important; left: auto !important; }
  .wa-btn  { right: 16px !important; bottom: 80px !important; }
}
