/* ==========================================================================
   ILRITORNO — WhatsApp Float Widget (estilo JoinChat)
   ========================================================================== */

.wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  font-family: var(--ir-font-ui, system-ui, sans-serif);
}

/* Bubble button */
.wa-float__bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35), 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 250ms cubic-bezier(.4,0,.2,1), box-shadow 250ms;
}
.wa-float__bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5), 0 2px 8px rgba(0,0,0,0.18);
}
.wa-float__bubble:active { transform: scale(0.96); }
.wa-float__bubble svg { width: 30px; height: 30px; }

/* Pulse animation */
.wa-float__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  opacity: 0.5;
  animation: wa-pulse 2s cubic-bezier(.4,0,.6,1) infinite;
  z-index: -1;
}
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(1.6); opacity: 0;   }
  100% { transform: scale(1.6); opacity: 0;   }
}

/* Badge */
.wa-float__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #FF3B30;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border: 2px solid #fff;
}
.wa-float.is-open .wa-float__badge { display: none; }
.wa-float.has-seen .wa-float__badge { display: none; }

/* Panel */
.wa-float__panel {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transform: scale(0.85) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(.34,1.4,.64,1), opacity 200ms;
}
.wa-float.is-open .wa-float__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.wa-float__panel[hidden] { display: flex; }

/* Header */
.wa-float__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  color: #fff;
  position: relative;
}
.wa-float__head-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-float__head-avatar img { width: 100%; height: 100%; object-fit: contain; }
.wa-float__head-info { flex: 1; min-width: 0; }
.wa-float__head-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}
.wa-float__head-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wa-float__dot {
  width: 8px; height: 8px;
  background: #4FC768;
  border-radius: 50%;
  display: inline-block;
  animation: wa-dot-pulse 1.6s infinite;
}
@keyframes wa-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.wa-float__close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 200ms;
  flex-shrink: 0;
}
.wa-float__close:hover { background: rgba(255,255,255,0.28); }

/* Intro */
.wa-float__intro {
  padding: 18px 16px 12px;
  background: #ECE5DD;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.4) 0%, transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(255,255,255,0.3) 0%, transparent 30%);
}
.wa-float__intro p {
  background: #fff;
  margin: 0;
  padding: 12px 14px;
  border-radius: 0 12px 12px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #2E2F24;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
  position: relative;
}
.wa-float__intro p::before {
  content: '';
  position: absolute;
  top: 0; left: -8px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 8px 10px 0;
  border-color: transparent #fff transparent transparent;
}

/* Options list */
.wa-float__options {
  list-style: none;
  margin: 0;
  padding: 8px;
  background: #ECE5DD;
  overflow-y: auto;
  max-height: 50vh;
}
.wa-float__options li { margin: 0 0 6px; }
.wa-float__options li:last-child { margin-bottom: 0; }

.wa-float__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: #2E2F24;
  transition: transform 180ms, box-shadow 180ms, background 180ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.wa-float__opt:hover {
  transform: translateX(2px);
  background: #F0FFF4;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.15);
  color: #2E2F24;
}
.wa-float__opt-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F0FFF4;
  border-radius: 50%;
}
.wa-float__opt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.wa-float__opt-label {
  font-size: 14px;
  font-weight: 600;
  color: #2E2F24;
  line-height: 1.2;
  margin-bottom: 2px;
}
.wa-float__opt-desc {
  font-size: 12px;
  color: #686150;
  line-height: 1.3;
}
.wa-float__opt-arrow {
  flex-shrink: 0;
  color: #25D366;
  transition: transform 200ms;
}
.wa-float__opt:hover .wa-float__opt-arrow {
  transform: translateX(3px);
}

/* Footer */
.wa-float__foot {
  padding: 10px 16px;
  background: #fff;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.wa-float__foot small { font-size: 11px; color: #686150; }

/* Mobile adjustments */
@media (max-width: 480px) {
  .wa-float { bottom: 14px; right: 14px; }
  .wa-float__bubble { width: 56px; height: 56px; }
  .wa-float__panel {
    width: calc(100vw - 28px);
    bottom: calc(100% + 12px);
  }
}

/* When checkout/cart is in progress on mobile, lower z so sticky bars work */
@media (max-width: 768px) {
  body.woocommerce-checkout .wa-float { bottom: 80px; }
}

/* Print */
@media print { .wa-float { display: none !important; } }
