/* Contact Button — floating managers widget
   Brand accent matches site (#f2206c). Left side avoids #register-bonus-widget and .scroll-to-top (both right). */
#contact-button.contact-button {
  position: fixed;
  z-index: 997;
  bottom: 20px;
  left: 20px;
  right: auto;
  /* min-width instead of fixed width so hover scale is not clipped horizontally */
  width: auto;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  overflow: visible;
}

#contact-button.contact-button--right {
  left: auto;
  right: 20px;
  /* Sit above #register-bonus-widget (bottom:20px) and below scroll-to-top active (bottom:127px) */
  bottom: 88px;
}

#contact-button .contact-button__toggle {
  pointer-events: auto;
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #f2206c;
  box-shadow: 0 0 55px 7px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}

#contact-button .contact-button__toggle:hover,
#contact-button .contact-button__toggle:focus {
  background: #d91b5d;
}

#contact-button .contact-button__toggle-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#contact-button .contact-button__toggle-icon--chat {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#contact-button .contact-button__toggle-icon--chat svg {
  display: block;
  width: 26px;
  height: 26px;
}

#contact-button .contact-button__toggle-icon--close {
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: rotate(-45deg) scale(0.6);
}

#contact-button .contact-button__toggle-icon--close:before,
#contact-button .contact-button__toggle-icon--close:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
}

#contact-button .contact-button__toggle-icon--close:before {
  transform: rotate(45deg);
}

#contact-button .contact-button__toggle-icon--close:after {
  transform: rotate(-45deg);
}

#contact-button.is-open .contact-button__toggle-icon--chat {
  opacity: 0;
  transform: scale(0.6) rotate(45deg);
}

#contact-button.is-open .contact-button__toggle-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

#contact-button .contact-button__list {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  /* overflow:hidden only while collapsed — otherwise hover scale gets clipped */
  overflow: hidden;
  padding: 0;
  position: relative;
  transform: translateY(8px);
  transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease, padding 0.22s ease;
}

#contact-button.is-open .contact-button__list {
  pointer-events: auto;
  max-height: 480px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  /* spare room so scaled icons are not clipped by siblings/parent */
  padding: 8px 6px;
}

/*
  Rev5: contrast on white pages is the priority (Rev3–4 frosted was too glass-like / too white).
  Primary: light-neutral pad (#f0f0f2-ish) + soft shadow. Blur is secondary, not the contrast source.
  Still on ::before so overflow:visible + hover scale stay intact.
*/
#contact-button.is-open .contact-button__list:before {
  content: "";
  position: absolute;
  z-index: 0;
  /* compact pill hugging the icon column — not a heavy site overlay */
  top: 2px;
  bottom: 2px;
  left: 0;
  right: 0;
  border-radius: 22px;
  /* solid enough to read on #fff; slight alpha softens on dark footer */
  background: rgba(240, 240, 242, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.05);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  box-sizing: border-box;
}

#contact-button .contact-button__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  position: relative;
  z-index: 1;
  overflow: visible;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#contact-button .contact-button__item:hover,
#contact-button .contact-button__item:focus {
  transform: scale(1.08);
  background: transparent;
  color: inherit;
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

#contact-button .contact-button__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  line-height: 0;
  overflow: visible;
}

#contact-button .contact-button__icon svg {
  display: block;
  width: 36px;
  height: 36px;
  overflow: visible;
}

#contact-button .contact-button__item--phone .contact-button__icon svg {
  width: 28px;
  height: 28px;
}

#contact-button .contact-button__label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #151515;
  color: #fff;
  font-family: Whitney-Semibld, sans-serif;
  font-size: 12px;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

#contact-button.contact-button--right .contact-button__label {
  left: auto;
  right: calc(100% + 10px);
}

#contact-button .contact-button__item:hover .contact-button__label,
#contact-button .contact-button__item:focus .contact-button__label {
  opacity: 1;
}

@media (max-width: 767px) {
  #contact-button.contact-button {
    left: 10px;
    bottom: 10px;
  }

  #contact-button.contact-button--right {
    left: auto;
    right: 10px;
    bottom: 72px;
  }

  #contact-button .contact-button__toggle {
    width: 52px;
    height: 52px;
  }

  #contact-button.is-open .contact-button__list {
    padding: 6px 4px;
  }

  #contact-button.is-open .contact-button__list:before {
    border-radius: 20px;
    background: rgba(240, 240, 242, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }

  #contact-button .contact-button__item {
    width: 42px;
    height: 42px;
  }

  #contact-button .contact-button__icon,
  #contact-button .contact-button__icon svg {
    width: 38px;
    height: 38px;
  }

  #contact-button .contact-button__item--phone .contact-button__icon svg {
    width: 28px;
    height: 28px;
  }

  /* Avoid labels causing horizontal scroll on narrow screens */
  #contact-button .contact-button__label {
    display: none;
  }

  /* No desktop-style hover emphasis needed on touch; keep tap clean */
  #contact-button .contact-button__item:hover,
  #contact-button .contact-button__item:focus {
    transform: none;
  }

  #contact-button .contact-button__item:active {
    transform: scale(1.05);
  }
}
