/* تهمتن شاپ - دکمه تماس شناور */
#tcfab-wrapper {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: ltr;
}

#tcfab-wrapper.tcfab-pos-right {
    right: var(--tcfab-side-desktop, 30px);
    bottom: var(--tcfab-bottom-desktop, 30px);
}

#tcfab-wrapper.tcfab-pos-left {
    left: var(--tcfab-side-desktop, 30px);
    bottom: var(--tcfab-bottom-desktop, 30px);
}

/* Main button */
.tcfab-main-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--tcfab-main-color, #25D366);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s;
    position: relative;
    outline: none;
}

.tcfab-main-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.tcfab-main-btn:active {
    transform: scale(0.96);
}

.tcfab-main-btn .tcfab-icon-close {
    display: none;
}

.tcfab-main-btn.is-open .tcfab-icon-open {
    display: none;
}

.tcfab-main-btn.is-open .tcfab-icon-close {
    display: flex;
}

/* Actions container */
.tcfab-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.tcfab-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.3) translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s;
    pointer-events: none;
}

.tcfab-actions.is-open .tcfab-btn {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.tcfab-actions.is-open .tcfab-btn:nth-child(1) {
    transition-delay: 0.05s;
}

.tcfab-actions.is-open .tcfab-btn:nth-child(2) {
    transition-delay: 0.12s;
}

.tcfab-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

.tcfab-phone {
    background: var(--tcfab-phone-color, #007bff);
}

.tcfab-whatsapp {
    background: var(--tcfab-whatsapp-color, #25D366);
}

/* Pulse animation on main when closed */
.tcfab-main-btn:not(.is-open)::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--tcfab-main-color, #25D366);
    animation: tcfab-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes tcfab-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #tcfab-wrapper.tcfab-pos-right {
        right: var(--tcfab-side-mobile, 20px);
        bottom: var(--tcfab-bottom-mobile, 20px);
    }
    #tcfab-wrapper.tcfab-pos-left {
        left: var(--tcfab-side-mobile, 20px);
        bottom: var(--tcfab-bottom-mobile, 20px);
    }
    .tcfab-main-btn {
        width: 56px;
        height: 56px;
    }
    .tcfab-btn {
        width: 48px;
        height: 48px;
    }
}

/* Visibility control via JS class */
#tcfab-wrapper.tcfab-hide-desktop {
    display: none;
}
@media (max-width: 768px) {
    #tcfab-wrapper.tcfab-hide-desktop {
        display: flex;
    }
    #tcfab-wrapper.tcfab-hide-mobile {
        display: none;
    }
}
@media (min-width: 769px) {
    #tcfab-wrapper.tcfab-hide-mobile {
        display: flex;
    }
}
