:root {
    --wa-green: #25d366;
    --wa-green-dark: #128c7e;
    --wa-shadow: rgba(37, 211, 102, 0.35);
    --brand-gold: #e3b344;
    --brand-dark: #1E1E2F;
}

.wa-floating-container {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Tooltip balão flutuante */
.wa-floating-tooltip {
    max-width: 260px;
    padding: 12px 18px;
    border: 1px solid rgba(227, 179, 68, 0.3);
    border-left: 3px solid var(--brand-gold);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity .3s cubic-bezier(0.16, 1, 0.3, 1), transform .3s cubic-bezier(0.16, 1, 0.3, 1), visibility .3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.wa-floating-container.active .wa-floating-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Botão Redondo Disparador */
.wa-floating-button {
    position: relative;
    display: flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 50%;
    background: var(--wa-green);
    box-shadow: 0 8px 24px var(--wa-shadow);
    color: #ffffff;
    pointer-events: auto;
    transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), background-color .2s ease, box-shadow .2s ease;
}

.wa-floating-button:hover {
    background: var(--wa-green-dark);
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(18, 140, 126, 0.45);
}

.wa-floating-button svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.wa-floating-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    background: #22c55e;
    animation: waPulse 2s infinite;
}

@keyframes waPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   MINI CHAT BOX (MODAL FLUTUANTE)
   ========================================================================== */
.wa-chat-box {
    position: relative;
    width: 350px;
    max-width: calc(100vw - 36px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: all .28s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    margin-bottom: 4px;
}

.wa-chat-box.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header do Chat (Identidade Visual Ana Claudia Basso) */
.wa-chat-header {
    background: linear-gradient(135deg, #1E1E2F 0%, #151522 100%);
    border-bottom: 2px solid var(--brand-gold);
    color: #ffffff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wa-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-chat-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: 2px solid var(--brand-gold);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.wa-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.wa-chat-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #1E1E2F;
}

.wa-chat-header-text strong {
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
    line-height: 1.25;
    letter-spacing: 0.2px;
}

.wa-chat-header-text span {
    font-size: 0.73rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}

.wa-chat-header-text span i {
    color: #22c55e;
    font-size: 0.75rem;
}

.wa-chat-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color .15s ease;
}

.wa-chat-close:hover {
    color: #ffffff;
}

/* Corpo do Chat */
.wa-chat-body {
    padding: 16px;
    background: #f8fafc;
}

.wa-chat-msg {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-top-left-radius: 2px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.wa-chat-msg p {
    font-size: 0.85rem;
    color: #334155;
    margin: 0;
    line-height: 1.45;
}

/* Card de Imóvel no Chat */
.wa-chat-property-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wa-chat-property-thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: #f1f5f9;
}

.wa-chat-property-thumb-placeholder {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 8px;
    background: #fefce8;
    color: #ca8a04;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.wa-chat-property-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wa-chat-property-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--brand-gold);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wa-chat-property-details strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.wa-chat-property-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #16a34a;
    line-height: 1.2;
}

.wa-chat-property-loc {
    font-size: 0.7rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Formulário */
.wa-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wa-form-field label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wa-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wa-input-wrap i {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.wa-input-wrap input {
    width: 100%;
    height: 40px;
    padding: 0 10px 0 32px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.wa-input-wrap input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(227, 179, 68, 0.2);
}

/* Botão Submit */
.wa-chat-submit {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
    margin-top: 4px;
    transition: all .16s ease;
}

.wa-chat-submit:hover {
    background: linear-gradient(135deg, #1eb956 0%, #159344 100%);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
    transform: translateY(-1px);
}

.wa-chat-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wa-btn-loading i {
    animation: waSpin 0.8s linear infinite;
}

@keyframes waSpin {
    100% { transform: rotate(360deg); }
}

.wa-chat-privacy {
    font-size: 0.68rem;
    color: #94a3b8;
    text-align: center;
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

@media (max-width: 480px) {
    .wa-floating-container {
        right: 16px;
        bottom: 16px;
    }
    .wa-chat-box {
        width: calc(100vw - 32px);
    }
}
