/* ================================================
   AMMORIA — WhatsApp Flotante Mejorado
   Badge de notificaciones + tooltip impactante
   ================================================ */

/* ── WRAPPER ── */
.amm-wa-wrapper {
  position: fixed;
  bottom: 90px;
  right: 28px;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── BOTÓN PRINCIPAL ── */
.amm-wa-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #59c95c 0%, #1a831e 100%);
  box-shadow:
    0 4px 16px rgba(37, 211, 102, 0.35),
    0 1px 4px rgba(18, 140, 126, 0.2);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s;
  position: relative;
  animation: ammWaPulse 2.5s ease-in-out infinite;
  will-change: transform;
}

.amm-wa-button:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 24px rgba(37, 211, 102, 0.5),
    0 2px 8px rgba(18, 140, 126, 0.3);
}

.amm-wa-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

@keyframes ammWaPulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 1px 4px rgba(18, 140, 126, 0.2);
  }
  50% {
    box-shadow: 0 4px 28px rgba(37, 211, 102, 0.55), 0 1px 8px rgba(18, 140, 126, 0.35);
  }
}

/* ── BADGE DE NOTIFICACIONES ── */
.amm-wa-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: linear-gradient(135deg, #d70d18 0%, #ff2d55 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 22px;
  text-align: center;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(215, 13, 24, 0.4);
  z-index: 2;
  display: none;
  animation: ammWaBadgePop 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.amm-wa-badge.is-visible {
  display: inline-block;
  animation: ammWaBadgePop 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), ammWaBadgePulse 2s ease-in-out infinite;
}

@keyframes ammWaBadgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes ammWaBadgePulse {
  0%, 100% {
    transform: scale(1) translateY(0);
    box-shadow: 0 2px 8px rgba(215, 13, 24, 0.4);
  }
  10% {
    transform: scale(1.15) translateY(0);
    box-shadow: 0 4px 12px rgba(215, 13, 24, 0.5);
  }
  20% {
    transform: scale(1.35) translateY(-8px);
    box-shadow: 0 10px 22px rgba(215, 13, 24, 0.75);
  }
  30% {
    transform: scale(0.85) translateY(2px);
    box-shadow: 0 1px 4px rgba(215, 13, 24, 0.3);
  }
  40% {
    transform: scale(1) translateY(0);
    box-shadow: 0 2px 8px rgba(215, 13, 24, 0.4);
  }
  50% {
    transform: scale(1.12) translateY(0);
    box-shadow: 0 3px 10px rgba(215, 13, 24, 0.45);
  }
  60% {
    transform: scale(1.3) translateY(-5px);
    box-shadow: 0 8px 18px rgba(215, 13, 24, 0.7);
  }
  70% {
    transform: scale(0.88) translateY(1px);
    box-shadow: 0 1px 4px rgba(215, 13, 24, 0.3);
  }
  80% {
    transform: scale(1) translateY(0);
    box-shadow: 0 2px 8px rgba(215, 13, 24, 0.4);
  }
}

/* ── TOOLTIP FLOTANTE ── */
.amm-wa-tooltip {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 260px;
  background: #fff;
  border-radius: 18px;
  padding: 0;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  z-index: 10;
  animation: ammWaTooltipIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  overflow: hidden;
}

.amm-wa-tooltip.is-hiding {
  animation: ammWaTooltipOut 0.25s ease-in both;
}

@keyframes ammWaTooltipIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ammWaTooltipOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

/* Flecha del tooltip */
.amm-wa-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 24px;
  width: 16px;
  height: 16px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.06);
  z-index: -1;
}

/* ── TOOLTIP HEADER ── */
.amm-wa-tooltip__header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.amm-wa-tooltip__header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.amm-wa-tooltip__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

.amm-wa-tooltip__header-info {
  flex: 1;
  min-width: 0;
}

.amm-wa-tooltip__header-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.amm-wa-tooltip__header-status {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
}

.amm-wa-tooltip__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}

.amm-wa-tooltip__close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── TOOLTIP BODY ── */
.amm-wa-tooltip__body {
  padding: 14px 16px;
}

.amm-wa-tooltip__message {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #3d3d3d;
  line-height: 1.55;
}

.amm-wa-tooltip__price {
  display: inline-block;
  background: rgba(215, 13, 24, 0.08);
  color: #d70d18;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.92rem;
  margin: 0 2px;
}

.amm-wa-tooltip__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

.amm-wa-tooltip__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37, 211, 102, 0.45);
}

.amm-wa-tooltip__cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 480px) {
  .amm-wa-wrapper {
    bottom: 120px;
    right: 16px;
  }

  .amm-wa-button {
    width: 50px;
    height: 50px;
  }

  .amm-wa-icon {
    width: 28px;
    height: 28px;
  }

  .amm-wa-tooltip {
    width: 240px;
    right: -8px;
    bottom: 62px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .amm-wa-button,
  .amm-wa-badge,
  .amm-wa-tooltip,
  .amm-wa-tooltip.is-hiding {
    animation: none !important;
  }
}