/* ============================================
   WhatsApp Floating Button — Grúas Maddox
   Top-right on hero, bottom-right on scroll
   ============================================ */

.wa-btn {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  padding: 12px 20px 12px 14px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  /* Posición inicial: arriba a la derecha */
  top: 88px;
  right: 24px;
  bottom: auto;
  transition:
    top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    bottom 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    right 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.35s ease,
    padding 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.2s ease;
}

.wa-btn:hover {
  color: #fff;
  background: #1ebe5d;
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
  transform: scale(1.05);
  text-decoration: none;
}

.wa-btn:active {
  transform: scale(0.97);
}

/* Ícono de WhatsApp */
.wa-btn__icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  transition: font-size 0.35s ease;
}

/* Texto del botón */
.wa-btn__label {
  overflow: hidden;
  max-width: 160px;
  opacity: 1;
  transition: max-width 0.4s ease, opacity 0.3s ease;
  line-height: 1.2;
}

.wa-btn__label span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

/* ── Estado: scrolled (esquina inferior derecha) ── */
.wa-btn.wa-scrolled {
  top: auto;
  bottom: 30px;
  right: 30px;
  border-radius: 50%;
  padding: 16px;
}

.wa-btn.wa-scrolled .wa-btn__label {
  max-width: 0;
  opacity: 0;
}

.wa-btn.wa-scrolled .wa-btn__icon {
  font-size: 30px;
}

/* Tooltip al hacer hover en estado scrolled */
.wa-btn.wa-scrolled::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.wa-btn.wa-scrolled::after {
  content: '';
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.wa-btn.wa-scrolled:hover::before,
.wa-btn.wa-scrolled:hover::after {
  opacity: 1;
}

/* ── Animación de pulso (atención) ── */
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wa-btn.wa-pulse {
  animation: wa-pulse 2.2s ease-out infinite;
}

/* ── Responsive: móvil siempre abajo ── */
@media (max-width: 768px) {
  .wa-btn {
    top: auto !important;
    bottom: 24px;
    right: 20px;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.5);
  }

  .wa-btn .wa-btn__label {
    max-width: 0 !important;
    opacity: 0 !important;
  }

  .wa-btn .wa-btn__icon {
    font-size: 28px;
  }

  .wa-btn.wa-scrolled {
    bottom: 24px;
    right: 20px;
  }
}
