/* The same recognizable mark on every business WhatsApp link, including AJAX cards. */
a[href^="https://wa.me/"]:not(.vlc-whatsapp-float, .vlc-service-card)::before,
.vlc-service-card[href^="https://wa.me/"] .vlc-service-card__action::before {
  content: "";
  display: inline-block;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: #25d366 url("../images/whatsapp.svg") center / 18px 18px no-repeat;
  vertical-align: middle;
}

/* Replace generic chat marks and previous bare logos without duplicating icons. */
a[href^="https://wa.me/"]:not(.vlc-whatsapp-float) > svg,
a[href^="https://wa.me/"]:not(.vlc-whatsapp-float) > span[aria-hidden="true"],
a[href^="https://wa.me/"] > .btn-whatsapp-cart__icon,
a[href^="https://wa.me/"] > .lc-round-icon,
.vlc-service-card[href^="https://wa.me/"] .vlc-service-card__action > span[aria-hidden="true"] {
  display: none;
}

a.vlc-btn[href^="https://wa.me/"]::before,
a.btn-whatsapp-cart[href^="https://wa.me/"]::before,
a.lc-whatsapp-cta[href^="https://wa.me/"]::before,
a.vlc-announcement__link[href^="https://wa.me/"]::before,
.vlc-service-card[href^="https://wa.me/"] .vlc-service-card__action::before {
  margin-inline-end: 0;
}

.vlc-whatsapp-float {
  position: fixed;
  z-index: 150;
  right: max(18px, env(safe-area-inset-right));
  bottom: var(--vlc-whatsapp-bottom, max(18px, env(safe-area-inset-bottom)));
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 18px rgb(15 58 33 / 24%);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vlc-whatsapp-float__icon {
  display: block;
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.vlc-whatsapp-float:focus-visible {
  outline: 3px solid #163b2c;
  outline-offset: 4px;
}

.vlc-whatsapp-float__label {
  position: absolute;
  right: calc(100% + 10px);
  padding: 9px 14px;
  border: 1px solid #dce3dc;
  border-radius: 8px;
  background: #fff;
  color: #163b2c;
  box-shadow: 0 3px 12px rgb(15 58 33 / 10%);
  font: 600 16px/1.3 Inter, sans-serif;
  white-space: nowrap;
  visibility: hidden;
}

.vlc-whatsapp-float:focus-visible .vlc-whatsapp-float__label {
  visibility: visible;
}

@media (hover: hover) {
  .vlc-whatsapp-float:hover { background: #1ebe5d; }
  .vlc-whatsapp-float:hover .vlc-whatsapp-float__label { visibility: visible; }
}

/* Keep the background contact out of modal and navigation flows. */
body:has(dialog[open], #vlc-mobile-menu:not([hidden]), [data-lc-saved-products-panel]:not(.hidden)) .vlc-whatsapp-float {
  visibility: hidden;
}

@media (max-width: 759px) {
  .vlc-whatsapp-float { width: 56px; height: 56px; right: max(14px, env(safe-area-inset-right)); }
  body.vlc-has-cart-dock .vlc-whatsapp-float { bottom: var(--vlc-whatsapp-bottom, calc(90px + env(safe-area-inset-bottom))); }
  body.vlc-has-sticky-buy .vlc-whatsapp-float { bottom: var(--vlc-whatsapp-bottom, calc(var(--vlc-kit-sticky-height, 110px) + 12px)); }
}

/* Measurements replace the no-JavaScript fallback, including checkout's hidden dock. */
body .vlc-whatsapp-float.vlc-whatsapp-float--positioned {
  bottom: var(--vlc-whatsapp-bottom, max(18px, env(safe-area-inset-bottom)));
}
