.wa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    display: inline-flex;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
}

.wa-box {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s ease;
    pointer-events: none;
}

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

.wa-box-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    padding: 18px 18px 16px;
    position: relative;
}

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

.wa-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-avatar svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.wa-header-text h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.wa-header-text p {
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
}

.wa-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: 0.25s ease;
}

.wa-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg);
}

.wa-box-body {
    padding: 18px;
    background: #f7faf9;
}

.wa-message {
    background: #fff;
    border-radius: 14px 14px 14px 4px;
    padding: 14px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.wa-message-time {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.wa-box-footer {
    padding: 0 18px 18px;
    background: #f7faf9;
}

.wa-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.28);
    transition: 0.25s ease;
}

.wa-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(37, 211, 102, 0.34);
    color: #fff;
}

.wa-start-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.wa-float-btn {
    position: relative;
    width: 66px;
    height: 66px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 35px rgba(18, 140, 126, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: visible;
    pointer-events: auto;
}

.wa-float-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 20px 40px rgba(18, 140, 126, 0.42);
}

.wa-float-btn svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    animation: waIconFloat 1.8s ease-in-out infinite;
}

.wa-float-btn::before,
.wa-float-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.35);
    animation: waPulse 2.4s infinite;
}

.wa-float-btn::after {
    animation-delay: 1.2s;
}

.wa-badge {
    position: absolute;
    right: 74px;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    opacity: 1;
    transition: 0.25s ease;
}

.wa-badge::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #1f2937;
}

.wa-widget.active .wa-badge {
    opacity: 0;
    transform: translateY(-50%) translateX(8px);
    pointer-events: none;
}

@keyframes waPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.55);
        opacity: 0;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

@keyframes waIconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@media (max-width: 768px) {
    .wa-widget {
        right: 16px;
        bottom: 16px;
    }

    .wa-float-btn {
        width: 60px;
        height: 60px;
    }

    .wa-float-btn svg {
        width: 28px;
        height: 28px;
    }

    .wa-badge {
        display: none;
    }

    .wa-box {
        width: 300px;
    }
}
