/* ============================================================================
   Floating Call Button — orto-toolkit
   Bottom-right speed-dial: toggle → reveals call + book actions stacked above.
   Tokens from ortorodzina theme: --color-accent #ff3a2d, --color-dark #0b1220
   ========================================================================= */

/* ── Keyframes ──────────────────────────────────────────────────────────────── */

@keyframes fcb-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fcb-sink {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
}

@keyframes fcb-pulse {
  0%,
  100% {
    box-shadow:
      0 4px 20px rgba(255, 58, 45, 0.45),
      0 0 0 0 rgba(255, 58, 45, 0.35);
  }
  50% {
    box-shadow:
      0 4px 20px rgba(255, 58, 45, 0.45),
      0 0 0 10px rgba(255, 58, 45, 0);
  }
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */

.fcb-wrap {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9996; /* below reviews sidebar tab (9997) and panel (99990), below video lightbox (99999) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* ── Speed-dial menu ────────────────────────────────────────────────────────── */

.fcb-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  /* Visibility controlled entirely by is-open class — no wrapper transition.
     Item-level animations (fcb-rise / fcb-sink) handle all open/close visuals.
     A wrapper transition would cause a second fade-out after items have
     already animated out, creating a "flicker" effect. */
  opacity: 0;
  transform-origin: bottom right;
}

.fcb-menu.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* ── Item row (label + icon button) ──────────────────────────────────────── */

.fcb-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fcb-rise 0.22s ease both;
}

.fcb-item-row:nth-child(1) {
  animation-delay: 0.12s;
}

.fcb-item-row:nth-child(2) {
  animation-delay: 0.08s;
}

.fcb-item-row:nth-child(3) {
  animation-delay: 0.04s;
}

.fcb-item-row:nth-child(4) {
  animation-delay: 0.02s;
}

/* Only animate when menu is opening */
.fcb-menu:not(.is-open) .fcb-item-row {
  animation: none;
}

/* ── Closing: staggered sink (top → bottom, reverse of open) ─────────────── */

.fcb-menu.is-open.is-closing {
  pointer-events: none;
}

.fcb-menu.is-closing .fcb-item-row {
  animation: fcb-sink 0.18s ease both;
}

.fcb-menu.is-closing .fcb-item-row:nth-child(1) {
  animation-delay: 0.02s;
}

.fcb-menu.is-closing .fcb-item-row:nth-child(2) {
  animation-delay: 0.04s;
}

.fcb-menu.is-closing .fcb-item-row:nth-child(3) {
  animation-delay: 0.08s;
}

.fcb-menu.is-closing .fcb-item-row:nth-child(4) {
  animation-delay: 0.12s;
}

/* ── Label pill ──────────────────────────────────────────────────────────── */

.fcb-item__label {
  background: #0b1220;
  color: #ffffff;
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(11, 18, 32, 0.28);
  pointer-events: none;
  user-select: none;
}

/* ── Action icon button ─────────────────────────────────────────────────── */

.fcb-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.fcb-item:hover,
.fcb-item:focus-visible {
  transform: scale(1.1);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* Call button — accent red */
.fcb-item--call {
  background: #ff3a2d;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 58, 45, 0.4);
}

.fcb-item--call:hover,
.fcb-item--call:focus-visible {
  background: #e52d22;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 58, 45, 0.55);
}

/* Book button — dark navy */
.fcb-item--book {
  background: #0b1220;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(11, 18, 32, 0.35);
}

.fcb-item--book:hover,
.fcb-item--book:focus-visible {
  background: #111827;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(11, 18, 32, 0.5);
}

/* Email button — teal/green */
.fcb-item--email {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
}

.fcb-item--email:hover,
.fcb-item--email:focus-visible {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.55);
}

/* Messenger button — Facebook blue */
.fcb-item--messenger {
  background: #0084ff;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
}

.fcb-item--messenger:hover,
.fcb-item--messenger:focus-visible {
  background: #006fd6;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 132, 255, 0.55);
}

/* ── Main toggle button ─────────────────────────────────────────────────── */

.fcb-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #ff3a2d;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 58, 45, 0.45);
  animation: fcb-pulse 2.8s ease-in-out infinite;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.fcb-toggle:hover,
.fcb-toggle:focus-visible {
  background: #e52d22;
  transform: scale(1.07);
  animation: none;
  box-shadow: 0 6px 24px rgba(255, 58, 45, 0.6);
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.fcb-toggle.is-open {
  animation: none;
  background: #111827;
  box-shadow: 0 4px 20px rgba(11, 18, 32, 0.4);
}

.fcb-toggle.is-open:hover {
  background: #1f2937;
}

/* ── Toggle icons ────────────────────────────────────────────────────────── */

.fcb-toggle__icon {
  position: absolute;
  transition:
    opacity 0.18s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Phone icon: visible by default */
.fcb-toggle__icon--phone {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.fcb-toggle.is-open .fcb-toggle__icon--phone {
  opacity: 0;
  transform: scale(0.7) rotate(-45deg);
}

/* Close icon: hidden by default */
.fcb-toggle__icon--close {
  opacity: 0;
  transform: scale(0.7) rotate(45deg);
}

.fcb-toggle.is-open .fcb-toggle__icon--close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ── Mobile (≤ 480px) ────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .fcb-wrap {
    bottom: 16px;
    right: 14px;
  }

  .fcb-toggle {
    width: 52px;
    height: 52px;
  }

  .fcb-item {
    width: 44px;
    height: 44px;
  }

  .fcb-item__label {
    font-size: 12px;
    padding: 6px 10px;
  }
}
