/* ===========================================================================
   FLOATING CONTACT BUTTONS

   Two round buttons stacked in a column at the bottom right: call (brand
   blue) and WhatsApp (green). Loaded on every page from header.php; the
   markup lives in includes/floating-contact.php, printed from footer.php.

   Numbers come from includes/config.php, so a rebrand needs no CSS change.
   Uses the site's colour variables with fallbacks, like help-widget.css.
   =========================================================================== */

.zc-fabs {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 90; /* above the tab bar (65), cart bar (70) and help bubble (80) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

/* ----------------------------------------------------------------- button */
.zc-fab {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, filter .2s ease;
}

.zc-fab svg { width: 27px; height: 27px; fill: currentColor; }

.zc-fab--call {
  background: linear-gradient(135deg,
    var(--accent, #2563EB) 0%, var(--brand, #1D4ED8) 55%, var(--brand-dark, #172554) 100%);
  box-shadow: 0 8px 22px rgba(29, 78, 216, .38), inset 0 1px 0 rgba(255, 255, 255, .38);
}

.zc-fab--wa {
  background: linear-gradient(135deg, #34D399 0%, #25D366 45%, #128C7E 100%);
  box-shadow: 0 8px 22px rgba(18, 140, 126, .4), inset 0 1px 0 rgba(255, 255, 255, .38);
}

.zc-fab--call:hover {
  transform: translateY(-3px) scale(1.06);
  filter: saturate(1.15);
  box-shadow: 0 14px 30px rgba(29, 78, 216, .48), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.zc-fab--wa:hover {
  transform: translateY(-3px) scale(1.06);
  filter: saturate(1.15);
  box-shadow: 0 14px 30px rgba(18, 140, 126, .52), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.zc-fab:active { transform: translateY(0) scale(.95); }

.zc-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* A soft halo that breathes behind each circle; the two are out of sync so
   they read as alive rather than blinking together. */
.zc-fab__ring {
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 2px solid rgba(37, 211, 102, .55);
  border-radius: 50%;
  animation: zcFabPulse 2.6s ease-out infinite;
  pointer-events: none;
}

.zc-fab--call .zc-fab__ring {
  border-color: rgba(37, 99, 235, .5);
  animation-delay: -1.2s;
}

@keyframes zcFabPulse {
  0%        { transform: scale(.9);  opacity: .8; }
  70%, 100% { transform: scale(1.3); opacity: 0; }
}

/* ---------------------------------------------------------------- tooltip */
.zc-fab__tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translate(8px, -50%);
  padding: 7px 11px;
  border: 1px solid var(--line, #BFDBFE);
  border-radius: 9px;
  background: #fff;
  color: var(--ink, #172554);
  box-shadow: 0 8px 20px rgba(23, 37, 84, .14);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.zc-fab:hover .zc-fab__tip,
.zc-fab:focus-visible .zc-fab__tip {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

/* ------------------------------------------------------------------ phone */
@media (max-width: 640px) {
  .zc-fabs {
    right: 14px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }
  .zc-fab { width: 52px; height: 52px; }
  .zc-fab svg { width: 25px; height: 25px; }
}

/* Clear of the sticky cart/checkout bar (its own height is about 70px). */
body.has-mobile-bar .zc-fabs {
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-reduced-motion: reduce) {
  .zc-fab { transition: none; }
  .zc-fab__ring { animation: none; opacity: .55; transform: none; }
  .zc-fab__tip { transition: none; }
}
