@keyframes floatingWhats {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.45);
    opacity: 0;
  }
}

.floating-whatsapp {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9995;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.floating-whatsapp > button {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  outline: none;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-whatsapp > button:focus {
  outline: none !important;
}

.floating-whatsapp > button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: #25d366;
  border-radius: 50%;
  animation: 1.4s ease floatingWhats infinite;
  z-index: -1;
}

.floating-whatsapp > button img {
  width: 48%;
  filter: invert(1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.35s ease;
}

.floating-whatsapp > button img.send {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-180deg) scale(0);
}

.floating-whatsapp-form-container {
  position: relative;
  background-color: #121217;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-whatsapp-header {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: #FFFFFF;
  padding: 14px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-whatsapp-header strong {
  flex: 1;
}

.floating-whatsapp-close {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #FFFFFF;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.2s ease;
}

.floating-whatsapp-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.floating-whatsapp-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  display: inline-block;
}

.floating-whatsapp-form-container form {
  height: 230px;
  width: 300px;
}

.floating-whatsapp-form-container form input[type="text"] {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 230px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1E1E26;
  color: #FFFFFF;
  border-radius: 50px;
  padding: 0 16px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.floating-whatsapp-form-container form input[type="text"]:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.floating-whatsapp-form-container form input[type="text"]::placeholder {
  color: #9CA3AF;
}

.initial-message {
  position: relative;
  margin-top: 16px;
}

.initial-message span {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: #151519;
  margin: 14px 16px;
  padding: 12px 14px;
  width: 80%;
  background-color: #FFFFFF;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

/* Hover / Focus-Within / Programmatic (.is-open) Open State */
.floating-whatsapp:hover .floating-whatsapp-form-container,
.floating-whatsapp:focus-within .floating-whatsapp-form-container,
.floating-whatsapp.is-open .floating-whatsapp-form-container {
  height: 280px;
  width: 300px;
  opacity: 1;
  pointer-events: auto;
}

.floating-whatsapp.is-open .floating-whatsapp-form-container {
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(37, 211, 102, 0.45);
}

.floating-whatsapp:hover > button,
.floating-whatsapp:focus-within > button,
.floating-whatsapp.is-open > button {
  width: 42px;
  height: 42px;
  bottom: 10px;
  right: 10px;
}

.floating-whatsapp:hover > button::before,
.floating-whatsapp:focus-within > button::before,
.floating-whatsapp.is-open > button::before {
  animation: none;
  opacity: 0;
}

.floating-whatsapp:hover > button img.whats,
.floating-whatsapp:focus-within > button img.whats,
.floating-whatsapp.is-open > button img.whats {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(180deg) scale(0);
}

.floating-whatsapp:hover > button img.send,
.floating-whatsapp:focus-within > button img.send,
.floating-whatsapp.is-open > button img.send {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0) scale(1);
}
