/* WhatsApp Button */
.smart-whatsapp-button {
    position: fixed;
    z-index: 9999;
    bottom: 20px;
    transition: all 0.3s ease;
}

.swb-bottom-right {
    right: 20px;
}

.swb-bottom-left {
    left: 20px;
}

.swb-button {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.swb-button:hover {
    transform: scale(1.1);
}

.swb-icon {
    width: 35px;
    height: 35px;
    color: white;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.whatsapp-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Custom Logo Button */
.swb-button-custom {
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    background: transparent;
}

.swb-button-custom:hover {
    transform: scale(1.1);
}

.swb-custom-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.swb-button-custom .close-icon {
    position: absolute;
    width: 35px;
    height: 35px;
    color: white;
    opacity: 0;
    transform: rotate(-180deg);
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 50%;
}

.swb-button-custom.is-active .swb-custom-logo {
    opacity: 0;
}

.swb-button-custom.is-active .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.close-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

.swb-button.is-active .whatsapp-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.swb-button.is-active .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Modal Styles */
.swb-modal {
    display: block;
    position: fixed;
    z-index: 99998;
    width: 300px;
    max-height: 400px;
    visibility: hidden;
    bottom: 100px;
    opacity: 0;
}

.swb-bottom-right .swb-modal {
    right: 20px;
    transform: translateY(50px) scale(0.9);
    transform-origin: bottom right;
}

.swb-bottom-left .swb-modal {
    left: 20px;
    transform: translateY(50px) scale(0.9);
    transform-origin: bottom left;
}

.swb-modal.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease,
                visibility 0.3s ease;
}

.swb-modal-content {
    position: relative;
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease;
}

.swb-modal.active .swb-modal-content {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

/* Template Content */
.swb-template-content,
.swb-custom-content {
    padding: 10px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.swb-modal.active .swb-template-content,
.swb-modal.active .swb-custom-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .swb-button {
        width: 50px;
        height: 50px;
    }

    .swb-icon {
        width: 30px;
        height: 30px;
    }

    .swb-button-custom,
    .swb-custom-logo {
        width: 50px;
        height: 50px;
    }

    .swb-button-custom .close-icon {
        width: 30px;
        height: 30px;
        padding: 6px;
    }

    .swb-modal {
        width: 280px;
    }
}

/* Animation for modal exit */
.swb-modal.closing {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: transform 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045),
                opacity 0.3s ease,
                visibility 0s linear 0.3s;
    visibility: hidden;
}
