/**
 * Contact Floating Widget Styles
 *
 * @package Cxb_B2B_Product_Showcase
 */

/* ---- Container ---- */
.nbb2b-contact-widget {
    position: fixed;
    top: 50%;
    z-index: 99999;
    transform: translateY(-50%);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    display: flex;
    flex-direction: column;
    width: 40px;
    background: #f5f5f5;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
    overflow: visible;
}

.nbb2b-contact-widget.nbb2b-cw-right {
    right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.nbb2b-contact-widget.nbb2b-cw-left {
    left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ---- Individual item ---- */
.nbb2b-cw-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background-color .25s ease;
}

.nbb2b-cw-item + .nbb2b-cw-item {
    border-top: 1px solid #d0d0d0;
}

.nbb2b-cw-item:first-child {
    border-radius: 4px 4px 0 0;
}

.nbb2b-contact-widget.nbb2b-cw-right .nbb2b-cw-item:first-child {
    border-top-right-radius: 0;
}

.nbb2b-contact-widget.nbb2b-cw-left .nbb2b-cw-item:first-child {
    border-top-left-radius: 0;
}

.nbb2b-cw-item:last-child {
    border-radius: 0 0 4px 4px;
}

.nbb2b-contact-widget.nbb2b-cw-right .nbb2b-cw-item:last-child {
    border-bottom-right-radius: 0;
}

.nbb2b-contact-widget.nbb2b-cw-left .nbb2b-cw-item:last-child {
    border-bottom-left-radius: 0;
}

/* ---- Icon ---- */
.nbb2b-cw-icon {
    width: 20px;
    height: 20px;
    transition: transform .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbb2b-cw-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* chat icon uses chat-icon.svg – size it at 30px */
.nbb2b-cw-item[data-type="chat"] .nbb2b-cw-icon,
.nbb2b-cw-item[data-type="chat"] .nbb2b-cw-icon img {
    width: 30px;
    height: 30px;
}

/* phone & email icons are black stroke-based SVGs; colour them on hover via CSS filter */
.nbb2b-cw-item[data-type="phone"] .nbb2b-cw-icon img,
.nbb2b-cw-item[data-type="email"] .nbb2b-cw-icon img {
    transition: filter .25s ease;
}

/* Hover – scale icon */
.nbb2b-cw-item:hover .nbb2b-cw-icon {
    transform: scale(1.18);
}

/* ---- Tooltip ---- */
.nbb2b-cw-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #333;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 100000;
}

/* Right-side widget: tooltip goes left */
.nbb2b-cw-right .nbb2b-cw-tooltip {
    right: 100%;
    margin-right: 8px;
}

/* Left-side widget: tooltip goes right */
.nbb2b-cw-left .nbb2b-cw-tooltip {
    left: 100%;
    margin-left: 8px;
}

/* Arrow for tooltip */
.nbb2b-cw-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
}

.nbb2b-cw-right .nbb2b-cw-tooltip::after {
    left: 100%;
    border-left-color: #333;
}

.nbb2b-cw-left .nbb2b-cw-tooltip::after {
    right: 100%;
    border-right-color: #333;
}

.nbb2b-cw-item:hover .nbb2b-cw-tooltip {
    opacity: 1;
}

.nbb2b-cw-right .nbb2b-cw-item:hover .nbb2b-cw-tooltip {
    transform: translateY(-50%) translateX(-2px);
}

.nbb2b-cw-left .nbb2b-cw-item:hover .nbb2b-cw-tooltip {
    transform: translateY(-50%) translateX(2px);
}

/* ---- Back to top ---- */
.nbb2b-cw-item.nbb2b-cw-backtop {
    display: none; /* hidden by default, shown via JS */
}

.nbb2b-cw-item.nbb2b-cw-backtop.nbb2b-cw-visible {
    display: flex;
}

.nbb2b-cw-item.nbb2b-cw-backtop .nbb2b-cw-icon img {
    transition: filter .25s ease;
}

/* ---- WeChat Modal ---- */
.nbb2b-cw-wechat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .55);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
}

.nbb2b-cw-wechat-overlay.nbb2b-cw-show {
    display: flex;
}

.nbb2b-cw-wechat-modal {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    position: relative;
    animation: nbb2b-cw-fadeIn .25s ease;
}

@keyframes nbb2b-cw-fadeIn {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}

.nbb2b-cw-wechat-modal .nbb2b-cw-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    transition: color .2s;
}

.nbb2b-cw-wechat-modal .nbb2b-cw-modal-close:hover {
    color: #333;
}

.nbb2b-cw-wechat-modal .nbb2b-cw-wechat-qr {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto 12px;
    display: block;
    border-radius: 4px;
}

.nbb2b-cw-wechat-modal .nbb2b-cw-wechat-account {
    font-size: 14px;
    color: #333;
    margin: 0;
    word-break: break-all;
}

.nbb2b-cw-wechat-modal .nbb2b-cw-wechat-label {
    font-size: 16px;
    font-weight: 600;
    color: #07C160;
    margin: 0 0 16px;
}

/* ---- Responsive – slightly smaller on mobile ---- */
@media (max-width: 768px) {
    .nbb2b-contact-widget {
        width: 36px;
    }
    .nbb2b-cw-item {
        width: 36px;
        height: 36px;
    }
    .nbb2b-cw-icon,
    .nbb2b-cw-icon img {
        width: 18px;
        height: 18px;
    }
}
