/**
 * WhatsApp Floating Button - Purewell PREMIUM
 * Versión premium con estilo distintivo y alta visibilidad.
 * 
 * @version 2.0
 * @updated 2025-11-21
 */

.pw-whatsapp-floating {
  position: fixed;
  z-index: 990;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pw-whatsapp-floating--right {
  right: 20px;
}

.pw-whatsapp-floating--left {
  left: 20px;
}

.pw-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 999px;
  
  /* Gradiente premium más vibrante */
  background: linear-gradient(
    135deg, 
    #ffffff 0%, 
    #f9f7f4 35%,
    #f2e8df 100%
  );
  background-size: 200% 100%;
  animation: pillGradientShift 8s ease-in-out infinite;
  
  color: var(--pw-text, #1a1a1a);
  text-decoration: none;
  
  /* Bordes más definidos */
  border: 2px solid rgba(84, 113, 49, 0.2);
  
  /* Sombras profundas con múltiples capas */
  box-shadow:
    0 4px 12px rgba(37, 211, 102, 0.15),
    0 12px 28px rgba(84, 113, 49, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
  
  transition: 
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease, 
    border-color 0.3s ease;
  
  pointer-events: auto;
  will-change: transform;
  isolation: isolate;
}

.pw-whatsapp-pill:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(37, 211, 102, 0.4);
  
  box-shadow:
    0 6px 16px rgba(37, 211, 102, 0.25),
    0 16px 36px rgba(84, 113, 49, 0.24),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.pw-whatsapp-pill:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow:
    0 3px 10px rgba(37, 211, 102, 0.2),
    0 10px 24px rgba(84, 113, 49, 0.16),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Ícono de WhatsApp - DESTACADO */
.pw-whatsapp-floating__icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  border-radius: 50%;
  
  /* Verde oficial de WhatsApp con gradiente vibrante */
  background: linear-gradient(
    145deg, 
    #25d366 0%, 
    #20ba5a 50%,
    #1da851 100%
  );
  background-size: 200% 200%;
  animation: iconGradientPulse 4s ease-in-out infinite;
  
  /* Sombras dramáticas para destacar */
  box-shadow: 
    0 0 0 4px rgba(37, 211, 102, 0.15),
    0 0 0 8px rgba(37, 211, 102, 0.08),
    0 6px 16px rgba(37, 211, 102, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15);
  
  transition: all 0.3s ease;
}

.pw-whatsapp-pill:hover .pw-whatsapp-floating__icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 
    0 0 0 6px rgba(37, 211, 102, 0.2),
    0 0 0 12px rgba(37, 211, 102, 0.1),
    0 8px 20px rgba(37, 211, 102, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

/* Animación de pulso mejorada - MÁS VISIBLE */
.pw-whatsapp-floating__icon--pulse::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2.5px solid rgba(37, 211, 102, 0.6);
  box-shadow: 
    0 0 0 6px rgba(37, 211, 102, 0.3),
    0 0 0 16px rgba(37, 211, 102, 0.15),
    0 0 20px rgba(37, 211, 102, 0.4);
  animation: pw-whatsapp-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

.pw-whatsapp-floating__icon img {
  width: 34px;
  height: 34px;
  display: block;
  filter: 
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3))
    brightness(1.05);
  transition: filter 0.3s ease;
}

.pw-whatsapp-pill:hover .pw-whatsapp-floating__icon img {
  filter: 
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4))
    brightness(1.1);
}

/* Texto del botón - Tipografía premium */
.pw-whatsapp-floating__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.2;
}

.pw-whatsapp-floating__label {
  font-family: var(--pw-font-sans, "Figtree"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.015em;
  color: var(--pw-primary, #547131);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.pw-whatsapp-floating__cta {
  font-family: var(--pw-font-sans, "Figtree"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.012em;
  color: var(--pw-secondary, #8B5E3B);
  opacity: 0.95;
}

/* Animaciones */
@keyframes pw-whatsapp-pulse {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(0.85);
    opacity: 1;
  }
}

@keyframes pillGradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes iconGradientPulse {
  0%, 100% {
    background-position: 0% 0%;
    filter: brightness(1);
  }
  50% {
    background-position: 100% 100%;
    filter: brightness(1.1);
  }
}

/* Responsive: Tablet */
@media (max-width: 768px) {
  .pw-whatsapp-floating {
    bottom: 18px;
  }

  .pw-whatsapp-floating--right {
    right: 16px;
  }

  .pw-whatsapp-floating--left {
    left: 16px;
  }

  .pw-whatsapp-pill {
    gap: 12px;
    padding: 12px 18px;
  }

  .pw-whatsapp-floating__icon {
    width: 48px;
    height: 48px;
  }

  .pw-whatsapp-floating__icon img {
    width: 32px;
    height: 32px;
  }

  .pw-whatsapp-floating__label {
    font-size: 13.5px;
  }

  .pw-whatsapp-floating__cta {
    font-size: 12px;
  }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
  .pw-whatsapp-pill {
    padding: 11px 14px;
    gap: 10px;
  }

  .pw-whatsapp-floating__icon {
    width: 46px;
    height: 46px;
  }

  .pw-whatsapp-floating__icon img {
    width: 30px;
    height: 30px;
  }

  .pw-whatsapp-floating__text {
    gap: 2px;
  }

  .pw-whatsapp-floating__label {
    font-size: 13px;
  }

  .pw-whatsapp-floating__cta {
    font-size: 11.5px;
  }
}

/* Accesibilidad y reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .pw-whatsapp-pill,
  .pw-whatsapp-floating__icon,
  .pw-whatsapp-floating__icon img {
    animation: none !important;
    transition: none !important;
  }
  
  .pw-whatsapp-floating__icon--pulse::after {
    animation: none !important;
    opacity: 0.4;
  }
}

/* Estados de foco para accesibilidad */
.pw-whatsapp-pill:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.5);
  outline-offset: 4px;
  border-color: rgba(37, 211, 102, 0.6);
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
  .pw-whatsapp-pill {
    border: 3px solid var(--pw-primary);
  }
  
  .pw-whatsapp-floating__icon {
    box-shadow: 
      0 0 0 4px rgba(37, 211, 102, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }
}
