.amj-whatsapp-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.amj-whatsapp-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(145deg, #34d859, #1faa3f);
    color: #fff;
    padding: 0.9rem 1.4rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(31, 170, 63, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.amj-whatsapp-badge:focus {
    outline: 2px solid rgba(52, 216, 89, 0.5);
    outline-offset: 4px;
}

.amj-whatsapp-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(31, 170, 63, 0.3);
}

.amj-whatsapp-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    color: #fff;
}

.amj-whatsapp-icon svg {
    width: 100%;
    height: 100%;
}

.amj-whatsapp-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.amj-whatsapp-indicator {
    width: 8px;
    height: 8px;
    background: #ff4d4f;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 77, 79, 0.2);
}

.amj-whatsapp-popup {
    position: absolute;
    right: 0;
    bottom: calc(100% + 1rem);
    width: min(320px, calc(100vw - 3rem));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(22, 35, 44, 0.22);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.amj-whatsapp-widget.is-open .amj-whatsapp-popup {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.amj-whatsapp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(145deg, var(--amj-header-color, #3ad46b), var(--amj-header-color-dark, #1faa3f));
    color: #fff;
}

.amj-whatsapp-close {
    background: transparent;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.amj-whatsapp-close svg {
    display: block;
}

.amj-whatsapp-agent {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.amj-whatsapp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.amj-whatsapp-agent-name {
    margin: 0;
    font-weight: 600;
}

.amj-whatsapp-agent-title {
    margin: 0;
    opacity: 0.85;
    font-size: 0.85rem;
}

.amj-whatsapp-body {
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"%3E%3Cdefs%3E%3Cpattern id="p" width="40" height="40" patternUnits="userSpaceOnUse"%3E%3Cpath d="M35.3 19c.4.4.4 1 0 1.4a1 1 0 01-1.4 0l-1.6-1.6-1.6 1.6a1 1 0 01-1.4-1.4l1.6-1.6-1.6-1.6a1 1 0 011.4-1.4l1.6 1.6 1.6-1.6a1 1 0 111.4 1.4l-1.6 1.6 1.6 1.6z" fill="%23d7f5e5" fill-opacity=".6"/%3E%3C/pattern%3E%3C/defs%3E%3Crect width="200" height="200" fill="%23f4fbf7"/%3E%3Crect width="200" height="200" fill="url(%23p)"/%3E%3C/svg%3E') repeat;
    padding: 1.25rem;
}

.amj-whatsapp-message {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0efe4;
    padding: 0.9rem 1rem;
    box-shadow: 0 8px 18px rgba(31, 170, 63, 0.08);
}

.amj-whatsapp-message p {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #17472d;
}

.amj-whatsapp-message time {
    font-size: 0.75rem;
    color: #799b86;
}

.amj-whatsapp-footer {
    padding: 1rem;
    background: #f4fbf7;
    border-top: 1px solid #dff0e6;
}

.amj-whatsapp-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--amj-button-color, #34d859), var(--amj-button-color-dark, #1faa3f));
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 24px var(--amj-button-shadow, rgba(31, 170, 63, 0.25));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.amj-whatsapp-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px var(--amj-button-shadow-hover, rgba(31, 170, 63, 0.3));
}

.amj-whatsapp-label {
    flex: 1;
    text-align: center;
    font-weight: inherit;
}

.amj-whatsapp-start-icon {
    display: inline-flex;
    color: #fff;
    margin-left: auto;
}

.amj-whatsapp-start-icon svg {
    display: block;
}

.amj-whatsapp-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.45);
    animation: amj-whatsapp-ripple 0.6s ease-out;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes amj-whatsapp-ripple {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

.amj-whatsapp-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    pointer-events: none;
    animation: amj-whatsapp-pulse 2.5s ease-out infinite;
}

@keyframes amj-whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 216, 89, 0.45);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 16px rgba(52, 216, 89, 0);
        opacity: 0;
    }
    100% {
        box-shadow: 0 0 0 16px rgba(52, 216, 89, 0);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .amj-whatsapp-widget {
        right: 1rem;
        bottom: 1rem;
    }

    .amj-whatsapp-badge {
        padding: 0.75rem 1.1rem;
    }

    .amj-whatsapp-text {
        font-size: 0.9rem;
    }
}
