:root {
    --wf-green: #25D366;
    --wf-dark: #128C7E;
    --wf-deeper: #075E54;
    --wf-radius: 20px;
    --wf-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1);
    --wf-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-wpp {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    --wf-btn-color: #25D366;
}

.floating-wpp.position-right {
    left: auto;
    right: 20px;
}

.floating-wpp-button {
    position: relative;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--wf-transition);
    background: var(--wf-btn-color, #25D366);
    box-shadow: 0 4px 20px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    user-select: none;
}

.floating-wpp-button.shape-rounded {
    border-radius: 20px;
}

.floating-wpp-button.shape-square {
    border-radius: 10px;
}

.floating-wpp-button.shape-pill {
    border-radius: 50px;
    padding: 0 20px;
    gap: 10px;
}

.floating-wpp-button.shape-pill .wf-btn-text {
    color: white;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.floating-wpp-button svg,
.floating-wpp-button img {
    width: 55%;
    height: 55%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.floating-wpp-button.has-msg {
    animation: wfPulse 2.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes wfPulse {
    0% { box-shadow: 0 4px 20px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.55); }
    60% { box-shadow: 0 4px 20px rgba(37,211,102,.45), 0 0 0 14px rgba(37,211,102,0); }
    100% { box-shadow: 0 4px 20px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,0); }
}

.floating-wpp-button:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 28px rgba(37,211,102,.55);
}

.floating-wpp-button:active {
    transform: scale(0.96);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #FF6B6B, #FF3B3B);
    color: white;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255,59,59,.5), 0 0 0 2px white;
    z-index: 2;
    animation: wfBadge 2s ease infinite;
}

@keyframes wfBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.floating-wpp-bubble {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    width: 280px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px) scale(0.94);
    transition: opacity .3s cubic-bezier(0.4,0,0.2,1), transform .3s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.15));
    z-index: 2;
}

.floating-wpp.position-right .floating-wpp-bubble {
    left: auto;
    right: 0;
}

.floating-wpp-bubble.bubble-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-wpp-bubble-inner {
    background: #ffffff;
    border-radius: 18px 18px 18px 4px;
    padding: 14px 16px 14px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    border: 1px solid rgba(0,0,0,.07);
}

.floating-wpp.position-right .floating-wpp-bubble-inner {
    border-radius: 18px 18px 4px 18px;
}

.floating-wpp-bubble-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1;
    transition: background .2s;
    padding: 0;
    z-index: 2;
}

.floating-wpp-bubble-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.floating-wpp-bubble-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.floating-wpp-bubble-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #f0fdf4;
}

.floating-wpp-bubble-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #25D366;
    border-radius: 50%;
    border: 2px solid white;
}

.floating-wpp-bubble-body {
    flex: 1;
    min-width: 0;
    padding-right: 14px;
}

.floating-wpp-bubble-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.floating-wpp-bubble-name {
    font-size: 13px;
    font-weight: 700;
    color: #289deb;
    line-height: 1.2;
}

.floating-wpp-bubble-role {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 1px 7px;
    border-radius: 20px;
}

.floating-wpp-bubble-msg {
    font-size: 13.5px;
    color: #374151;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.floating-wpp-bubble-cta {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    align-items: center;
}

.floating-wpp-bubble-cta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25D366;
    animation: wfBubbleDot 1.4s ease infinite;
    display: inline-block;
}

.floating-wpp-bubble-cta-dot:nth-child(2) { animation-delay: .2s; }
.floating-wpp-bubble-cta-dot:nth-child(3) { animation-delay: .4s; }

@keyframes wfBubbleDot {
    0%, 60%, 100% { transform: translateY(0); opacity: .6; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.floating-wpp-bubble-tail {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 0 solid transparent;
    border-top: 10px solid white;
    margin-left: 20px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.06));
}

.floating-wpp.position-right .floating-wpp-bubble-tail {
    margin-left: auto;
    margin-right: 20px;
    border-left: 10px solid transparent;
    border-right: 0;
}

@media (max-width: 590px) {
    .floating-wpp-bubble {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
}

.floating-wpp-popup {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    transform-origin: bottom left;
    transition: opacity var(--wf-transition);
    border-radius: var(--wf-radius);
    z-index: 1;
}

.floating-wpp.position-right .floating-wpp-popup {
    left: auto;
    right: 0;
    transform-origin: bottom right;
}

.floating-wpp-popup:not(.active) {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7) translateY(20px);
    transform-origin: bottom left;
}

.floating-wpp.position-right .floating-wpp-popup:not(.active) {
    transform-origin: bottom right;
}


.floating-wpp-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    transition: opacity .32s cubic-bezier(0.34, 1.56, 0.64, 1), transform .32s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 320px;
    height: auto;
    bottom: calc(100% + 16px);
}
.wf-popup-body {
    display: flex;
    flex-direction: column;
}.wf-messages-area {
    padding: 14px 14px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
}


.floating-wpp-popup.wf-design-classic {
    background: #f0f0f0;
    box-shadow: 0 12px 48px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.08);
}

.floating-wpp-popup.wf-design-modern {
    background: #0d1117;
    box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.2);
}

.floating-wpp-popup.wf-design-minimal {
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(40,157,235,.15), 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid rgba(40,157,235,.12);
}

.floating-wpp-popup.wf-design-whatsapp {
    background: #E5DDD5;
    box-shadow: 0 12px 48px rgba(0,0,0,.2);
}

.floating-wpp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    position: relative;
    z-index: 1;
}

.wf-design-classic .floating-wpp-head,
.wf-design-whatsapp .floating-wpp-head {
    background: linear-gradient(135deg, var(--wf-deeper) 0%, var(--wf-dark) 100%);
}

.wf-design-modern .floating-wpp-head {
    background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
    border-bottom: 1px solid rgba(37,211,102,.15);
}

.wf-design-minimal .floating-wpp-head {
    background: linear-gradient(135deg, #289deb 0%, #1a7ec0 100%);
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-image {
    flex-shrink: 0;
}

.user-image img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;background:#fff;
    border: 2px solid rgba(255,255,255,.3);
}

.store-info {
    flex: 1;
    min-width: 0;
}

.store-info span {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-info p {
    font-size: 11px;
    color: rgba(255,255,255,.65);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-wpp-head .close {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,.12);
    border: none;
    color: rgba(255,255,255,.7);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: var(--wf-transition);
    flex-shrink: 0;
    font-weight: 300;
}

.floating-wpp-head .close:hover {
    background: rgba(255,255,255,.25);
    color: white;
}

.floating-wpp-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
}

.wf-design-classic .floating-wpp-status,
.wf-design-whatsapp .floating-wpp-status {
    background: rgba(0,0,0,.06);
    color: #555;
}

.wf-design-modern .floating-wpp-status {
    background: rgba(37,211,102,.08);
    color: rgba(37,211,102,.8);
}

.wf-design-minimal .floating-wpp-status {
    background: rgba(40,157,235,.06);
    color: #289deb;
}

.floating-wpp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wf-green);
    animation: wfStatusPulse 2s ease infinite;
}

.floating-wpp-status.offline .floating-wpp-status-dot {
    background: #9ca3af;
    animation: none;
}

@keyframes wfStatusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.floating-wpp-message {
    min-height: 60px;
    margin: 4px 4px 50px;
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.6;
    position: relative;
    font-size: 14px;
    word-break: break-word;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease .1s, transform .25s ease .1s;
}

.floating-wpp-popup.active .floating-wpp-message {
    opacity: 1;
    transform: translateY(0);
}

.wf-design-classic .floating-wpp-message,
.wf-design-whatsapp .floating-wpp-message {
    background: white;
    color: #303030;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.wf-design-modern .floating-wpp-message {
    background: #1a2332;
    color: #cdd6f4;
}

.wf-design-minimal .floating-wpp-message {
    background: rgba(40,157,235,.07);
    color: #1a1a2e;
    border: 1px solid rgba(40,157,235,.12);
}

.floating-wpp-message::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 14px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.wf-design-classic .floating-wpp-message::before,
.wf-design-whatsapp .floating-wpp-message::before {
    border-bottom: 7px solid white;
}

.wf-design-modern .floating-wpp-message::before {
    border-bottom: 7px solid #1a2332;
}

.wf-design-minimal .floating-wpp-message::before {
    border-bottom: 7px solid rgba(40,157,235,.07);
}

.floating-wpp-message-time {
    display: block;
    font-size: 11px;
    opacity: .5;
    margin-top: 6px;
    text-align: right;
}

.floating-wpp-contacts {
    padding: 8px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-wpp-contact-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--wf-transition);
    text-decoration: none;
    gap: 12px;
}

.wf-design-classic .floating-wpp-contact-card,
.wf-design-whatsapp .floating-wpp-contact-card {
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.wf-design-modern .floating-wpp-contact-card {
    background: #1a2332;
    border: 1px solid rgba(255,255,255,.06);
}

.wf-design-minimal .floating-wpp-contact-card {
    background: rgba(40,157,235,.06);
    border: 1px solid rgba(40,157,235,.1);
}

.floating-wpp-contact-card:hover {
    transform: translateY(-1px);
}

.wf-design-classic .floating-wpp-contact-card:hover,
.wf-design-whatsapp .floating-wpp-contact-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.wf-design-modern .floating-wpp-contact-card:hover {
    border-color: rgba(37,211,102,.3);
    background: #1e2d40;
}

.wf-design-minimal .floating-wpp-contact-card:hover {
    background: rgba(40,157,235,.1);
}

.floating-wpp-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.floating-wpp-contact-info {
    flex: 1;
    min-width: 0;
}

.floating-wpp-contact-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-design-classic .floating-wpp-contact-name,
.wf-design-whatsapp .floating-wpp-contact-name {
    color: #1a1a2e;
}

.wf-design-modern .floating-wpp-contact-name {
    color: #cdd6f4;
}

.wf-design-minimal .floating-wpp-contact-name {
    color: #1a1a2e;
}

.floating-wpp-contact-role {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1px;
}

.floating-wpp-contact-btn {
    width: 32px;
    height: 32px;
    background: var(--wf-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--wf-transition);
}

.floating-wpp-contact-btn:hover {
    background: var(--wf-dark);
    transform: scale(1.1);
}

.floating-wpp-contact-btn svg {
    width: 16px;
    height: 16px;
    color: white;
    fill: currentColor;
}

.floating-wpp-input-message {
    padding: 10px 12px 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,.06);
}

.wf-design-classic .floating-wpp-input-message,
.wf-design-whatsapp .floating-wpp-input-message {
    background: #f8f8f8;
}

.wf-design-modern .floating-wpp-input-message {
    background: #0a0f17;
    border-top-color: rgba(255,255,255,.06);
}

.wf-design-minimal .floating-wpp-input-message {
    background: #f8fafc;
    border-top-color: rgba(40,157,235,.1);
}

.floating-wpp-input-message textarea {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.45;
    overflow: hidden;
    min-height: 42px;
    max-height: 120px;
    display: block;
}

.wf-design-classic .floating-wpp-input-message textarea,
.wf-design-whatsapp .floating-wpp-input-message textarea {
    background: white;
    color: #1a1a2e;
}

.wf-design-modern .floating-wpp-input-message textarea {
    background: #1a2332;
    border-color: rgba(255,255,255,.1);
    color: #cdd6f4;
}

.wf-design-minimal .floating-wpp-input-message textarea {
    background: white;
    border-color: rgba(40,157,235,.2);
    color: #1a1a2e;
}

.floating-wpp-input-message textarea:focus {
    border-color: var(--wf-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,.12);
}

.floating-wpp-btn-send {
    width: 38px;
    height: 38px;
    background: var(--wf-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--wf-transition);
    flex-shrink: 0;
}

.floating-wpp-btn-send:hover {
    background: var(--wf-dark);
    transform: scale(1.08);
}

.floating-wpp-btn-send:active {
    transform: scale(0.95);
}

.floating-wpp-btn-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

@media (max-width: 590px) {
    .floating-wpp-popup.active {
        position: fixed;
        z-index: 99999;
        width: calc(100vw - 32px);
        bottom: 80px;
        left: 16px !important;
        right: 16px !important;
        border-radius: 16px;
    }

    .floating-wpp.position-right .floating-wpp-popup.active {
        left: 16px !important;
        right: 16px !important;
    }

}