/**
 * WhatsApp Floating Button
 * Botón flotante profesional para contacto por WhatsApp
 */

/* Botón Flotante Principal */
.whatsapp-float {
  position: fixed;
  bottom: 90px;
  right: 30px;
  z-index: 9998;
  transition: all 0.3s ease;
}

.whatsapp-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.whatsapp-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-float-btn:active {
  transform: scale(0.95);
}

/* Icono de WhatsApp */
.whatsapp-float-btn i {
  font-size: 32px;
  color: #fff;
  z-index: 2;
  position: relative;
}

/* Efecto de pulso */
.whatsapp-float-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(37, 211, 102, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Tooltip con número */
.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #333;
  padding: 12px 20px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 14px;
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #fff;
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  right: 75px;
}

/* Badge de notificación (opcional) */
.whatsapp-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4444;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid #fff;
  z-index: 3;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 80px;
    right: 20px;
  }
  
  .whatsapp-float-btn {
    width: 56px;
    height: 56px;
  }
  
  .whatsapp-float-btn i {
    font-size: 28px;
  }
  
  /* En mobile, el tooltip se muestra arriba */
  .whatsapp-tooltip {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 70px;
    top: auto;
  }
  
  .whatsapp-tooltip::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: -8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    border-bottom: none;
  }
  
  .whatsapp-float:hover .whatsapp-tooltip {
    right: auto;
    bottom: 75px;
  }
}

@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 75px;
    right: 15px;
  }
  
  .whatsapp-float-btn {
    width: 52px;
    height: 52px;
  }
  
  .whatsapp-float-btn i {
    font-size: 26px;
  }
}

/* Animación de entrada */
@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.whatsapp-float {
  animation: slideInRight 0.5s ease-out;
}

/* Ocultar cuando se hace scroll hasta arriba (opcional) */
.whatsapp-float.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
}

/* Variante con texto expandido (opcional) */
.whatsapp-float-btn.expanded {
  width: auto;
  padding: 0 20px;
  border-radius: 30px;
}

.whatsapp-float-btn.expanded .whatsapp-text {
  display: inline-block;
  margin-left: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.whatsapp-float-btn:not(.expanded) .whatsapp-text {
  display: none;
}

/* Accesibilidad */
.whatsapp-float-btn:focus {
  outline: 3px solid rgba(37, 211, 102, 0.5);
  outline-offset: 3px;
}

/* Print - Ocultar en impresión */
@media print {
  .whatsapp-float {
    display: none !important;
  }
}
