/**
 * Pentonium Guards — floating mobile call button
 * Visible only below 768px (phones). Desktop/tablet: hidden.
 * Fixed bottom-right; does not affect document flow.
 */

.fab-call {
  --fab-call-size: 3.5rem;
  --fab-call-ink: #0b1220;

  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1060;
  width: var(--fab-call-size);
  height: var(--fab-call-size);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none !important;
  color: var(--fab-call-ink) !important;
  background: linear-gradient(165deg, #f3df7a 0%, #e8c547 42%, #c9a227 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.38) inset,
    0 10px 28px rgba(2, 6, 23, 0.42),
    0 0 0 1px rgba(11, 18, 32, 0.35);
  font-size: 1.32rem;
  line-height: 1;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.fab-call__icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Decorative pulse (not focus ring) */
.fab-call__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(232, 197, 71, 0.55);
  z-index: 0;
  pointer-events: none;
  animation: pentonium-fab-call-pulse 2.35s ease-out infinite;
  opacity: 0.82;
}

.fab-call:hover,
.fab-call:focus-visible {
  color: var(--fab-call-ink) !important;
  transform: scale(1.07);
  filter: brightness(1.03);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 14px 36px rgba(201, 162, 39, 0.48),
    0 0 0 1px rgba(11, 18, 32, 0.28);
}

.fab-call:active {
  transform: scale(0.96);
  transition-duration: 0.1s;
}

.fab-call:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.85);
  outline-offset: 3px;
}

@media (max-width: 767.98px) {
  .fab-call {
    display: flex;
  }

  /* PHP layouts: extra bottom inset so fixed FAB clears footer */
  body.has-mobile-fab {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }

  /* Static Tailwind pages: override utility padding on small screens */
  body.has-floating-call {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@keyframes pentonium-fab-call-pulse {
  0% {
    transform: scale(1);
    opacity: 0.72;
  }
  70% {
    transform: scale(1.32);
    opacity: 0;
  }
  100% {
    transform: scale(1.32);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fab-call__ring {
    animation: none;
    opacity: 0.35;
    transform: scale(1.06);
  }

  .fab-call:hover,
  .fab-call:focus-visible {
    transform: none;
  }

  .fab-call:active {
    transform: none;
  }
}
