/* ================================================================
   WA-FLOAT.CSS · Pulsante WhatsApp galleggiante (globale per tutto il sito)
   Caricato da: tutte le pagine del sito + landing pages
   ================================================================ */


/* ============================================================
   WHATSAPP FLOATING BUTTON · cerchio fisso in basso a destra
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #25D366;
  color: var(--omni-white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4),
              0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9000;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              background 0.2s ease;
  /* Comparsa ritardata · entra dopo che la pagina è caricata */
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  animation: wa-float-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}
.wa-float:hover {
  transform: translateY(-3px) scale(1.05);
  background: #1FB855;
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55),
              0 6px 16px rgba(0, 0, 0, 0.18);
}
.wa-float:active {
  transform: translateY(-1px) scale(1.02);
}

/* Pulse ambient · "respiro" leggero ogni 3s */
.wa-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.4);
  z-index: -1;
  animation: wa-float-pulse 3s ease-in-out infinite;
  animation-delay: 2.5s;
}

@keyframes wa-float-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wa-float-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}

/* Tooltip al hover · "Scrivici su WhatsApp" che appare a sinistra */
.wa-float-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--omni-dark);
  color: var(--omni-white);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s, transform 0.2s ease;
  pointer-events: none;
}
.wa-float-tooltip::after {
  /* Trianglino che punta al pulsante */
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--omni-dark);
}
.wa-float:hover .wa-float-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-4px);
  transition-delay: 0.1s, 0s, 0.1s;
}

/* Mobile · pulsante leggermente più piccolo, niente tooltip (che su mobile non serve) */
@media (max-width: 700px) {
  .wa-float {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
  }
  .wa-float svg {
    width: 26px;
    height: 26px;
  }
  .wa-float-tooltip {
    display: none;
  }
}

/* Disabilita pulse se l'utente preferisce ridurre i movimenti */
@media (prefers-reduced-motion: reduce) {
  .wa-float {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .wa-float::before {
    animation: none;
    opacity: 0;
  }
}


/* ============================================================
   WA-FLOAT-BUBBLE · fumetto auto-appare dopo 3 secondi
   Mostra "Hai domande? Scrivici" automaticamente
   ============================================================ */
.wa-float-bubble {
  position: fixed;
  bottom: 28px;
  right: 96px;
  background: var(--omni-white, #FFFFFF);
  color: var(--omni-dark, #1F1F1F);
  padding: 14px 18px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  white-space: nowrap;
  z-index: 8999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
              0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateX(10px) scale(0.92);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0.35s;
}
.wa-float-bubble.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
/* Coda fumetto che punta al pulsante */
.wa-float-bubble::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-left-color: var(--omni-white, #FFFFFF);
  border-right: 0;
}
/* Bottone chiudi fumetto */
.wa-float-bubble-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--omni-dark, #1F1F1F);
  color: var(--omni-white, #FFFFFF);
  border: 0;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.15s ease;
}
.wa-float-bubble-close:hover {
  background: var(--omni-orange, #BB6826);
  transform: scale(1.1);
}

/* Su mobile · fumetto leggermente più piccolo e in posizione adatta */
@media (max-width: 700px) {
  .wa-float-bubble {
    bottom: 24px;
    right: 88px;
    font-size: 13px;
    padding: 12px 14px;
  }
}

/* Se l'utente preferisce ridurre i movimenti, niente animazione */
@media (prefers-reduced-motion: reduce) {
  .wa-float-bubble {
    transition: none !important;
    transform: none !important;
  }
}

/* ================================================================
   IUBENDA WIDGET · nascondo il pulsante fluttuante
   Lo richiamiamo dal link "Preferenze privacy" nel footer, che fa
   un click programmatico su .iubenda-tp-btn → si apre il popup.
   ATTENZIONE: il widget Iubenda usa inline style con !important
   ("style=display:inline-block !important"), quindi serve specificità
   alta + posizionamento off-screen per nasconderlo davvero.
   ================================================================ */
html body button.iubenda-tp-btn,
html body button[class*="iubenda-tp-btn"] {
  /* Off-screen invece di display:none (che perde contro inline style) */
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -1 !important;
}