/* WhatsApp Popup Trigger Button */
.r77-wa-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: r77-wa-pop-in 0.4s ease-out 0.5s both;
}

.r77-wa-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
}

.r77-wa-trigger svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.r77-wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: r77-wa-pulse 2s infinite;
}

@keyframes r77-wa-pop-in {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes r77-wa-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Overlay */
.r77-wa-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    animation: r77-wa-fade-in 0.25s ease-out;
}

.r77-wa-overlay.active {
    display: block;
}

@keyframes r77-wa-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Card */
.r77-wa-popup {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 100001;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 56px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: r77-wa-slide-up 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.r77-wa-popup.active {
    display: block;
}

@keyframes r77-wa-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.r77-wa-header {
    background: #075E54;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.r77-wa-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #128C7E;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.r77-wa-avatar svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.r77-wa-header-info {
    flex: 1;
    min-width: 0;
}

.r77-wa-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.r77-wa-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.85;
}

/* Close button */
.r77-wa-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    opacity: 0.75;
    transition: opacity 0.2s;
    line-height: 1;
}

.r77-wa-close:hover { opacity: 1; }

.r77-wa-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Body */
.r77-wa-body {
    padding: 20px;
}

.r77-wa-message-bubble {
    background: #dcf8c6;
    border-radius: 8px 8px 8px 2px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #303030;
    margin-bottom: 16px;
    position: relative;
}

.r77-wa-message-bubble::after {
    content: '';
    position: absolute;
    left: -6px;
    bottom: 10px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: #dcf8c6;
    border-left: 0;
    border-bottom: 0;
    margin-top: -3px;
}

.r77-wa-time {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

.r77-wa-input-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

.r77-wa-input-area input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.r77-wa-input-area input:focus {
    border-color: #25D366;
}

.r77-wa-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.r77-wa-send:hover {
    background: #1da851;
}

.r77-wa-send svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.r77-wa-footer {
    padding: 10px 20px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

.r77-wa-footer a {
    color: #075E54;
    text-decoration: none;
}

.r77-wa-footer a:hover {
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .r77-wa-popup {
        bottom: 90px;
        right: 12px;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
    .r77-wa-trigger {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}
