/* ============================================================ */
/* CONTACT FAB — Botón flotante de contacto para desktop       */
/* ProSilicones64 - Estilo email composer                      */
/* ============================================================ */

/* Solo visible en desktop (768px+) */
.contact-fab {
  display: none;
}

@media (min-width: 769px) {
  .contact-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1200;
    display: block;
    transition: bottom 0.3s ease;
  }

  /* Botón flotante redondo */
  .contact-fab__btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #002244 0%, #003366 100%);
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 4px 16px rgba(0, 34, 68, 0.35),
      0 0 0 0 rgba(59, 170, 254, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .contact-fab__btn:hover {
    transform: scale(1.08);
    box-shadow:
      0 6px 24px rgba(0, 34, 68, 0.45),
      0 0 0 0 rgba(59, 170, 254, 0.4);
  }

  .contact-fab__btn:active {
    transform: scale(0.96);
  }

  /* Icono del botón */
  .contact-fab__icon {
    font-size: 1.4rem;
    color: #fff;
    transition: transform 0.3s ease;
    z-index: 2;
  }

  .contact-fab__btn:hover .contact-fab__icon {
    transform: rotate(-12deg) scale(1.05);
  }

  /* Efecto heartbeat/pulse sutil */
  .contact-fab__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(59, 170, 254, 0.35);
    animation: contactFabPulse 2.5s ease-out infinite;
    pointer-events: none;
  }

  @keyframes contactFabPulse {
    0% {
      transform: scale(1);
      opacity: 0.5;
    }
    50% {
      transform: scale(1.4);
      opacity: 0.2;
    }
    100% {
      transform: scale(1.8);
      opacity: 0;
    }
  }

  /* Tooltip al hover */
  .contact-fab__tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: #002244;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 34, 68, 0.25);
  }

  /* Flecha del tooltip */
  .contact-fab__tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #002244;
  }

  .contact-fab__btn:hover + .contact-fab__tooltip,
  .contact-fab__btn:focus + .contact-fab__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  /* Ocultar cuando el modal está abierto */
  body:has(.contact-modal-overlay.active) .contact-fab {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
  }
}

/* En pantallas muy grandes, más separación del borde */
@media (min-width: 1600px) {
  .contact-fab {
    bottom: 2.5rem;
    right: 2.5rem;
  }

  .contact-fab__btn {
    width: 60px;
    height: 60px;
  }

  .contact-fab__icon {
    font-size: 1.5rem;
  }
}
