/* ==========================================
   WHATSAPP FLOAT BUTTON
   ========================================== */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    cursor: pointer;
    animation: slideIn 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
}

.whatsapp-float img {
    width: 100%;
    height: auto;
    display: block;
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background: #25d366;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-tooltip.show-on-load {
    opacity: 1;
    transform: translateX(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   WHATSAPP POPUP CHAT
   ========================================== */
.whatsapp-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Header */
.whatsapp-popup-header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-popup-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.whatsapp-popup-avatar img {
    width: 70%;
    height: auto;
}

.whatsapp-popup-info {
    flex: 1;
}

.whatsapp-popup-info h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.whatsapp-popup-info span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.whatsapp-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.whatsapp-popup-close:hover {
    opacity: 1;
}

/* Body */
.whatsapp-popup-body {
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d4ccc4' fill-opacity='0.3'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2l-2 2V0zm0 4l4-4h2l-6 6V4zm0 4l8-8h2L40 10V8zm0 4L52 0h2L40 14v-2zm0 4L56 0h2L40 18v-2zm0 4L60 0h2L40 22v-2zm0 4L64 0h2L40 26v-2zm0 4L68 0h2L40 30v-2zm0 4L72 0h2L40 34v-2zm0 4L76 0h2L40 38v-2zm0 4L80 0v2L42 40h-2zm4 0L80 4v2L46 40h-2zm4 0L80 8v2L50 40h-2zm4 0l28-28v2L54 40h-2zm4 0l24-24v2L58 40h-2zm4 0l20-20v2L62 40h-2zm4 0l16-16v2L66 40h-2zm4 0l12-12v2L70 40h-2zm4 0l8-8v2l-6 6h-2zm4 0l4-4v2l-2 2h-2z'/%3E%3C/g%3E%3C/svg%3E");
    padding: 20px;
    max-height: 380px;
    overflow-y: auto;
}

/* Messages */
.whatsapp-message {
    max-width: 85%;
    margin-bottom: 10px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-message.bot {
    margin-right: auto;
}

.whatsapp-message.user {
    margin-left: auto;
}

.whatsapp-message p {
    background: white;
    color: #0a0a0a;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.whatsapp-message.bot p {
    border-radius: 0 8px 8px 8px;
}

.whatsapp-message.user p {
    background: #dcf8c6;
    color: #0a0a0a;
    border-radius: 8px 0 8px 8px;
}

/* Steps */
.whatsapp-step {
    display: none;
    margin-top: 15px;
}

.whatsapp-step.active {
    display: block;
}

/* Input */
.whatsapp-input-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.whatsapp-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    color: #0a0a0a;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.whatsapp-input::placeholder {
    color: #5b5a54;
}

.whatsapp-input:focus {
    box-shadow: 0 1px 6px rgba(37, 211, 102, 0.3);
}

.whatsapp-phone-hint {
    display: block;
    margin-top: 4px;
    color: #5b5a54;
}

.whatsapp-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    color: #0a0a0a;
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
}

.whatsapp-consent input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: #128c7e;
}

.whatsapp-form-status {
    margin: 12px 0 0;
    padding: 10px 12px;
    color: #0a0a0a;
    background: #fff;
    border-left: 3px solid #128c7e;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.whatsapp-form-status.is-error {
    border-left-color: #b42318;
}

.whatsapp-form-status[hidden],
.whatsapp-redirect-btn[hidden] {
    display: none !important;
}

.whatsapp-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.whatsapp-send {
    width: 45px;
    height: 45px;
    background: #25d366;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.whatsapp-send:hover {
    background: #128c7e;
}

.whatsapp-send:focus-visible,
.whatsapp-popup-close:focus-visible,
.whatsapp-redirect-btn:focus-visible,
.whatsapp-consent input:focus-visible {
    outline: 3px solid #612cb5;
    outline-offset: 3px;
}

.whatsapp-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Botão de redirecionamento WhatsApp */
.whatsapp-redirect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: white;
    padding: 14px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-redirect-btn:hover {
    background: #128c7e;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-redirect-btn svg {
    flex-shrink: 0;
}

/* Responsivo */
@media screen and (max-width: 480px) {
    .whatsapp-popup {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 140px;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 75px;
        right: 1rem;
    }
}

@media screen and (max-width: 1024px) and (min-width: 481px) {
    .whatsapp-float {
        bottom: 85px;
    }

    .whatsapp-popup {
        bottom: 165px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-popup,
    .whatsapp-float,
    .whatsapp-message,
    .whatsapp-tooltip,
    .whatsapp-redirect-btn {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
