﻿/* Reusable floating chat widget (FixMove style) */

.floating-cta {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1001;
  transition: opacity .2s ease, transform .2s ease;
}

.floating-cta.is-hidden,
.floating-cta.is-scrolling {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
}

.floating-cta .fab-stack {
  position: relative;
  width: 56px;
  height: 56px;
}

.floating-cta .fab-actions {
  display: none;
  position: absolute;
  right: 0;
  top: 66px;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-cta.open .fab-actions {
  display: flex;
}

.floating-cta.is-dragging {
  transition: none;
}

.fab-action,
.fab-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(2, 6, 23, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  overflow: hidden;
}

.fab-action {
  color: #fff;
}

.fab-action.fab-call {
  background: var(--fm-fab-call, var(--primary, #0f172a));
}

.fab-action.fab-wa {
  background: var(--fm-fab-wa, var(--wa, #22c55e));
}

.fab-action svg {
  width: 22px;
  height: 22px;
  display: block;
}

.fab-action.fab-call svg {
  transform: translateY(1px);
}

@keyframes fm-fab-border-flow {
  to {
    transform: rotate(360deg);
  }
}

.fab-toggle {
  background: linear-gradient(165deg, #c4b5fd 0%, #a78bfa 50%, #8b5cf6 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  touch-action: none;
  position: relative;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.35);
}

.fab-toggle::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ddd6fe, #c4b5fd, #a78bfa, #8b5cf6, #c4b5fd, #ddd6fe);
  animation: fm-fab-border-flow 2.5s linear infinite;
  z-index: -1;
}

.fab-toggle::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: linear-gradient(165deg, #c4b5fd 0%, #a78bfa 50%, #7c3aed 100%);
  z-index: 0;
}

.fab-toggle .fab-chat,
.fab-toggle .fab-mood {
  z-index: 1;
}

.fab-toggle:focus,
.fab-toggle:focus-visible,
.fab-action:focus,
.fab-action:focus-visible {
  outline: none;
}

.fab-toggle::-moz-focus-inner {
  border: 0;
}

.fab-toggle:active,
.fab-action:active {
  transform: scale(0.98);
}

.floating-cta.open .fab-toggle::after {
  background: linear-gradient(165deg, #f5b041 0%, #f97316 100%);
}

.floating-cta.open .fab-toggle::before {
  background: conic-gradient(from 0deg, #fde68a, #fbbf24, #f97316, #ea580c, #fbbf24, #fde68a);
}

.floating-cta.open .fab-toggle {
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.4);
}

.fab-chat,
.fab-mood {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
  transition: opacity .2s ease, transform .22s ease;
  pointer-events: none;
}

.fab-chat {
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 1;
}

.fab-chat::after,
.fab-mood::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  border-radius: 0 0 2px 0;
}

.fab-chat::after {
  background: rgba(255, 255, 255, 0.2);
}

.fab-mood {
  background: rgba(255, 255, 255, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.fab-mood::after {
  background: rgba(255, 255, 255, 0.24);
}

.fab-face {
  position: relative;
  width: 18px;
  height: 10px;
}

.fab-eye {
  position: absolute;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  transform-origin: center;
}

.fab-eye.left {
  left: 2px;
}

.fab-eye.right {
  right: 2px;
}

.fab-smile {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 10px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid #fff;
  border-radius: 0 0 10px 10px;
}

.fab-blush {
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 210, 220, 0.85);
}

.fab-blush.left {
  left: -1px;
}

.fab-blush.right {
  right: -1px;
}

.floating-cta.mood-1 .fab-eye.right {
  width: 6px;
  height: 2px;
  top: 1px;
  border-radius: 2px;
}

.floating-cta.is-tease.mood-1 .fab-eye.right {
  animation: fm-fab-wink 2s ease-in-out 1;
}

.floating-cta.mood-2 .fab-eye {
  width: 4px;
  height: 4px;
}

.floating-cta.mood-2 .fab-smile {
  width: 12px;
  height: 6px;
  border-bottom-width: 2px;
}

.floating-cta.mood-3 .fab-eye {
  width: 3px;
  height: 3px;
  top: 1px;
}

.floating-cta.mood-3 .fab-smile {
  width: 9px;
  height: 4px;
}

.floating-cta.mood-3 .fab-blush {
  width: 4px;
  opacity: 1;
  background: rgba(255, 190, 210, 0.95);
}

.floating-cta.mood-4 .fab-eye {
  width: 5px;
  height: 5px;
  top: -1px;
}

.floating-cta.mood-4 .fab-smile {
  width: 6px;
  height: 6px;
  bottom: -1px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.floating-cta.mood-5 .fab-eye.left {
  width: 6px;
  height: 2px;
  top: 1px;
  border-radius: 2px;
}

.floating-cta.mood-5 .fab-smile {
  width: 10px;
  height: 4px;
  transform: translateX(-50%) rotate(-8deg);
}

.floating-cta.mood-5 .fab-blush {
  opacity: 0.55;
}

.floating-cta.mood-6 .fab-eye {
  width: 5px;
  height: 2px;
  top: 1px;
  border-radius: 2px;
}

.floating-cta.mood-6 .fab-smile {
  width: 12px;
  height: 4px;
  transform: translateX(-50%) rotate(6deg);
}

.floating-cta.mood-6 .fab-blush.right {
  opacity: 1;
}

.floating-cta.mood-7 .fab-eye {
  width: 5px;
  height: 5px;
  top: -1px;
}

.floating-cta.mood-7 .fab-smile {
  width: 11px;
  height: 6px;
}

.floating-cta.mood-7 .fab-blush {
  opacity: 0.9;
}

.floating-cta.mood-8 .fab-eye.left {
  width: 6px;
  height: 2px;
  top: 1px;
  border-radius: 2px;
}

.floating-cta.mood-8 .fab-smile {
  width: 9px;
  height: 5px;
  transform: translateX(-50%) rotate(8deg);
}

.floating-cta.is-tease.mood-8 .fab-eye.left {
  animation: fm-fab-wink 2s ease-in-out 1;
}

.floating-cta.mood-9 .fab-eye {
  width: 3px;
  height: 3px;
  top: 1px;
}

.floating-cta.mood-9 .fab-smile {
  width: 6px;
  height: 6px;
  bottom: -1px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.floating-cta.mood-9 .fab-blush {
  opacity: 0.7;
}

.floating-cta.mood-10 .fab-eye {
  width: 6px;
  height: 2px;
  top: 1px;
  border-radius: 2px;
}

.floating-cta.mood-10 .fab-smile {
  width: 13px;
  height: 6px;
}

.floating-cta.mood-10 .fab-blush {
  width: 4px;
  opacity: 1;
}

.fab-chat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

.floating-cta.is-tease:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-chat {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.84);
}

.floating-cta.is-tease:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-mood {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.floating-cta:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-toggle {
  animation: fm-fab-breath 2.2s ease-in-out infinite;
}

.floating-cta:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-chat-dot {
  animation: fm-fab-dot-breathe 1.2s ease-in-out infinite;
}

.floating-cta:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-chat-dot:nth-child(2) {
  animation-delay: .16s;
}

.floating-cta:not(.open):not(.is-hidden):not(.is-scrolling):not(.is-dragging) .fab-chat-dot:nth-child(3) {
  animation-delay: .32s;
}

@keyframes fm-fab-breath {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2), 0 0 0 0 rgba(14, 165, 233, 0.35);
  }

  50% {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24), 0 0 0 8px rgba(14, 165, 233, 0);
  }
}

@keyframes fm-fab-dot-breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@keyframes fm-fab-wink {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 1;
  }

  22%,
  30% {
    transform: scaleX(0.2);
    opacity: 0.9;
  }

  60%,
  68% {
    transform: scaleX(0.25);
    opacity: 0.92;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .floating-cta {
    display: block;
    right: 16px;
    top: calc(var(--fm-fab-top-offset, 72px) + env(safe-area-inset-top));
    bottom: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-cta .fab-toggle,
  .floating-cta .fab-chat-dot,
  .floating-cta.is-tease .fab-eye {
    animation: none !important;
  }
}
