/* Botón flotante de WhatsApp — un círculo, sin etiqueta ni popup.
   Verde #1A9447: el más cercano al de WhatsApp que cumple WCAG 1.4.11
   (3.65:1 con el fondo #F8F7F3 y 3.91:1 con el glifo blanco); el #2db742 del
   plugin original daba 2.46:1. */

.nh-wa {
  --nh-wa-bg: #1A9447;
  --nh-wa-offset: 16px;

  position: fixed;
  right: calc(var(--nh-wa-offset) + env(safe-area-inset-right));
  bottom: calc(var(--nh-wa-offset) + env(safe-area-inset-bottom));
  z-index: 9990;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--nh-wa-bg);
  color: #fff;
  line-height: 0;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 15, 15, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nh-wa svg {
  width: 26px;
  height: 26px;
  display: block;
  fill: currentColor;
}

.nh-wa:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 15, 15, 0.24);
}

.nh-wa:active {
  transform: translateY(0);
}

.nh-wa:focus-visible {
  outline: 3px solid #0f0f0f;
  outline-offset: 3px;
}

@media (min-width: 768px) {
  .nh-wa {
    --nh-wa-offset: 24px;
  }
}

/* Ficha de producto: no tapar la barra de compra fija (~99px / ~136px). */
body:has(.nh-pdp-bar--visible) .nh-wa {
  bottom: calc(99px + 24px + env(safe-area-inset-bottom));
}

@media (max-width: 767px) {
  body:has(.nh-pdp-bar--visible) .nh-wa {
    bottom: calc(136px + 16px + env(safe-area-inset-bottom));
  }
}

/* Fuera del flujo de compra y del side cart de CheckoutWC. */
body.woocommerce-cart .nh-wa,
body.woocommerce-checkout .nh-wa,
body.woocommerce-order-received .nh-wa,
body.cfw-side-cart-open .nh-wa,
body.nh-side-cart-open .nh-wa {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nh-wa {
    transition: none;
  }

  .nh-wa:hover {
    transform: none;
  }
}
