/* Sticky Widget — адаптирован под АгроУспех | v2026-06-03 */
#stickyWidget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Toggle button */
#stickyToggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eab300;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(234, 179, 0, 0.45);
  transition: transform 0.3s, background 0.3s;
  position: relative;
  color: #252529;
}
#stickyToggle:hover {
  transform: scale(1.06);
}
#stickyToggle {
  position: relative;
  overflow: hidden;
}
#stickyToggle svg {
  display: block;
  flex-shrink: 0;
}


/* Pulse ring */
#stickyPulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(234, 179, 0, 0.4);
  animation: pulseRing 2s ease-out infinite;
  pointer-events: none;
}

/* Menu items */
.sticky-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease both;
  opacity: 0;
}
.sticky-menu-label {
  background: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #252529;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Menu buttons */
.sticky-menu-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s;
}
.sticky-menu-btn:hover {
  transform: scale(1.08);
}
.sticky-menu-btn svg {
  display: block;
}

.sticky-menu-btn--phone {
  background: #513172;
  box-shadow: 0 4px 16px rgba(81, 49, 114, 0.4);
}
.sticky-menu-btn--whatsapp {
  background: #25D366;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
}
.sticky-menu-btn--telegram {
  background: #26A5E4;
  box-shadow: 0 4px 16px rgba(38, 165, 228, 0.4);
}
.sticky-menu-btn--callback {
  background: #eab300;
  color: #252529;
  box-shadow: 0 4px 16px rgba(234, 179, 0, 0.4);
}
.sticky-menu-btn--vk {
  background: #4C75A3;
  box-shadow: 0 4px 16px rgba(76, 117, 163, 0.4);
}
.sticky-menu-btn--max {
  background: #FF6600;
  box-shadow: 0 4px 16px rgba(255, 102, 0, 0.4);
}

/* Tooltip */
#stickyTooltip {
  display: none;
  align-items: center;
  gap: 8px;
  animation: tooltipPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.sticky-tooltip-text {
  background: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #252529;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  line-height: 1.4;
}

/* Keyframes */
@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes tooltipPop {
  from {
    opacity: 0;
    transform: translateX(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes tooltipFadeOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(8px) scale(0.95);
  }
}

/* Responsive */
@media (max-width: 760px) {
  #stickyWidget {
    bottom: 16px;
    right: 12px;
  }
  #stickyToggle {
    width: 52px;
    height: 52px;
  }
  .sticky-menu-btn {
    width: 46px;
    height: 46px;
  }
  .sticky-menu-label {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* Hide on modals/open menus to avoid overlap */
body.agro-menu-open #stickyWidget,
body.lead-modal-open #stickyWidget,
body.lead-thanks-modal-open #stickyWidget,
body.video-modal-open #stickyWidget,
body.fancybox-active #stickyWidget {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
