/* ── Base ── */
.asfar-fc-call,
.asfar-fc-whatsapp {
    position: fixed;
    bottom: 24px;
    z-index: 99998;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

/* ── CALL BUTTON (right side) ── */
.asfar-fc-call {
    right: 24px;
}

.asfar-fc-call__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ECA539;
    color: #fff;
    text-decoration: none;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(236, 165, 57, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 2;
}

.asfar-fc-call__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(236, 165, 57, 0.5);
    color: #fff;
}

.asfar-fc-call__pulse {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(236, 165, 57, 0.3);
    top: 0;
    right: 0;
    z-index: 1;
    animation: asfar-fc-pulse 2s ease-out infinite;
}

/* ── WHATSAPP BUTTON (left side) ── */
.asfar-fc-whatsapp {
    left: 24px;
}

.asfar-fc-whatsapp__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
    z-index: 2;
}

.asfar-fc-whatsapp__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.asfar-fc-whatsapp.chat-open .asfar-fc-whatsapp__btn {
    background: #128C7E;
}

.asfar-fc-whatsapp__pulse {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    bottom: 0;
    left: 0;
    z-index: 1;
    animation: asfar-fc-pulse 2s ease-out infinite;
}

.asfar-fc-whatsapp.chat-open .asfar-fc-whatsapp__pulse {
    display: none;
}

@keyframes asfar-fc-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ── CHAT WINDOW ── */
.asfar-fc-chat {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 340px;
    max-height: 450px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom left;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.asfar-fc-whatsapp.chat-open .asfar-fc-chat {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.asfar-fc-chat__header {
    background: #075E54;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.asfar-fc-chat__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asfar-fc-chat__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.asfar-fc-chat__name {
    font-weight: 700;
    font-size: 0.95rem;
}

.asfar-fc-chat__status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.asfar-fc-chat__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #25D366;
    display: inline-block;
}

.asfar-fc-chat__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.asfar-fc-chat__close:hover {
    opacity: 1;
}

.asfar-fc-chat__body {
    padding: 20px 16px;
    min-height: 120px;
    background-color: #E5DDD5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9bfb0' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.asfar-fc-chat__bubble {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 12px 16px;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.asfar-fc-chat__bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid #fff;
    border-left: 8px solid transparent;
}

.asfar-fc-chat__bubble-text {
    font-size: 0.9rem;
    color: #2D3748;
    line-height: 1.6;
    margin: 0;
}

.asfar-fc-chat__bubble-time {
    display: block;
    text-align: left;
    font-size: 0.7rem;
    color: #A0AEC0;
    margin-top: 4px;
}

.asfar-fc-chat__footer {
    padding: 12px 16px;
    background: #F0F0F0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.asfar-fc-chat__input {
    flex: 1;
    border: none;
    background: #fff;
    border-radius: 20px;
    padding: 10px 16px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    resize: none;
    max-height: 80px;
    outline: none;
    direction: rtl;
    line-height: 1.5;
}

.asfar-fc-chat__input::placeholder {
    color: #A0AEC0;
}

.asfar-fc-chat__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.asfar-fc-chat__send:hover {
    background: #1DA851;
    transform: scale(1.05);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .asfar-fc-chat {
        width: calc(100vw - 32px);
        left: -8px;
        bottom: 68px;
        max-height: 400px;
    }

    .asfar-fc-call,
    .asfar-fc-whatsapp {
        bottom: 20px;
    }

    .asfar-fc-call { right: 16px; }
    .asfar-fc-whatsapp { left: 16px; }

    .asfar-fc-call__btn,
    .asfar-fc-whatsapp__btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .asfar-fc-call__pulse,
    .asfar-fc-whatsapp__pulse {
        width: 50px;
        height: 50px;
    }
}
