/* ATENEA WhatsApp — floating chat widget */
.whatsapp-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.875rem;
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
}

.whatsapp-float {
  position: relative;
  width: 60px;
  height: 60px;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  z-index: 2;
  padding: 0;
  overflow: visible;
}

.whatsapp-float-icon {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  pointer-events: none;
}

#whatsapp-widget .wa-icon,
#whatsapp-widget svg.wa-icon {
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  fill: #ffffff !important;
  color: #ffffff !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.whatsapp-chat-avatar .wa-icon,
.whatsapp-chat-btn .wa-icon {
  width: 22px !important;
  height: 22px !important;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 14px 40px rgba(37, 211, 102, 0.6);
}

.whatsapp-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.45);
  animation: wa-pulse 2s ease-out infinite;
  pointer-events: none;
}

.whatsapp-pulse-2 { animation-delay: 1s; }

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}

.whatsapp-tooltip {
  position: absolute;
  bottom: 72px;
  right: 0;
  padding: 0.5rem 1rem;
  background: #0a2540;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: all 0.4s ease;
  pointer-events: none;
}

.whatsapp-tooltip.show { opacity: 1; transform: translateY(0) scale(1); }
.whatsapp-tooltip.hidden { display: none; }

.whatsapp-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: #0a2540;
  transform: rotate(45deg);
}

.whatsapp-chat {
  width: min(340px, calc(100vw - 2rem));
  background: white;
  border-radius: 2rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.35s ease;
  pointer-events: none;
}

.whatsapp-chat.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.whatsapp-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: white;
}

.whatsapp-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.whatsapp-chat-name {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
}

.whatsapp-chat-status {
  font-size: 0.6875rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.125rem 0 0;
}

.whatsapp-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: wa-dot 2s ease-in-out infinite;
}

@keyframes wa-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#whatsapp-widget .whatsapp-chat-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

#whatsapp-widget .whatsapp-chat-close:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

#whatsapp-widget .whatsapp-close-x {
  display: block !important;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  color: #ffffff !important;
  margin-top: -2px;
  pointer-events: none;
}

.whatsapp-chat-body {
  padding: 1.25rem;
  background: #e5ddd5;
  min-height: 120px;
}

.whatsapp-bubble {
  max-width: 88%;
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 0 1rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #0f172a;
}

.whatsapp-bubble p { margin: 0; }
.whatsapp-bubble p + p { margin-top: 0.375rem; }

.whatsapp-bubble-time {
  display: block;
  font-size: 0.625rem;
  color: #94a3b8;
  text-align: right;
  margin-top: 0.375rem;
}

.whatsapp-chat-footer {
  padding: 1rem 1.125rem;
  background: white;
  border-top: 1px solid #f1f5f9;
}

#whatsapp-widget .whatsapp-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  border: none !important;
}

#whatsapp-widget .whatsapp-chat-btn:hover,
#whatsapp-widget .whatsapp-chat-btn:focus,
#whatsapp-widget .whatsapp-chat-btn:visited {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.5);
  color: #ffffff !important;
  text-decoration: none !important;
}

@media (max-width: 768px) {
  .whatsapp-widget { bottom: 1rem; right: 1rem; }
  .whatsapp-chat { width: min(320px, calc(100vw - 2rem)); }
}
