:root {
    --wa-red: #9a2109;
    --wa-red-dark: #701402;
    --wa-red-light: #b9290f;
    --wa-amber: #d97706;
    --wa-bg-glass: rgba(255, 255, 255, 0.92);
    --wa-shadow: 0 16px 40px -8px rgba(154, 33, 9, 0.22), 0 6px 16px rgba(0, 0, 0, 0.08);
}

#float-wa-container {
    position: fixed;
    right: var(--wa-right, 20px);
    bottom: var(--wa-bottom, 20px);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    pointer-events: none;
}

/* Floating WhatsApp Trigger Button */
#float-wa-button {
    width: var(--wa-size, 60px);
    height: var(--wa-size, 60px);
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: var(--wa-radius, 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 3px solid #ffffff;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: wa-pulse 2.4s infinite;
    position: relative;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

#float-wa-button.active {
    transform: scale(0.92);
    box-shadow: 0 0 0 4px rgba(154, 33, 9, 0.35), 0 8px 20px rgba(18, 140, 126, 0.45);
}

#float-wa-button::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#float-wa-button:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

#float-wa-button svg {
    width: 52%;
    height: 52%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

@keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#float-wa-button:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Modern Liquid Glassmorphism Popup Container */
#float-wa-popup {
    position: absolute;
    bottom: calc(var(--wa-size, 60px) + 16px);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--wa-shadow);
    overflow: hidden;
    transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
    pointer-events: auto;
    z-index: 10;
}

#float-wa-popup.float-wa-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) translate3d(15px, 25px, 0);
    pointer-events: none;
}

/* Header with Theme Color Gradient & Crystal Clear Typography */
.float-wa-header {
    background: linear-gradient(135deg, #9a2109 0%, #b9290f 50%, #701402 100%);
    color: #ffffff;
    padding: 20px 20px 18px 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Subtle gloss shine on header top */
.float-wa-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
}

.float-wa-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.float-wa-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #25D366;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.float-wa-header-icon svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.float-wa-header h3 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.float-wa-header span {
    display: block;
    font-size: 12.5px;
    color: #fef08a !important; /* High contrast soft gold/yellow */
    font-weight: 600;
    margin-top: 3px;
    line-height: 1.3;
}

.float-wa-header p {
    margin: 8px 0 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 400;
}

#float-wa-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.9;
}

#float-wa-close:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.08);
    opacity: 1;
}

/* Body & User List */
.float-wa-body {
    padding: 14px 16px;
    max-height: 380px;
    overflow-y: auto;
    background: #fafafa;
}

.float-wa-user-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.float-wa-user-item:hover {
    background: #ffffff;
    border-color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(154, 33, 9, 0.1);
}

.float-wa-user-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid #fecdd3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.float-wa-user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.float-wa-user-info strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.float-wa-user-info span {
    font-size: 11.5px;
    font-weight: 500;
    color: #9a2109;
    display: block;
    margin-top: 2px;
}

/* Input Container & Send Button */
.float-wa-input-container {
    display: flex;
    gap: 8px;
    margin-top: -2px;
    margin-bottom: 12px;
    padding: 4px 6px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.float-wa-message-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

.float-wa-message-input:focus {
    border-color: #9a2109;
    box-shadow: 0 0 0 3px rgba(154, 33, 9, 0.12);
}

.float-wa-send-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.float-wa-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 12px rgba(37, 211, 102, 0.5);
}

.float-wa-input-container.float-wa-hidden {
    display: none !important;
}

#float-wa-popup.float-wa-hidden {
    display: block !important;
    opacity: 0;
    visibility: hidden;
}

/* Responsive Mobile Display (<= 700px) */
@media (max-width: 700px) {
    #float-wa-container {
        right: 0;
        left: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 2147483646;
    }

    #float-wa-button {
        position: fixed;
        left: -10px;
        top: 35%;
        border-radius: 0px 30px 30px 0px !important;
    }

    #float-wa-button.active {
        width: calc(var(--wa-size, 60px) + 15px) !important;
        background: linear-gradient(135deg, #9a2109 0%, #701402 100%);
    }

    #float-wa-popup {
        position: fixed;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 22px 22px 0 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-bottom: none;
        transform: translateY(100%); 
        opacity: 1 !important;
        visibility: visible !important;
        transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    }

    #float-wa-popup.float-wa-hidden {
        transform: translateY(100%) !important;
        opacity: 1 !important; 
        visibility: visible !important;
    }

    #float-wa-popup:not(.float-wa-hidden) {
        transform: translateY(0) !important;
    }

    #float-wa-container:has(#float-wa-popup:not(.float-wa-hidden)) {
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        pointer-events: auto;
    }
}
