/* ==========================================================================
   Happy Co - WhatsApp Floating Widget & Interactive Quote Buttons
   ========================================================================== */

/* Botón Flotante Principal */
.happy-wa-floating-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  cursor: pointer;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 3px solid #ffffff;
}

.happy-wa-floating-btn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

.happy-wa-floating-btn svg {
  width: 34px;
  height: 34px;
  fill: #ffffff;
}

/* Pulso animado alrededor del botón */
.happy-wa-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: waPulseAnimation 2s infinite;
  pointer-events: none;
}

@keyframes waPulseAnimation {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Badge de notificación */
.happy-wa-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: #FF3B30;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: 2px solid #ffffff;
  animation: waBounce 1s infinite alternate;
}

@keyframes waBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

/* Tooltip lateral en hover */
.happy-wa-tooltip {
  position: absolute;
  right: 74px;
  background: #1e1e24;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.happy-wa-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #1e1e24;
}

.happy-wa-floating-btn:hover .happy-wa-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Caja de Chat Emergente */
.happy-wa-chatbox {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.22);
  z-index: 99998;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(0,0,0,0.06);
}

.happy-wa-chatbox.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header del Chat */
.happy-wa-header {
  background: linear-gradient(135deg, #672B83 0%, #8E44AD 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.happy-wa-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.happy-wa-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  overflow: hidden;
}

.happy-wa-avatar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.happy-wa-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background-color: #2ECC71;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.happy-wa-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.happy-wa-title span {
  font-size: 11.5px;
  color: #E8D4F5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.happy-wa-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.happy-wa-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Cuerpo del Chat */
.happy-wa-body {
  padding: 18px;
  background: #f8f6fb;
  max-height: 380px;
  overflow-y: auto;
}

.happy-wa-bubble {
  background: #ffffff;
  padding: 14px 16px;
  border-radius: 14px 14px 14px 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 13.5px;
  line-height: 1.5;
  color: #333333;
  margin-bottom: 15px;
  position: relative;
}

.happy-wa-bubble::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 10px 10px;
  border-color: transparent transparent #ffffff transparent;
}

.happy-wa-time {
  display: block;
  font-size: 10px;
  color: #999999;
  text-align: right;
  margin-top: 4px;
}

/* Opciones de respuesta rápida */
.happy-wa-quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.happy-wa-chip {
  background: #ffffff;
  border: 1px solid #e2d6ee;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #672B83;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.happy-wa-chip:hover {
  background: #672B83;
  color: #ffffff;
  border-color: #672B83;
  transform: translateX(4px);
}

.happy-wa-chip i {
  font-size: 14px;
}

/* Footer / Input del Chat */
.happy-wa-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  gap: 8px;
}

.happy-wa-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.happy-wa-input:focus {
  border-color: #25D366;
}

.happy-wa-send-btn {
  background: #25D366;
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.happy-wa-send-btn:hover {
  background: #1ebd5b;
  transform: scale(1.05);
}

/* Botones de Cotización Directa en Tarjetas */
.btn-happy-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 25px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
  text-decoration: none !important;
  border: none;
  cursor: pointer;
}

.btn-happy-wa:hover {
  background: #1fa851;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.45);
}

.btn-happy-wa svg, .btn-happy-wa i {
  font-size: 17px;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Botón secundario de WhatsApp (blanco o contorno) */
.btn-happy-wa-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: #25D366 !important;
  border: 2px solid #25D366;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.btn-happy-wa-outline:hover {
  background: #25D366;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* Banner de Cotización Rápida */
.happy-wa-banner {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 30px;
  margin: 40px 0;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.happy-wa-banner-content h3 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.happy-wa-banner-content p {
  color: #e9fbf0;
  font-size: 15px;
  margin: 0;
}

.happy-wa-banner-btn {
  background: #ffffff;
  color: #128C7E !important;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  text-decoration: none !important;
}

.happy-wa-banner-btn:hover {
  background: #f0fff4;
  transform: scale(1.05);
  color: #0b6359 !important;
}

/* Modal de Cotización de Paquetes */
.happy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.happy-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.happy-modal-content {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  transform: translateY(30px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.happy-modal-overlay.active .happy-modal-content {
  transform: translateY(0) scale(1);
}

@media (max-width: 576px) {
  .happy-wa-chatbox {
    bottom: 85px;
    right: 15px;
    width: calc(100vw - 30px);
    max-height: 80vh;
  }
  .happy-wa-input {
    font-size: 16px; /* Evita auto-zoom en iOS Safari */
  }
  .happy-wa-floating-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
  .happy-wa-body {
    max-height: calc(80vh - 130px);
  }
}
