/* Spain Tax Experts — Asistente Fiscal Floating Action Button
   Persistent across the entire site. Links to /asistente/ (ES) or
   /en/assistant/ (EN) depending on the document language. */

.asistente-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border: 1px solid #60a5fa;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  color: #ffffff;
  text-decoration: none;
  z-index: 9999;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: asistente-fab-in 0.5s ease-out 0.4s both;
}

.asistente-fab:hover,
.asistente-fab:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6);
}

.asistente-fab:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}

.asistente-fab .asistente-fab-label {
  position: absolute;
  right: 76px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #101828;
  color: #e7edf5;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #1f2a45;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.asistente-fab:hover .asistente-fab-label,
.asistente-fab:focus-visible .asistente-fab-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 600px) {
  .asistente-fab {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
    font-size: 26px;
  }
  .asistente-fab .asistente-fab-label {
    display: none;
  }
}

@keyframes asistente-fab-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .asistente-fab {
    animation: none;
    transition: none;
  }
  .asistente-fab:hover,
  .asistente-fab:focus-visible {
    transform: none;
  }
  .asistente-fab:hover .asistente-fab-label,
  .asistente-fab:focus-visible .asistente-fab-label {
    transform: translateY(-50%);
  }
}

/* Lift the FAB above the WhatsApp floating button when present
   (WhatsApp is at bottom: 18px, 60px tall, so we need ~94px clearance) */
body.has-whatsapp-float .asistente-fab {
  bottom: 96px;
}
@media (max-width: 600px) {
  body.has-whatsapp-float .asistente-fab {
    bottom: 88px;
  }
}

/* Lift the FAB above the cookie banner when visible (script adds the class) */
body.cookie-banner-visible .asistente-fab {
  bottom: 110px;
}
@media (max-width: 600px) {
  body.cookie-banner-visible .asistente-fab {
    bottom: 130px;
  }
}

/* If both WhatsApp and cookie banner are present, stack them all */
body.has-whatsapp-float.cookie-banner-visible .asistente-fab {
  bottom: 180px;
}
@media (max-width: 600px) {
  body.has-whatsapp-float.cookie-banner-visible .asistente-fab {
    bottom: 200px;
  }
}
