/* ============================================================
   WHATSAPP.CSS — Floating Button & Inline CTA
   ============================================================ */

/* ── BOTTONE FLOTTANTE ─────────────────────────────────────── */

.wa-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: var(--z-whatsapp);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.wa-float__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--color-whatsapp);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45);
    color: #fff;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    text-decoration: none;
    flex-shrink: 0;
}

.wa-float__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 32px rgba(37, 211, 102, 0.6);
    color: #fff;
}

.wa-float__btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* Icona WhatsApp */
.wa-float__icon {
    width: 30px;
    height: 30px;
}

/* Pulse animato */
.wa-float__pulse {
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    background: var(--color-whatsapp);
    opacity: 0.35;
    animation: wa-pulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes wa-pulse {
    0%   { transform: scale(1);    opacity: 0.35; }
    60%  { transform: scale(1.55); opacity: 0;    }
    100% { transform: scale(1.55); opacity: 0;    }
}

/* Badge notifica */
.wa-float__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.6875rem;
    font-weight: var(--weight-bold);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badge-bounce 1.5s ease-in-out 2s 3;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

/* Tooltip */
.wa-float__tooltip {
    background: var(--color-bg-dark);
    color: #fff;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base);
    box-shadow: var(--shadow-md);
    order: -1; /* va a sinistra del pulsante */
}

.wa-float__tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 7px solid var(--color-bg-dark);
}

.wa-float__btn:hover ~ .wa-float__tooltip,
.wa-float:hover .wa-float__tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Nasconde tooltip su mobile (troppo affollato) */
@media (max-width: 640px) {
    .wa-float__tooltip { display: none; }
    .wa-float {
        bottom: 1.25rem;
        right: 1.25rem;
    }
    .wa-float__btn {
        width: 54px;
        height: 54px;
    }
}

/* ── INLINE CTA WHATSAPP ───────────────────────────────────── */

.wa-cta-box {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-8) var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-6);
    color: #fff;
}

.wa-cta-box__icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    opacity: 0.9;
}

.wa-cta-box__content { flex: 1; }

.wa-cta-box__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: #fff;
    margin-bottom: var(--space-1);
}

.wa-cta-box__subtitle {
    font-size: var(--text-base);
    color: rgba(255,255,255,0.85);
    margin: 0;
}

.wa-cta-box .btn--ghost {
    flex-shrink: 0;
    border-color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
    .wa-cta-box {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }

    .wa-cta-box .btn {
        width: 100%;
        justify-content: center;
    }
}
