.chat-widget-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    gap: 15px;
}

/* Directions */
.chat-widget-container.cw-dir-vertical {
    flex-direction: column;
}

.chat-widget-container.cw-dir-horizontal {
    flex-direction: row;
}

/* Positioning & Alignment */
.chat-widget-container.cw-bottom-right {
    align-items: flex-end;
}

.chat-widget-container.cw-bottom-right .cw-options {
    align-items: flex-end;
}

.chat-widget-container.cw-bottom-right .cw-btn {
    flex-direction: row-reverse;
}

.chat-widget-container.cw-bottom-right .cw-btn-text {
    padding-left: 20px;
    padding-right: 0;
    transform: translateX(10px);
}

.chat-widget-container.cw-bottom-left {
    align-items: flex-start;
}

.chat-widget-container.cw-bottom-left .cw-options {
    align-items: flex-start;
}

.chat-widget-container.cw-bottom-left .cw-btn {
    flex-direction: row;
}

.chat-widget-container.cw-bottom-left.cw-dir-horizontal {
    flex-direction: row-reverse;
}

/* Options Container */
.cw-options {
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cw-dir-vertical .cw-options {
    flex-direction: column;
    transform: translateY(20px) scale(0.9);
    transform-origin: bottom center;
}

.cw-dir-horizontal .cw-options {
    flex-direction: row;
    transform: translateX(20px) scale(0.9);
    transform-origin: center right;
}

.cw-bottom-left.cw-dir-horizontal .cw-options {
    transform: translateX(-20px) scale(0.9);
    transform-origin: center left;
}

.chat-widget-container.active .cw-options,
.chat-widget-container.cw-always-show .cw-options {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
}

.chat-widget-container.cw-always-show .cw-main-btn {
    display: none !important;
}

.chat-widget-container.cw-always-show .cw-btn {
    animation: cw-always-fadein 0.35s ease-out;
}

@keyframes cw-always-fadein {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.cw-main-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cw-btn {
    height: 60px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: none;
    outline: none;
    max-width: 60px;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.4s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.cw-btn:hover,
.cw-main-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    color: white;
}

.cw-btn:hover {
    max-width: 300px;
}

/* Specific Colors from image */
.cw-messenger {
    background-color: #0084FF;
}

.cw-phone {
    background-color: #00E676;
}

.cw-email {
    background-color: #FF4057;
}

.cw-zalo {
    background-color: #0068FF;
}

.cw-main-btn {
    background-color: #9C3B27;
}

/* Icons */
.cw-btn i,
.cw-btn .cw-svg-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-btn-text {
    font-size: 15px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding-right: 20px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transition-delay: 0.05s;
}

.cw-btn:hover .cw-btn-text {
    opacity: 1;
    transform: translateX(0);
}

.cw-main-btn i {
    font-size: 24px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
}

/* Icon Toggle Animation */
.cw-icon-chat {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.cw-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.chat-widget-container.active .cw-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chat-widget-container.active .cw-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ===================================================
   MAIN BUTTON ANIMATIONS (Hiệu ứng cho cw-main-btn)
   =================================================== */

/* 1. Sóng lan tỏa (Ripple / Radar Pulse) */
.cw-main-btn.cw-anim-ripple {
    position: relative;
}

.cw-main-btn.cw-anim-ripple::before,
.cw-main-btn.cw-anim-ripple::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: inherit;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
    animation: cw-ripple-anim 2.2s cubic-bezier(0.1, 0.45, 0.3, 1) infinite;
}

.cw-main-btn.cw-anim-ripple::after {
    animation-delay: 0.9s;
}

@keyframes cw-ripple-anim {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }

    100% {
        transform: scale(1.75);
        opacity: 0;
    }
}

/* 2. Rung chuông lắc lư (Wobble / Bell Shake) */
.cw-main-btn.cw-anim-wobble {
    animation: cw-wobble-anim 2.8s infinite ease-in-out;
}

@keyframes cw-wobble-anim {

    0%,
    65%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    68% {
        transform: scale(1.1) rotate(-16deg);
    }

    71% {
        transform: scale(1.1) rotate(16deg);
    }

    74% {
        transform: scale(1.1) rotate(-12deg);
    }

    77% {
        transform: scale(1.1) rotate(12deg);
    }

    80% {
        transform: scale(1.05) rotate(-6deg);
    }

    83% {
        transform: scale(1.05) rotate(6deg);
    }

    86% {
        transform: scale(1) rotate(0deg);
    }
}

/* 3. Nhịp đập phập phồng (Pulse) */
.cw-main-btn.cw-anim-pulse {
    animation: cw-pulse-anim 1.8s infinite ease-in-out;
}

@keyframes cw-pulse-anim {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.12);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
}

/* 4. Tỏa sáng hào quang (Glow) */
.cw-main-btn.cw-anim-glow {
    animation: cw-glow-anim 2s infinite alternate ease-in-out;
}

@keyframes cw-glow-anim {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 4px rgba(255, 255, 255, 0.4);
    }

    100% {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 24px 6px rgba(255, 255, 255, 0.7);
    }
}

/* Tạm dừng hiệu ứng khi rê chuột vào hoặc khi widget đang mở */
.cw-main-btn:hover {
    animation-play-state: paused;
}

.chat-widget-container.active .cw-main-btn {
    animation: none !important;
}

.chat-widget-container.active .cw-main-btn::before,
.chat-widget-container.active .cw-main-btn::after {
    display: none !important;
}