:root {
  --whatsapp-green: #25d366;
  --whatsapp-ink: #080808;
  --whatsapp-surface: rgba(255, 255, 255, 0.9);
}

.whatsapp-funnel {
  position: fixed;
  z-index: 220;
  right: 22px;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(232px, calc(100vw - 28px));
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.84);
  box-shadow:
    0 18px 54px rgba(8, 8, 8, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  text-decoration: none;
  opacity: 0;
  transform: translateY(12px);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.2, 0.7, 0, 1),
    box-shadow 180ms ease;
}

.whatsapp-funnel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.whatsapp-funnel:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(18, 18, 18, 0.9);
  box-shadow:
    0 24px 68px rgba(8, 8, 8, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
}

.whatsapp-funnel:focus-visible {
  outline: 3px solid var(--whatsapp-green);
  outline-offset: 3px;
}

.whatsapp-funnel-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--whatsapp-green);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.whatsapp-funnel-icon svg {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.whatsapp-funnel-copy {
  min-width: 0;
}

.whatsapp-funnel-copy strong,
.whatsapp-funnel-copy small {
  display: block;
  letter-spacing: 0;
}

.whatsapp-funnel-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-funnel-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 520;
  line-height: 1;
  white-space: nowrap;
}

.whatsapp-funnel-channel {
  color: var(--whatsapp-green);
  font-weight: 680;
}

.whatsapp-funnel-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.whatsapp-funnel:hover .whatsapp-funnel-arrow {
  border-color: var(--whatsapp-green);
  background: var(--whatsapp-green);
  color: #080808;
  transform: translate(1px, -1px);
}

.whatsapp-dock-link {
  display: none;
}

body.menu-open .whatsapp-funnel,
body.promo-open .whatsapp-funnel,
body.lightbox-open .whatsapp-funnel,
body.wc-lock .whatsapp-funnel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

@media (max-width: 700px) {
  .whatsapp-funnel {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(206px, calc(100vw - 24px));
    min-height: 54px;
    grid-template-columns: 36px minmax(0, 1fr) 26px;
    gap: 8px;
    padding: 8px 9px;
  }

  .whatsapp-funnel-icon {
    width: 36px;
    height: 36px;
  }

  .whatsapp-funnel-copy strong {
    font-size: 13px;
  }

  .whatsapp-funnel-copy small {
    font-size: 9px;
  }

  body.has-whatsapp-mobile-dock .whatsapp-funnel {
    display: none;
  }

  body.has-whatsapp-mobile-dock .mobile-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.has-whatsapp-mobile-dock .dock-promo-badge {
    display: none !important;
  }

  body.has-whatsapp-mobile-dock .whatsapp-dock-link {
    display: flex;
    color: var(--whatsapp-ink);
  }

  body.has-whatsapp-mobile-dock .whatsapp-dock-link small {
    color: rgba(8, 8, 8, 0.48);
    font-size: 8px;
    font-weight: 600;
  }

  body.has-whatsapp-mobile-dock .whatsapp-dock-link span {
    font-size: 10px;
    font-weight: 600;
  }

  body.has-whatsapp-mobile-dock .whatsapp-dock-link::before {
    content: "";
    position: absolute;
    top: 5px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--whatsapp-green);
  }

  body.has-whatsapp-case-cta .whatsapp-funnel {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  body.has-whatsapp-project-bar .whatsapp-funnel {
    width: 54px;
    grid-template-columns: 36px;
    justify-content: center;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.has-whatsapp-project-bar .whatsapp-funnel-copy,
  body.has-whatsapp-project-bar .whatsapp-funnel-arrow {
    display: none;
  }
}

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

@media print {
  .whatsapp-funnel {
    display: none;
  }
}
