/* Robust CSS Resets for Radahost WhatsApp Widget */
#radahost-wa-widget,
#radahost-wa-widget *,
#radahost-wa-widget *::before,
#radahost-wa-widget *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

#radahost-wa-widget {
    position: fixed !important;
    bottom: 30px !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    line-height: normal !important;
}

#radahost-wa-widget.radahost-wa-right {
    right: 0 !important;
    flex-direction: row-reverse !important;
    /* Button (last in DOM) at the right edge */
}

#radahost-wa-widget.radahost-wa-left {
    left: 0 !important;
    flex-direction: row-reverse !important;
    /* Button (last in DOM) at the left edge */
}

/* Chat Popup Styling */
#radahost-wa-popup {
    position: absolute !important;
    bottom: 80px !important;
    width: 320px !important;
    max-width: 90vw !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    transform-origin: bottom !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.radahost-wa-popup-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8) translateY(30px) !important;
}

#radahost-wa-widget.radahost-wa-right #radahost-wa-popup {
    right: 20px !important;
    transform-origin: bottom right !important;
}

#radahost-wa-widget.radahost-wa-left #radahost-wa-popup {
    left: 20px !important;
    transform-origin: bottom left !important;
}

.radahost-wa-popup-header {
    background: var(--rh-wa-color) !important;
    color: #fff !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.radahost-wa-popup-header-info {
    display: flex !important;
    flex-direction: column !important;
}

.radahost-wa-popup-header-info strong {
    font-size: 17px !important;
    line-height: 1.2 !important;
    color: #fff !important;
}

.radahost-wa-popup-header-info span {
    font-size: 13px !important;
    opacity: 0.8 !important;
    color: #fff !important;
}

#radahost-wa-close {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 24px !important;
    cursor: pointer !important;
    line-height: 0 !important;
}

.radahost-wa-popup-body {
    padding: 20px !important;
    background: #f0f2f5 !important;
    min-height: 100px !important;
}

.radahost-wa-popup-body p {
    background: #fff !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    margin: 0 !important;
    font-size: 14px !important;
    color: #333 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    line-height: 1.5 !important;
}

.radahost-wa-popup-footer {
    padding: 15px !important;
    display: flex !important;
    gap: 10px !important;
    background: #fff !important;
    border-top: 1px solid #eee !important;
}

#radahost-wa-input {
    flex-grow: 1 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 24px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    outline: none !important;
    background: #f8f9fa !important;
    color: #333 !important;
    height: 40px !important;
}

#radahost-wa-send {
    background: var(--rh-wa-color) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    cursor: pointer !important;
}

#radahost-wa-send svg {
    width: 20px !important;
    height: 20px !important;
    fill: #fff !important;
    display: block !important;
}

/* Floating Button Text Tooltip */
.radahost-wa-text {
    background: #fff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

#radahost-wa-widget:hover .radahost-wa-text {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

#radahost-wa-widget.radahost-wa-right .radahost-wa-text {
    transform: translateX(10px) !important;
    margin-right: 15px !important;
    /* Keep away from edge */
}

#radahost-wa-widget.radahost-wa-left .radahost-wa-text {
    transform: translateX(-10px) !important;
    margin-left: 15px !important;
    /* Keep away from edge */
}

#radahost-wa-button {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px !important;
    background-color: var(--rh-wa-color) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#radahost-wa-widget.radahost-wa-right #radahost-wa-button {
    border-radius: 35px 0 0 35px !important;
    padding-left: 5px !important;
}

#radahost-wa-widget.radahost-wa-left #radahost-wa-button {
    border-radius: 0 35px 35px 0 !important;
    padding-right: 5px !important;
}

#radahost-wa-button svg {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
}

#radahost-wa-widget:hover #radahost-wa-button {
    width: 75px !important;
}

@media (max-width: 768px) {

    .radahost-wa-text,
    #radahost-wa-popup {
        display: none !important;
    }

    #radahost-wa-widget.rh-wa-hide-mobile {
        display: none !important;
    }

    #radahost-wa-widget {
        bottom: 20px !important;
    }

    #radahost-wa-button {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        border-radius: 50% !important;
        margin: 0 10px !important;
    }
}