/**
 * Floating WhatsApp widget — public front-end
 */

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.whatsapp-float__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.whatsapp-float__toggle:hover,
.whatsapp-float__toggle:focus-visible {
    background: #20bd5a;
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.55);
    color: #fff;
    outline: none;
}

.whatsapp-float__toggle:focus-visible {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #25d366;
}

.whatsapp-float.is-open .whatsapp-float__toggle {
    background: #128c7e;
}

.whatsapp-float__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(320px, calc(100vw - 48px));
    padding: 1.25rem 1.25rem 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.whatsapp-float__panel.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.whatsapp-float__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6c757d;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.whatsapp-float__close:hover,
.whatsapp-float__close:focus-visible {
    background: #f1f3f5;
    color: #212529;
    outline: none;
}

.whatsapp-float__text {
    margin: 0 1.5rem 1rem 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #212529;
}

.whatsapp-float__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    background: #25d366;
    color: #fff !important;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.whatsapp-float__cta:hover,
.whatsapp-float__cta:focus-visible {
    background: #20bd5a;
    color: #fff !important;
    outline: none;
}

.whatsapp-float__phone {
    text-align: center;
}

@media (max-width: 576px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-float__toggle {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }
}

/* Lift above cookie banner when it is visible */
body.cookie-banner-visible .whatsapp-float {
    bottom: 140px;
}

@media (max-width: 768px) {
    body.cookie-banner-visible .whatsapp-float {
        bottom: 200px;
    }
}
