/* Floating chat launcher — WhatsApp + Messenger (mobile-safe) */
.wa-fab-wrap {
  position: fixed;
  z-index: 25;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: bottom 0.2s ease;
}

.wa-fab-wrap.wa-fab--raised {
  bottom: max(108px, calc(env(safe-area-inset-bottom, 0px) + 96px));
}

.wa-fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.wa-fab-wrap.is-open .wa-fab-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.wa-fab-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  text-decoration: none;
  font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  max-width: min(78vw, 260px);
}

.wa-fab-option:focus-visible {
  outline: 2px solid #0866ff;
  outline-offset: 2px;
}

.wa-fab-option__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.wa-fab-option__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.wa-fab-option--whatsapp .wa-fab-option__icon {
  background: #25d366;
  color: #fff;
}

.wa-fab-option--messenger .wa-fab-option__icon {
  background: linear-gradient(135deg, #00b2ff 0%, #006aff 50%, #a033ff 100%);
  color: #fff;
}

.wa-fab-option--email .wa-fab-option__icon {
  background: #ea4335;
  color: #fff;
}

.wa-fab {
  position: relative;
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 55%, #0866ff 100%);
  color: #fff;
  line-height: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
  overflow: hidden;
}

/* Fixed slot — SVG is always dead-centered (not only on hover) */
.wa-fab__icon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wa-fab__icon svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: 0;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
}

.wa-fab:hover,
.wa-fab:focus-visible {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
  filter: brightness(1.08);
  outline: none;
}

.wa-fab:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #25d366, 0 8px 22px rgba(0, 0, 0, 0.38);
}

.wa-fab:active {
  filter: brightness(0.95);
}

.wa-fab-wrap.is-open .wa-fab {
  background: #1a1a1a;
}

.wa-fab-wrap.is-open .wa-fab:hover,
.wa-fab-wrap.is-open .wa-fab:focus-visible {
  filter: brightness(1.2);
}

/* Compact phones (Galaxy A14 class) */
@media (max-width: 480px) {
  .wa-fab-wrap {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .wa-fab-wrap.wa-fab--raised {
    bottom: max(118px, calc(env(safe-area-inset-bottom, 0px) + 104px));
  }

  .wa-fab {
    width: 52px;
    height: 52px;
  }

  .wa-fab__icon svg {
    width: 22px;
    height: 22px;
  }

  .wa-fab-option {
    font-size: 13px;
    padding: 7px 10px 7px 7px;
    gap: 8px;
  }

  .wa-fab-option__icon {
    width: 36px;
    height: 36px;
  }

  .wa-fab-option__icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-fab,
  .wa-fab-menu,
  .wa-fab-wrap {
    transition: none;
  }
}
