/* ==========================================
   ویجت واتساپ صاها - با فاصله بیشتر و انیمیشن
   ========================================== */

#saha-wa-widget {
    position: fixed;
    bottom: 80px;        /* ⬅️ فاصله بیشتر از پایین */
    right: 30px;
    z-index: 99999;
    font-family: inherit;
    direction: rtl;
}

#saha-wa-toggle {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    animation: saha-wa-bounce 2s infinite; /* ⬅️ انیمیشن برگشت */
}

#saha-wa-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

#saha-wa-toggle svg {
    width: 32px;
    height: 32px;
    display: block;
}

#saha-wa-toggle .saha-wa-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

#saha-wa-widget.saha-wa-closed #saha-wa-box {
    display: none;
}

#saha-wa-widget.saha-wa-open #saha-wa-box {
    display: block;
}
#saha-wa-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: saha-wa-slideUp 0.4s ease;
    display: block;
}

@keyframes saha-wa-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saha-wa-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.saha-wa-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.saha-wa-avatar {
    font-size: 28px;
    background: rgba(255,255,255,0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saha-wa-title {
    font-size: 16px;
    font-weight: 600;
}

.saha-wa-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.saha-wa-close {
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: 0.2s;
    line-height: 1;
}

.saha-wa-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.saha-wa-body {
    padding: 20px;
    background: #f0f2f5;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.saha-wa-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    animation: saha-wa-fadeIn 0.5s ease;
}

.saha-wa-bot {
    background: #fff;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

@keyframes saha-wa-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.saha-wa-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    width: fit-content;
    align-self: flex-start;
}

.saha-wa-typing span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    display: inline-block;
    animation: saha-wa-dot 1.4s infinite;
}

.saha-wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.saha-wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes saha-wa-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.saha-wa-footer {
    padding: 12px 20px 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.saha-wa-btn {
    display: block;
    width: 100%;
    background: #25D366;
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
    font-family: inherit;
}

.saha-wa-btn:hover {
    background: #1da85c;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.35);
    color: #fff;
}

/* ========== انیمیشن حرکت دکمه (همان قبلی) ========== */
@keyframes saha-wa-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==========================================
   واکنش‌گرایی (ریسپانسیو)
   ========================================== */
@media (max-width: 768px) {
    #saha-wa-widget {
        bottom: 80px;        /* در موبایل هم فاصله بیشتر */
        right: 20px;
    }
    #saha-wa-toggle {
        width: 55px;
        height: 55px;
    }
    #saha-wa-toggle svg {
        width: 28px;
        height: 28px;
    }
    #saha-wa-box {
        width: calc(100vw - 40px);
        max-width: 400px;
        bottom: 75px;
        right: 0;
    }
    .saha-wa-header {
        padding: 14px 16px;
    }
    .saha-wa-title {
        font-size: 14px;
    }
    .saha-wa-body {
        padding: 16px;
        min-height: 100px;
    }
    .saha-wa-message {
        font-size: 13px;
        padding: 10px 14px;
    }
    .saha-wa-btn {
        font-size: 14px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #saha-wa-widget {
        bottom: 70px;        /* فاصله بیشتر در موبایل‌های کوچک */
    }
    #saha-wa-box {
        width: calc(100vw - 30px);
        bottom: 70px;
        right: 5px;
        border-radius: 16px;
    }
    #saha-wa-toggle {
        width: 50px;
        height: 50px;
    }
}