/* ============================================================
 * premium-fab-2026.css
 * Prosermat — FASE 1 / Sección 12 del UX/UI 2026
 * FAB WhatsApp sticky bottom-right.
 *
 * Sustituye al .wa-fab legacy. Cargado DESPUÉS de styles.css y
 * de premium-storefront.css → gana en cascada.
 * ============================================================ */

.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45),
              0 2px 6px rgba(15, 23, 42, 0.12);
  z-index: 150;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .22s cubic-bezier(.22,.9,.22,1),
              box-shadow .22s cubic-bezier(.22,.9,.22,1),
              background .22s cubic-bezier(.22,.9,.22,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
  display: block;
  color: #fff;
  fill: currentColor;
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
  transform: scale(1.08);
  background: #1ebe5a;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.55),
              0 4px 10px rgba(15, 23, 42, 0.16);
  text-decoration: none;
  outline: none;
}

.whatsapp-fab:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 3px;
}

.whatsapp-fab:active {
  transform: scale(0.96);
}

/* Desktop ≥1024px: más espacio del borde y FAB algo más grande */
@media (min-width: 1024px) {
  .whatsapp-fab {
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
  }
  .whatsapp-fab svg {
    width: 30px;
    height: 30px;
  }
}

/* Si hay barra sticky bottom (checkout / carrito mobile), el FAB sube
   para no taparla. Usa :has() — soportado en navegadores 2024+. */
@media (max-width: 640px) {
  body:has(.co-actions) .whatsapp-fab,
  body:has(.cart-mobile-cta) .whatsapp-fab {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
}

/* No imprimir el FAB */
@media print {
  .whatsapp-fab { display: none !important; }
}

/* Respetar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab {
    transition: background .15s linear !important;
  }
  .whatsapp-fab:hover,
  .whatsapp-fab:focus-visible,
  .whatsapp-fab:active {
    transform: none;
  }
}

/* Oculta cualquier .wa-fab legacy que pudiera quedar de otros sitios
   del proyecto, para asegurar que no haya doble FAB en pantalla. */
.wa-fab {
  display: none !important;
}
