/* Call4Site Widget © 2026 Marcin Werner. All rights reserved. */
#c4s-widget {
  --c4s-color: #2098d1;
  --c4s-size: 77px;
  --c4s-gap: 12px;
  --c4s-bottom: 25px;
  --c4s-side: 25px;

  position: fixed;
  right: var(--c4s-side);
  bottom: var(--c4s-bottom);
  z-index: 60;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#c4s-widget .c4s-main {
  position: relative;
  width: var(--c4s-size);
  height: var(--c4s-size);
  border-radius: 50%;
  border: none;
  background: var(--c4s-color);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
}
#c4s-widget .c4s-main:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
#c4s-widget .c4s-main img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

#c4s-widget .c4s-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #dd0000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

#c4s-widget .c4s-shockwave {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}
#c4s-widget .c4s-shockwave::before,
#c4s-widget .c4s-shockwave::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--c4s-color);
  opacity: 0;
  animation: c4s-shockwave 8s ease-out infinite;
  will-change: transform, opacity;
}
#c4s-widget .c4s-shockwave::before { animation-delay: 0s; }
#c4s-widget .c4s-shockwave::after { animation-delay: 4s; }

@keyframes c4s-shockwave {
  0%   { transform: scale(1);   opacity: 0.7; }
  50%  { transform: scale(1.6); opacity: 0;   }
  100% { transform: scale(1.6); opacity: 0;   }
}

#c4s-widget[data-state='open'] .c4s-shockwave,
#c4s-widget[data-state='open'] .c4s-main,
#c4s-widget[data-state='open'] .c4s-badge {
  display: none;
}

#c4s-widget .c4s-cta {
  position: absolute;
  right: calc(var(--c4s-size) + 14px);
  bottom: 8px;
  width: 330px;
  background: #ffffff;
  color: #333333;
  padding: 12px 28px 12px 16px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
#c4s-widget .c4s-cta p { margin: 0; }
#c4s-widget[data-cta='visible'] .c4s-cta {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
#c4s-widget[data-state='open'] .c4s-cta,
#c4s-widget[data-cta='dismissed'] .c4s-cta {
  opacity: 0 !important;
  pointer-events: none !important;
}

#c4s-widget .c4s-cta::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 24px;
  border: 6px solid transparent;
  border-left-color: #ffffff;
  border-right-width: 0;
}

#c4s-widget .c4s-cta-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
#c4s-widget .c4s-cta-close:hover {
  background: #f0f0f0;
  color: #333;
}
#c4s-widget .c4s-cta-close svg { width: 12px; height: 12px; }

#c4s-widget .c4s-channels {
  position: absolute;
  right: 0;
  bottom: calc(var(--c4s-size) + var(--c4s-gap));
  display: flex;
  flex-direction: column;
  gap: var(--c4s-gap);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#c4s-widget[data-state='open'] .c4s-channels {
  opacity: 1;
  pointer-events: auto;
}

#c4s-widget .c4s-channel {
  width: var(--c4s-size);
  height: var(--c4s-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  transform: translateY(20px) scale(0.8);
  opacity: 0;
}
#c4s-widget[data-state='open'] .c4s-channel {
  animation: c4s-channel-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
#c4s-widget[data-state='open'] .c4s-channel:nth-child(1) { animation-delay: 0.05s; }
#c4s-widget[data-state='open'] .c4s-channel:nth-child(2) { animation-delay: 0.12s; }
#c4s-widget[data-state='open'] .c4s-channel:nth-child(3) { animation-delay: 0.19s; }

@keyframes c4s-channel-in {
  0%   { transform: translateY(20px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

#c4s-widget .c4s-channel:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
#c4s-widget .c4s-channel svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

#c4s-widget .c4s-phone svg .color-element,
#c4s-widget .c4s-sms svg .color-element {
  fill: var(--c4s-color) !important;
}
#c4s-widget .c4s-sms svg text {
  fill: var(--c4s-color) !important;
}

#c4s-widget .c4s-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 7px 14px;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1;
}
#c4s-widget .c4s-tip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #ffffff;
  border-right-width: 0;
}
#c4s-widget .c4s-channel:hover .c4s-tip,
#c4s-widget .c4s-channel:focus-visible .c4s-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (hover: none) {
  #c4s-widget .c4s-tip { display: none; }
}

#c4s-widget .c4s-close {
  display: none;
  width: var(--c4s-size);
  height: var(--c4s-size);
  border-radius: 50%;
  border: none;
  background: var(--c4s-color);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}
#c4s-widget .c4s-close:hover { transform: scale(1.08); }
#c4s-widget .c4s-close svg { width: 24px; height: 24px; }
#c4s-widget[data-state='open'] .c4s-close { display: flex; }

@media (max-width: 600px) {
  #c4s-widget {
    --c4s-size: 66px;
    --c4s-bottom: 18px;
    --c4s-side: 18px;
  }
  #c4s-widget .c4s-cta {
    width: min(300px, calc(100vw - 80px));
    font-size: 12px;
    padding: 10px 24px 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #c4s-widget .c4s-shockwave::before,
  #c4s-widget .c4s-shockwave::after {
    animation: none;
    display: none;
  }
  #c4s-widget .c4s-channel {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

@media print {
  #c4s-widget { display: none; }
}
