/**
 * Sticky contact FAB — WhatsApp primary + email menu.
 * Dedicated asset so homepage (no website-packages-shared.css) and silos share one SSOT.
 */

.csmbac-sticky-contact {
  --sticky-contact-wa: rgba(37, 211, 102, 0.42);
  --sticky-contact-wa-hover: rgba(37, 211, 102, 0.55);
  --sticky-contact-mail: rgba(59, 130, 246, 0.42);
  --sticky-contact-mail-hover: rgba(59, 130, 246, 0.55);
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  left: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: calc(100vw - 1.5rem);
  pointer-events: none;
}

.csmbac-sticky-contact > * {
  pointer-events: auto;
}

.csmbac-sticky-contact__menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(16.5rem, calc(100vw - 2rem));
  padding: 0.4rem;
  border-radius: 1rem;
  background: rgba(8, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(0.5rem) scale(0.96);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  visibility: hidden;
  pointer-events: none;
}

.csmbac-sticky-contact.is-open .csmbac-sticky-contact__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.csmbac-sticky-contact__menu[hidden] {
  display: none;
}

.csmbac-sticky-contact.is-open .csmbac-sticky-contact__menu[hidden] {
  display: flex;
}

.csmbac-sticky-contact__option {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 0.85rem;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.csmbac-sticky-contact__option:is(:link, :visited, :hover, :active, :focus-visible) {
  color: #fff;
  text-decoration: none;
}

.csmbac-sticky-contact__option:hover,
.csmbac-sticky-contact__option:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.csmbac-sticky-contact__option:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.9);
  outline-offset: 2px;
}

.csmbac-sticky-contact__option[data-channel="whatsapp"] {
  background: rgba(37, 211, 102, 0.22);
  border-color: rgba(37, 211, 102, 0.35);
}

.csmbac-sticky-contact__option[data-channel="email"] {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
}

.csmbac-sticky-contact__option.is-preferred {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.csmbac-sticky-contact__bar {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  background: var(--sticky-contact-wa);
  color: #fff;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform-origin: 70% 50%;
  animation: csmbacStickyContactPulse 10s ease-in-out infinite;
  position: relative;
}

.csmbac-sticky-contact.is-email-preferred .csmbac-sticky-contact__bar {
  background: var(--sticky-contact-mail);
}

.csmbac-sticky-contact__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.42) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 65%
  );
  background-size: 220% 100%;
  background-position: 120% 0;
  opacity: 0;
  animation: csmbacStickyContactShimmer 10s ease-in-out infinite;
  z-index: 0;
}

.csmbac-sticky-contact__primary,
.csmbac-sticky-contact__more {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.csmbac-sticky-contact__primary {
  gap: 0.45rem;
  padding: 0.7rem 0.85rem 0.7rem 0.72rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  line-height: 1;
}

.csmbac-sticky-contact__primary:is(:link, :visited, :hover, :active, :focus-visible) {
  color: #fff;
  text-decoration: none;
}

.csmbac-sticky-contact__more {
  padding: 0 0.72rem;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.15s ease;
}

.csmbac-sticky-contact__bar:hover {
  background: var(--sticky-contact-wa-hover);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.csmbac-sticky-contact.is-email-preferred .csmbac-sticky-contact__bar:hover {
  background: var(--sticky-contact-mail-hover);
}

.csmbac-sticky-contact__more:hover,
.csmbac-sticky-contact__more:focus-visible,
.csmbac-sticky-contact.is-open .csmbac-sticky-contact__more {
  background: rgba(255, 255, 255, 0.14);
}

.csmbac-sticky-contact__primary:focus-visible,
.csmbac-sticky-contact__more:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.9);
  outline-offset: -2px;
}

.csmbac-sticky-contact__brand,
.csmbac-wa-sticky__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.csmbac-sticky-contact__logo,
.csmbac-wa-sticky__logo {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  object-fit: contain;
}

.csmbac-sticky-contact__icon,
.csmbac-sticky-contact__primary-icon svg,
.csmbac-sticky-contact__option svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.csmbac-sticky-contact__chevron {
  width: 1rem;
  height: 1rem;
  display: block;
  transition: transform 0.18s ease;
}

.csmbac-sticky-contact.is-open .csmbac-sticky-contact__chevron {
  transform: rotate(180deg);
}

.csmbac-sticky-contact__label,
.csmbac-wa-sticky__label {
  white-space: nowrap;
}

.csmbac-sticky-contact__primary-icon {
  display: inline-flex;
  align-items: center;
}

@keyframes csmbacStickyContactPulse {
  0%, 84%, 100% { transform: scale(1); }
  88% { transform: scale(1.055); }
  91% { transform: scale(1.02); }
  94% { transform: scale(1.045); }
  97% { transform: scale(0.992); }
}

@keyframes csmbacStickyContactShimmer {
  0%, 82% { background-position: 120% 0; opacity: 0; }
  86% { opacity: 0.95; }
  92% { background-position: -20% 0; opacity: 0.55; }
  96%, 100% { background-position: -20% 0; opacity: 0; }
}

@media (max-width: 640px) {
  .csmbac-sticky-contact {
    right: auto;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    align-items: center;
  }

  .csmbac-sticky-contact__menu {
    transform-origin: bottom center;
    align-self: center;
  }

  .csmbac-sticky-contact__label,
  .csmbac-wa-sticky__label {
    display: none;
  }

  .csmbac-sticky-contact__primary {
    gap: 0.35rem;
    padding: 0.72rem 0.7rem 0.72rem 0.7rem;
  }

  .csmbac-sticky-contact__more {
    padding: 0 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csmbac-sticky-contact__bar,
  .csmbac-sticky-contact__bar::after {
    animation: none;
  }

  .csmbac-sticky-contact__bar::after {
    opacity: 0;
  }

  .csmbac-sticky-contact__menu,
  .csmbac-sticky-contact__chevron,
  .csmbac-sticky-contact__option {
    transition: none;
  }

  .csmbac-sticky-contact__menu {
    transform: none;
  }

  .csmbac-sticky-contact.is-open .csmbac-sticky-contact__menu {
    transform: none;
  }
}
