/* =============================================
   WHATSAPP WIDGET — CSS CORREGIDO
   Fixes: tamaño correcto + no tapa el contenido
   ============================================= */

/* whatsapp widget */
.wa-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  z-index: 9999;
  font-family: Arial, sans-serif;

  /* FIX: el contenedor solo mide lo que necesita */
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wa-button {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wa-icon {
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 34px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.45s ease;
}

.wa-icon.rotate-open {
  transform: rotate(360deg);
}

.wa-icon.rotate-close {
  transform: rotate(-360deg);
}

.wa-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: red;
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.wa-label {
  background: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 16px;
  color: #444;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

/* FIX: menú cerrado no ocupa espacio ni bloquea clics */
.wa-menu {
  width: 320px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
  margin-bottom: 12px;

  /* animación de entrada */
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s ease,
              transform 0.35s ease,
              max-height 0.35s ease;

  /* FIX clave: colapsa completamente cuando está cerrado */
  max-height: 0;
  overflow: hidden;
}

.wa-menu.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  max-height: 600px; /* se expande al abrir */
}

.wa-header {
  background: linear-gradient(135deg, #25d366, #39e27d);
  color: white;
  padding: 16px;
}

.wa-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wa-header h3 {
  margin: 0;
  font-size: 34px;
}

.wa-header p {
  margin: 8px 0 0;
  line-height: 1.4;
  font-size: 15px;
}

.wa-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.wa-close:hover {
  transform: scale(1.15);
}

.wa-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: #334;
  font-size: 15px;
  transition: background 0.2s ease;
}

.wa-option:hover {
  background: #f8f8f8;
}

.wa-option i {
  width: 44px;
  height: 44px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .wa-menu {
    width: calc(100vw - 30px);
  }

  .wa-label {
    display: none;
  }

  .wa-widget {
    right: 15px;
    left: auto;
  }
}