#contact-widget, #cw-popup {
  --cw-size: 56px; --cw-sub: 44px; --cw-gap: 58px; --cw-x: 20px; --cw-y: 20px;
  --cw-c1: #ff4b2b; --cw-c2: #ff416c; --cw-o1: #6a11cb; --cw-o2: #2575fc;
  --cw-glow: rgba(255,65,108,.55); --cw-glow-open: rgba(37,117,252,.55);
}
#contact-widget {
  position: fixed; bottom: var(--cw-y); z-index: 99999;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
#contact-widget.cw-pos-right { right: var(--cw-x); }
#contact-widget.cw-pos-left  { left: var(--cw-x); }
#contact-widget.cw-pending   { visibility: hidden; }
#contact-widget.cw-hidden, #cw-popup.cw-hidden { display: none !important; }

#contact-widget .cw-wrap { position: relative; z-index: 1; width: var(--cw-size); height: var(--cw-size); }

/* Main button */
#contact-widget .cw-main {
  position: absolute; inset: 0; padding: 0; margin: 0;
  display: grid; place-items: center;
  width: var(--cw-size); height: var(--cw-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cw-c1) 0%, var(--cw-c2) 100%);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 18px var(--cw-glow);
  cursor: pointer;
  transition: border-radius .45s cubic-bezier(.2,.8,.2,1), transform .45s cubic-bezier(.2,.8,.2,1), background .45s ease;
  animation: cwPulse 2.2s infinite;
  will-change: transform, border-radius;
}
#contact-widget.cw-nopulse .cw-main { animation: none; }
#contact-widget .cw-main img {
  width: calc(var(--cw-size) * .47); height: calc(var(--cw-size) * .47); display: block;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
#contact-widget .cw-main:hover { transform: scale(1.06) rotate(6deg); }
#contact-widget.open .cw-main {
  border-radius: calc(var(--cw-size) * .28);
  transform: translateY(4px) scale(1.02) rotate(45deg);
  background: linear-gradient(135deg, var(--cw-o1) 0%, var(--cw-o2) 100%);
  box-shadow: 0 12px 30px rgba(0,0,0,.35), 0 0 24px var(--cw-glow-open);
  animation: none;
}
#contact-widget.open .cw-main img { transform: rotate(-45deg) scale(1.06); }
@keyframes cwPulse {
  0%   { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 0 transparent; }
  60%  { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 22px var(--cw-glow); }
  100% { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 0 transparent; }
}

/* Online / offline dot */
#contact-widget .cw-status {
  position: absolute; top: 0; right: 0; z-index: 3; display: none; pointer-events: none;
  width: max(11px, calc(var(--cw-size) * .2)); height: max(11px, calc(var(--cw-size) * .2)); border-radius: 50%; border: 2px solid #fff; background: #9ca3af;
}
#contact-widget.cw-has-hours .cw-status { display: block; }
#contact-widget.cw-online .cw-status { background: #22c55e; animation: cwOnline 2s infinite; }
#contact-widget.open .cw-status { display: none; }
@keyframes cwOnline { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.7)} 70%{box-shadow:0 0 0 9px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }

/* Sub buttons */
#contact-widget .cw-item {
  position: absolute; left: calc((var(--cw-size) - var(--cw-sub)) / 2); bottom: 0;
  width: var(--cw-sub); height: var(--cw-sub);
  display: grid; place-items: center;
  border-radius: 50%; text-decoration: none;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  transform: translateY(0) scale(.6);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s ease, box-shadow .3s ease, visibility 0s .45s;
}
#contact-widget .cw-item img { width: calc(var(--cw-sub) * .64); height: calc(var(--cw-sub) * .64); display: block; transition: transform .25s ease; }
#contact-widget.open .cw-item {
  pointer-events: auto; opacity: 1; visibility: visible;
  transform: translateY(calc(var(--i) * -1 * var(--cw-gap))) scale(1);
  transition-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms), 0s, 0s;
}
#contact-widget .cw-item:hover img, #contact-widget .cw-item:focus-visible img { transform: scale(1.12); }
#contact-widget .cw-item:focus-visible { outline: 3px solid #2575fc; outline-offset: 2px; }
#contact-widget .cw-item.wa:hover { box-shadow: 0 0 18px rgba(37,211,102,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.ms:hover { box-shadow: 0 0 18px rgba(0,132,255,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.fb:hover { box-shadow: 0 0 18px rgba(24,119,242,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.tg:hover { box-shadow: 0 0 18px rgba(41,169,235,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.ig:hover { box-shadow: 0 0 18px rgba(214,41,118,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.cl:hover { box-shadow: 0 0 18px rgba(34,197,94,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.sm:hover { box-shadow: 0 0 18px rgba(139,92,246,.7), 0 10px 24px rgba(0,0,0,.25); }
#contact-widget .cw-item.em:hover { box-shadow: 0 0 18px rgba(239,68,68,.7), 0 10px 24px rgba(0,0,0,.25); }

/* Labels */
#contact-widget .cw-label {
  position: absolute; top: 50%; transform: translateY(-50%);
  white-space: nowrap; pointer-events: none; opacity: 0;
  padding: 5px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.2;
  background: rgba(20,20,35,.92); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: opacity .2s ease;
}
#contact-widget.cw-pos-right .cw-label { right: calc(100% + 10px); }
#contact-widget.cw-pos-left  .cw-label { left: calc(100% + 10px); }
#contact-widget .cw-item:hover .cw-label, #contact-widget .cw-item:focus-visible .cw-label { opacity: 1; }
#contact-widget.cw-labels-always.open .cw-label { opacity: 1; }

/* Popup */
#cw-popup {
  position: fixed; bottom: calc(var(--cw-y) + var(--cw-size) + 12px); z-index: 99998;
  max-width: 250px; padding: 10px 12px; border-radius: 12px;
  background: rgba(20,20,35,.9); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 13px; line-height: 1.4;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  display: flex; gap: 10px; align-items: center;
}
#cw-popup.cw-pos-right { right: var(--cw-x); }
#cw-popup.cw-pos-left  { left: var(--cw-x); }
#cw-popup.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#cw-popup .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: #22c55e; box-shadow: 0 0 14px rgba(34,197,94,.9); animation: dotPing 1.6s infinite; }
#cw-popup.is-offline .dot { background: #9ca3af; box-shadow: none; animation: none; }
@keyframes dotPing { 0%{transform:scale(1);opacity:1} 70%{transform:scale(1.7);opacity:.2} 100%{transform:scale(1);opacity:1} }
#cw-popup .close { margin-left: auto; cursor: pointer; opacity: .8; user-select: none; font-weight: 700; font-size: 18px; line-height: 1; }
#cw-popup .close:hover { opacity: 1; }

/* Click-away overlay */
#contact-widget .cw-overlay { position: fixed; inset: 0; background: transparent; pointer-events: none; }
#contact-widget.open .cw-overlay { pointer-events: auto; }

/* Device visibility */
@media (max-width: 768px) { .cw-dev-desktop { display: none !important; } #cw-popup { max-width: calc(100vw - 2 * var(--cw-x)); } }
@media (min-width: 769px) { .cw-dev-mobile  { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  #contact-widget *, #cw-popup { animation: none !important; transition-duration: .01s !important; }
}

/* Shortcode buttons: [fcw_button channel="whatsapp"] */
.fcw-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; color: #fff !important; text-decoration: none !important; font-weight: 600; line-height: 1.2; background: #444; }
.fcw-btn img { width: 22px; height: 22px; display: block; }
.fcw-btn:hover { filter: brightness(1.08); }
.fcw-btn-whatsapp { background: #25D366; } .fcw-btn-messenger { background: #0084ff; } .fcw-btn-facebook { background: #1877F2; }
.fcw-btn-telegram { background: #29A9EB; } .fcw-btn-instagram { background: linear-gradient(45deg,#f09433,#d62976,#962fbf,#4f5bd5); }
.fcw-btn-call { background: #22c55e; } .fcw-btn-sms { background: #8b5cf6; } .fcw-btn-email { background: #ef4444; }
