/* ===== Custom Call Button — Front Styles (v3.7) ===== */

/* Wrapper: bottom/left/right از inline-style میاد */
.ccb-contact-button-wrapper {
    position: fixed;
    z-index: 9999;
    font-family: inherit;
}

/* ===== Floating Toggle Button ===== */
.ccb-contact-button-wrapper .ccb-contact-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: none;
    border-radius: 50%;
    box-sizing: border-box;
    line-height: 0;
    cursor: pointer;
    background: var(--ccb-toggle-bg) !important;
    background-color: var(--ccb-toggle-bg) !important;
    color: var(--ccb-toggle-icon);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .2), 0 1px 10px rgba(0, 0, 0, .15);
    transition: background-color .25s ease, transform .25s ease;
    will-change: background-color, transform;
}

.ccb-contact-button-wrapper .ccb-contact-toggle-btn:hover {
    background: var(--ccb-toggle-bg-hover) !important;
    background-color: var(--ccb-toggle-bg-hover) !important;
    transform: scale(1.06);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .2), 0 1px 10px rgba(0, 0, 0, .15) !important;
}

.ccb-contact-button-wrapper .ccb-contact-toggle-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

/* ===== Popup Panel ===== */
.ccb-contact-popup {
    position: absolute !important;
    bottom: 80px;
    left: 0;
    width: 260px;
    max-width: calc(100vw - 32px);
    padding: 24px 16px 16px;
    border-radius: 12px;
    background: var(--ccb-popup-bg);
    color: var(--ccb-popup-text);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .15);
    text-align: center;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    box-sizing: border-box;
}

.ccb-contact-popup.active {
    opacity: 1;
    visibility: visible;
}

.ccb-side-right .ccb-contact-popup {
    right: 0 !important;
    left: auto !important;
}

/* محتوا جدا از دکمه بستن */
.ccb-contact-content {
    position: relative;
}

/* ===== Close button ===== */
.ccb-contact-button-wrapper .ccb-contact-close {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgb(0 0 0 / 19%);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .2s ease, transform .2s ease, opacity .2s ease;
    min-height: unset;
}

.ccb-contact-button-wrapper .ccb-contact-close:hover {
    background: rgba(0, 0, 0, .12);
    transform: scale(1.05);
}

.ccb-contact-button-wrapper .ccb-contact-close img {
    width: 10px;
    height: 10px;
    display: block;
    opacity: .85;
    transition: opacity .2s ease;
}

.ccb-contact-button-wrapper .ccb-contact-close:hover img {
    opacity: 1;
}

/* Typography & spacing */
.ccb-contact-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.ccb-contact-name {
    font-size: 16px;
    font-weight: 700;
    margin: 6px 0 2px;
}

.ccb-contact-position {
    font-size: 14px;
    opacity: .75;
    margin: 0 0 10px;
}

.ccb-rich p {
    margin: 8px 0;
    line-height: 1.7;
    font-size: 13px;
}

.ccb-rich a {
    color: var(--ccb-primary);
    text-decoration: underline;
}

.ccb-contact-phone {
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0;
}

/* Call button inside popup */
.ccb-contact-call-btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    background: var(--ccb-primary);
    color: var(--ccb-btn-text);
    border: 1px solid var(--ccb-primary);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.ccb-contact-call-btn:hover {
    background: var(--ccb-hover-bg);
    color: var(--ccb-primary);
    border-color: var(--ccb-primary);
}

/* Small screens */
@media (max-width: 380px) {
    .ccb-contact-button-wrapper .ccb-contact-toggle-btn {
        width: 60px;
        height: 60px;
    }

    .ccb-contact-popup {
        width: 92vw;
    }
}