:root {
    --wfw-whatsapp-color: #25d366;
    --wfw-whatsapp-dark: #128c7e;
    --wfw-text-color: #333;
    --wfw-bg-color: #fff;
    --wfw-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --wfw-desktop-btn-size: 70px;
    --wfw-desktop-bottom: 20px;
    --wfw-desktop-side: 20px;
    --wfw-desktop-chat-width: 360px;
    --wfw-mobile-btn-size: 60px;
    --wfw-mobile-bottom: 15px;
    --wfw-mobile-side: 15px;
    --wfw-mobile-extra-bottom: 0px;
    --wfw-mobile-chat-width: 360px;
    --wfw-online-color: #25d366;
    --wfw-offline-color: #cccccc;
    --wfw-lunch-color: #ffc107;
}

.wfw-widget {
    position: fixed;
    bottom: calc(var(--wfw-desktop-bottom) + env(safe-area-inset-bottom, 0px));
    right: var(--wfw-desktop-side);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wfw-pos-left {
    right: auto;
    left: var(--wfw-desktop-side);
}

.wfw-pos-left .wfw-chat-box {
    right: auto;
    left: 0;
}

.wfw-toggle-btn {
    background-color: #25d366;
    background-color: var(--wfw-whatsapp-color, #25d366);
    color: white;
    border: none;
    border-radius: 50%;
    width: var(--wfw-desktop-btn-size);
    height: var(--wfw-desktop-btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--wfw-shadow);
    transition: transform 0.3s ease, background-color 0.3s ease;
    padding: 0;
}

.wfw-toggle-btn:hover {
    transform: scale(1.05);
    background-color: var(--wfw-whatsapp-dark);
}

.wfw-toggle-btn svg {
    width: 50%;
    height: 50%;
}

.wfw-btn-custom-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.wfw-toggle-btn.wfw-has-custom-img {
    background-color: transparent !important;
    box-shadow: none;
    overflow: hidden;
}

.wfw-chat-box {
    position: absolute;
    bottom: calc(var(--wfw-desktop-btn-size) + 15px);
    right: 0;
    width: var(--wfw-desktop-chat-width);
    background: var(--wfw-bg-color);
    border-radius: 12px;
    box-shadow: var(--wfw-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: wfw-fade-in 0.3s ease;
}

@keyframes wfw-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wfw-chat-header {
    background-color: var(--wfw-whatsapp-dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

.wfw-chat-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    padding: 2px;
}

.wfw-header-info strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

#wfw-status-container {
    display: flex;
    align-items: center;
    font-size: 12px;
    opacity: 0.9;
}

.wfw-status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--wfw-offline-color);
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.wfw-online .wfw-status-indicator {
    background-color: var(--wfw-online-color);
    box-shadow: 0 0 5px var(--wfw-online-color);
}

.wfw-lunch .wfw-status-indicator {
    background-color: var(--wfw-lunch-color);
    box-shadow: 0 0 5px var(--wfw-lunch-color);
}

.wfw-online-pulse {
    animation: wfw-pulse 2s infinite;
}

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

.wfw-header-info {
    flex-grow: 1;
}

#wfw-close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: auto;
}

.wfw-chat-body {
    padding: 20px;
    text-align: center;
}

.wfw-chat-body p {
    margin: 0 0 15px 0;
    color: var(--wfw-text-color);
    font-size: 14px;
}

.wfw-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wfw-whatsapp-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    gap: 8px;
}

.wfw-whatsapp-btn:hover {
    background-color: var(--wfw-whatsapp-dark);
    color: white;
}

@media (max-width: 768px) {
    .wfw-widget {
        bottom: calc(var(--wfw-mobile-bottom) + var(--wfw-mobile-extra-bottom) + env(safe-area-inset-bottom, 0px));
        right: var(--wfw-mobile-side);
    }

    .wfw-pos-left {
        right: auto;
        left: var(--wfw-mobile-side);
    }

    .wfw-toggle-btn {
        width: var(--wfw-mobile-btn-size);
        height: var(--wfw-mobile-btn-size);
    }

    .wfw-chat-box {
        bottom: calc(var(--wfw-mobile-btn-size) + 10px);
        width: var(--wfw-mobile-chat-width);
        max-width: 92vw;
    }
}
