:root {
    --wa-green: #25d366;
    --wa-dark: #075e54;
    --wa-bg: #e5ddd5; /* fundo típico do chat */
    --wa-msg-in: #ffffff; /* bolha recebida */
    --wa-msg-out: #dcf8c6; /* bolha enviada */
    --wa-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 8px 10px rgba(0, 0, 0, 0.12);
}

.wa-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
}

/* Botão flutuante */
.wa-float__btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--wa-green);
    color: #fff;
    box-shadow: var(--wa-shadow);
    cursor: pointer;
    border: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    animation: wa-pulse 2.2s infinite;
}
.wa-float__btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}
.wa-float__btn:active {
    transform: translateY(0);
}
@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    }
    70% {
        box-shadow: 0 0 0 22px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Popup */
.wa-popup {
    position: absolute;
    right: 0;
    bottom: 80px; /* acima do botão */
    width: clamp(280px, 88vw, 360px);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--wa-shadow);
    transform-origin: 90% 100%;
    transform: scale(0.86);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.wa-popup.is-open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Cabeçalho estilo WhatsApp */
.wa-popup__head {
    background: linear-gradient(180deg, var(--wa-dark), #066c61);
    color: #fff;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 36px 1fr 28px;
    gap: 10px;
    align-items: center;
}
.wa-popup__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff2;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff29;
}
.wa-popup__title {
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1.2;
}
.wa-popup__subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}
.wa-popup__close {
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
}

/* Corpo tipo chat */
.wa-popup__body {
    background: var(--wa-bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300" opacity="0.08"><rect rx="8" width="38" height="18" x="30" y="40" fill="%23fff"/><rect rx="8" width="58" height="18" x="100" y="120" fill="%23fff"/><rect rx="8" width="48" height="18" x="200" y="210" fill="%23fff"/></svg>') repeat;
    padding: 14px 12px 12px;
    min-height: 150px;
}
.wa-msg {
    max-width: 82%;
    font-size: 14px;
    line-height: 1.35;
    padding: 9px 10px;
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    position: relative;
    margin: 6px 0;
}
.wa-msg.in {
    background: var(--wa-msg-in);
    border-top-left-radius: 2px;
}
.wa-msg.out {
    background: var(--wa-msg-out);
    border-top-right-radius: 2px;
    margin-left: auto;
}
.wa-msg small {
    opacity: 0.6;
    font-size: 11px;
    display: block;
    margin-top: 6px;
}

/* Rodapé com CTAs */
.wa-popup__foot {
    background: #f7f7f7;
    padding: 12px;
    display: grid;
    gap: 8px;
    border-top: 1px solid #eee;
}
.wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.wa-btn:hover {
    transform: translateY(-1px);
    color: #fff;
}
.wa-btn--primary {
    background: var(--wa-green);
    color: #fff;
}
.wa-btn--danger {
    background: #ff4757;
    color: #fff;
}

/* Tweak mobile seguro */
@media (max-width: 420px) {
    .wa-popup {
        width: min(94vw, 360px);
        right: -4px;
    }
}