/* ==========================================================================
   HS Solutions — WhatsApp Concierge Pro Widget (css/hs-whatsapp-concierge.css)
   Abordagem Proativa, Gatilhos Contextuais, Botões Rápidos e Captura Anti-Fuga
   ========================================================================== */

:root {
    --hs-wac-accent: #25d366;
    --hs-wac-accent-hover: #1ebe5d;
    --hs-wac-header: #075e54;
    --hs-wac-chat-bg: #efeae2;
    --hs-wac-text: #0f172a;
    --hs-wac-muted: #475569;
    --hs-wac-z: 2147483000;
}

body.hs-wac-hide-legacy-float a.floating-whatsapp,
body.hs-wac-hide-legacy-float .floating-whatsapp,
body.hs-wac-hide-legacy-float #hs-floating-whatsapp,
body:has(.hs-wac-root) a.floating-whatsapp,
body:has(.hs-wac-root) .floating-whatsapp,
body:has(.hs-wac-root) #hs-floating-whatsapp,
a.floating-whatsapp.hs-wac-hidden,
#hs-floating-whatsapp.hs-wac-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    bottom: -9999px !important;
    right: -9999px !important;
}

.hs-wac-root {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: var(--hs-wac-z);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.45;
    color: var(--hs-wac-text);
    box-sizing: border-box;
}

.hs-wac-root *,
.hs-wac-root *::before,
.hs-wac-root *::after {
    box-sizing: border-box;
}

.hs-wac-root.hs-wac-pos-left {
    right: auto;
    left: 22px;
}

/* ==========================================================================
   BOTÃO FLUTUANTE PRINCIPAL (LAUNCHER)
   ========================================================================== */
.hs-wac-launcher {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--hs-wac-accent);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.42), 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    outline: none;
    padding: 0;
}

.hs-wac-launcher:hover {
    transform: scale(1.07) translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.55), 0 4px 10px rgba(0, 0, 0, 0.18);
}

.hs-wac-launcher:focus-visible {
    outline: 3px solid #ffffff;
    box-shadow: 0 0 0 5px var(--hs-wac-header);
}

.hs-wac-launcher-icon {
    width: 34px;
    height: 34px;
    fill: #ffffff;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.hs-wac-launcher-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #25d366;
}

/* Anel de pulso sutil */
.hs-wac-launcher::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--hs-wac-accent);
    opacity: 0;
    animation: hsWacPulseRing 2.8s infinite;
    pointer-events: none;
}

@keyframes hsWacPulseRing {
    0% { transform: scale(0.95); opacity: 0.7; }
    70% { transform: scale(1.22); opacity: 0; }
    100% { transform: scale(1.22); opacity: 0; }
}

/* Ponto verde online */
.hs-wac-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #10b981;
    border: 2.5px solid #ffffff;
    z-index: 2;
}

/* Badge vermelho de nova mensagem */
.hs-wac-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
    z-index: 3;
    animation: hsWacBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hs-wac-badge.hs-wac-hidden {
    display: none !important;
}

/* ==========================================================================
   BALÃO DE ABORDAGEM PROATIVA (PROACTIVE CALLOUT BUBBLE)
   ========================================================================== */
.hs-wac-bubble {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    display: none;
    flex-direction: column;
    gap: 10px;
    transform-origin: bottom right;
    animation: hsWacBubbleSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.hs-wac-root.hs-wac-pos-left .hs-wac-bubble {
    right: auto;
    left: 0;
    border-radius: 16px 16px 16px 4px;
    transform-origin: bottom left;
}

.hs-wac-bubble.hs-wac-visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10;
}

@keyframes hsWacBubbleSlide {
    from { opacity: 0; transform: translateY(14px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hs-wac-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hs-wac-bubble-agent {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hs-wac-bubble-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #075e54;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.hs-wac-bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hs-wac-bubble-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hs-wac-verified {
    color: #10b981;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
}

.hs-wac-bubble-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.hs-wac-bubble-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.hs-wac-bubble-body {
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.45;
}

.hs-wac-bubble-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.hs-wac-bubble-chip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.hs-wac-bubble-chip:hover {
    background: #25d366;
    border-color: #25d366;
    color: #ffffff;
}

/* Três pontinhos de "Digitando..." */
.hs-wac-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 12px;
}

.hs-wac-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    animation: hsWacDotBounce 1.3s infinite ease-in-out;
}

.hs-wac-typing span:nth-child(2) { animation-delay: 0.18s; }
.hs-wac-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes hsWacDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ==========================================================================
   JANELA PRINCIPAL DO CONCIERGE (CHAT WINDOW)
   ========================================================================== */
.hs-wac-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 375px;
    max-height: calc(100vh - 110px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24), 0 4px 12px rgba(15, 23, 42, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transform-origin: bottom right;
    animation: hsWacWindowOpen 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.hs-wac-root.hs-wac-pos-left .hs-wac-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.hs-wac-window.hs-wac-open {
    display: flex;
}

@keyframes hsWacWindowOpen {
    from { opacity: 0; transform: translateY(18px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cabeçalho estilo WhatsApp Oficial */
.hs-wac-header {
    background: var(--hs-wac-header);
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hs-wac-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hs-wac-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    position: relative;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.hs-wac-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.hs-wac-header-avatar .hs-wac-online-dot {
    width: 12px;
    height: 12px;
    bottom: 0;
    right: 0;
    border-width: 2px;
}

.hs-wac-header-info {
    min-width: 0;
}

.hs-wac-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-wac-header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.86);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-wac-header-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.hs-wac-header-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* Corpo da conversa */
.hs-wac-body {
    background-color: var(--hs-wac-chat-bg);
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 0);
    background-size: 16px 16px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 410px;
}

/* Bolha de mensagem recebida */
.hs-wac-msg-card {
    background: #ffffff;
    border-radius: 0 14px 14px 14px;
    padding: 12px 14px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    max-width: 92%;
    align-self: flex-start;
    color: #1e293b;
    font-size: 13.8px;
    line-height: 1.5;
}

.hs-wac-msg-author {
    font-size: 11.5px;
    font-weight: 700;
    color: #075e54;
    margin-bottom: 4px;
}

.hs-wac-msg-text p {
    margin: 0 0 6px 0;
}

.hs-wac-msg-text p:last-child {
    margin-bottom: 0;
}

.hs-wac-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.hs-wac-checks {
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
}

/* Card de Oferta / Benefício Destravável */
.hs-wac-offer-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 11px 13px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.1);
}

.hs-wac-offer-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #b45309;
    background: rgba(245, 158, 11, 0.16);
    padding: 2px 7px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.hs-wac-offer-title {
    font-size: 13px;
    font-weight: 700;
    color: #78350f;
    margin: 0 0 3px 0;
}

.hs-wac-offer-desc {
    font-size: 12px;
    color: #92400e;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.hs-wac-offer-btn {
    width: 100%;
    background: #d97706;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.hs-wac-offer-btn:hover {
    background: #b45309;
}

/* Chips de Resposta Rápida (Quick Replies) */
.hs-wac-chips-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    margin: 2px 0 -4px 2px;
}

.hs-wac-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.hs-wac-chip-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    transition: all 0.16s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hs-wac-chip-btn:hover,
.hs-wac-chip-btn.hs-wac-chip-selected {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #14532d;
    transform: translateX(2px);
}

.hs-wac-chip-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-wac-chip-arrow {
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
}

/* Formulário de Captura Anti-Fuga (Modo 2 / Híbrido) */
.hs-wac-capture-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 13px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.hs-wac-capture-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.hs-wac-capture-selected-tag {
    font-size: 11.5px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 9px;
    border-radius: 6px;
    font-weight: 600;
    display: none;
}

.hs-wac-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.hs-wac-input:focus {
    border-color: #16a34a;
    background: #ffffff;
}

.hs-wac-submit-btn {
    width: 100%;
    background: var(--hs-wac-accent);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.32);
    transition: background 0.15s, transform 0.15s;
}

.hs-wac-submit-btn:hover {
    background: var(--hs-wac-accent-hover);
    transform: translateY(-1px);
}

.hs-wac-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.hs-wac-error-msg {
    font-size: 12px;
    color: #dc2626;
    font-weight: 600;
    display: none;
}

/* Rodapé de envio direto (Modo 1 / Híbrido) */
.hs-wac-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-wac-footer-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
}

.hs-wac-footer-input:focus {
    border-color: #16a34a;
}

.hs-wac-footer-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hs-wac-header);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
}

.hs-wac-footer-send:hover {
    background: #054c44;
    transform: scale(1.05);
}

/* Seletor de Setores / Departamentos */
.hs-wac-dept-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hs-wac-dept-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.hs-wac-dept-item:hover {
    border-color: #25d366;
    background: #f0fdf4;
}

.hs-wac-dept-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.hs-wac-dept-role {
    font-size: 11.5px;
    color: #64748b;
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    .hs-wac-root {
        bottom: 16px;
        right: 16px;
    }
    .hs-wac-bubble {
        width: calc(100vw - 36px);
        max-width: 330px;
    }
    .hs-wac-window {
        width: calc(100vw - 24px);
        right: -4px;
        bottom: 72px;
        max-height: calc(100vh - 96px);
    }
}
