/**
 * WhatsApp Floating Button - ChickIn
 * 
 * Widget flotante de contacto con estilo ChickIn
 * Usa variables CSS del sitio y la paleta de colores oficial
 * 
 * @version 1.0
 * @updated 2026-01-20
 */

/* ============================================
   CONTENEDOR FLOTANTE
   ============================================ */

.chickin-wa-floating {
  position: fixed;
  z-index: 990;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.chickin-wa-floating.chickin-wa-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  pointer-events: none;
}

.chickin-wa-floating--right {
  right: 20px;
}

.chickin-wa-floating--left {
  left: 20px;
}

/* ============================================
   BOTÓN PRINCIPAL (PILL)
   ============================================ */

.chickin-wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 999px;
  
  /* Fondo antracita sólido y minimalista */
  background: var(--chickin-anthracite, #1a1a1d);
  
  color: var(--chickin-white, #ffffff);
  text-decoration: none;
  
  /* Sin borde para máximo minimalismo */
  border: none;
  
  /* Sombra sutil y elegante */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  
  transition: 
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  
  pointer-events: auto;
  cursor: pointer;
}

.chickin-wa-pill:hover {
  transform: translateY(-2px);
  background: #2d2d32;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chickin-wa-pill:active {
  transform: translateY(0);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   ÍCONO DE WHATSAPP
   ============================================ */

.chickin-wa-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  border-radius: 50%;
  
  /* Verde WhatsApp sólido */
  background: #25d366;
  
  /* Sin sombras extras, solo la del contenedor */
  transition: all 0.2s ease;
}

.chickin-wa-pill:hover .chickin-wa-icon {
  transform: scale(1.05);
  background: #22c55e;
}

.chickin-wa-icon img {
  display: block;
  width: 28px;
  height: 28px;
  filter: none;
}

/* ============================================
   ANIMACIÓN DE PULSO
   ============================================ */

.chickin-wa-icon--pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(37, 211, 102, 0.3);
  animation: chickinWaPulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* ============================================
   TEXTO DEL BOTÓN
   ============================================ */

.chickin-wa-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.2;
}

.chickin-wa-label {
  font-family: 'League Spartan', var(--font-heading, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--chickin-white, #ffffff);
  line-height: 1.3;
}

.chickin-wa-cta {
  font-family: 'League Spartan', var(--font-body, sans-serif);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.3;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes chickinWaPulse {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(0.85);
    opacity: 1;
  }
}



/* ============================================
   RESPONSIVE: TABLET
   ============================================ */

@media (max-width: 768px) {
  .chickin-wa-floating {
    bottom: 18px;
  }

  .chickin-wa-floating--right {
    right: 16px;
  }

  .chickin-wa-floating--left {
    left: 16px;
  }

  .chickin-wa-pill {
    gap: 10px;
    padding: 10px 16px;
  }

  .chickin-wa-icon {
    width: 42px;
    height: 42px;
  }

  .chickin-wa-icon img {
    width: 26px;
    height: 26px;
  }

  .chickin-wa-label {
    font-size: 12.5px;
  }

  .chickin-wa-cta {
    font-size: 11px;
  }
}

/* ============================================
   RESPONSIVE: MOBILE
   ============================================ */

@media (max-width: 480px) {
  .chickin-wa-floating {
    bottom: 16px;
  }

  .chickin-wa-floating--right {
    right: 12px;
  }

  .chickin-wa-floating--left {
    left: 12px;
  }

  .chickin-wa-pill {
    padding: 10px 14px;
    gap: 9px;
  }

  .chickin-wa-icon {
    width: 40px;
    height: 40px;
  }

  .chickin-wa-icon img {
    width: 24px;
    height: 24px;
  }

  .chickin-wa-text {
    gap: 2px;
  }

  .chickin-wa-label {
    font-size: 12px;
  }

  .chickin-wa-cta {
    font-size: 11px;
  }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .chickin-wa-pill,
  .chickin-wa-icon,
  .chickin-wa-icon img {
    animation: none !important;
    transition: none !important;
  }
  
  .chickin-wa-icon--pulse::after {
    animation: none !important;
    opacity: 0.3;
  }
}

/* Estado de foco */
.chickin-wa-pill:focus-visible {
  outline: 2px solid rgba(255, 153, 51, 0.5);
  outline-offset: 3px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
  .chickin-wa-pill {
    outline: 2px solid var(--chickin-orange-web);
  }
}

/* ============================================
   COMPATIBILIDAD CON HEADER Y FOOTER
   ============================================ */

/* Asegurar que el botón esté por encima del footer pero debajo de modales */
.chickin-wa-floating {
  z-index: 990; /* Por debajo de modales (1000+) pero sobre contenido regular */
}

/* En móvil, evitar conflicto con menú móvil abierto */
@media (max-width: 768px) {
  body.nav-open .chickin-wa-floating {
    z-index: 899; /* Por debajo del overlay del menú móvil */
  }
}
