.contact-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10005;
}

.contact-floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    position: relative;
}

.contact-floating-btn:hover {
    transform: scale(1.1);
}

.contact-floating-btn svg {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.contact-floating-btn:hover svg {
    transform: rotate(360deg);
}

.contact-floating-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    min-width: 200px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.contact-floating.active .contact-floating-menu {
    display: flex;
}

.contact-floating.chat-open .contact-floating-menu {
    display: none;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.contact-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.contact-item:hover {
    transform: translateX(-5px);
}

/* Inline Chat Container */
.mrkb-floating-chat-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 320px;
    height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.mrkb-floating-chat-container .mrkb-chat-header {
    background: #075e54;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mrkb-floating-chat-container .mrkb-chat-back {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.mrkb-floating-chat-container .mrkb-new-msg-badge {
    background: #dc3232;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.mrkb-floating-chat-container .mrkb-chat-info-form {
    padding: 20px;
    text-align: center;
    background: #f5f5f5;
    flex: 1;
}

.mrkb-floating-chat-container .mrkb-chat-info-form input {
    display: block;
    width: 90%;
    margin: 8px auto;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.mrkb-floating-chat-container .mrkb-chat-info-form button {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    margin-top: 10px;
}

.mrkb-floating-chat-container .mrkb-chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;            /* ← اضافه شود */
}

.mrkb-floating-chat-container .mrkb-chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #e5ddd5;
    min-height: 0;            /* ← اضافه شود */
    -webkit-overflow-scrolling: touch; /* اسکرول روان در iOS */
}

.mrkb-floating-chat-container .mrkb-msg {
    margin-bottom: 12px;
    display: flex;
}

.mrkb-floating-chat-container .mrkb-msg.user {
    justify-content: flex-end;
}

.mrkb-floating-chat-container .mrkb-msg.admin {
    justify-content: flex-start;
}

.mrkb-floating-chat-container .bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;   /* اضافه شود */
}

.mrkb-floating-chat-container .mrkb-msg.user .bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 2px;
}

.mrkb-floating-chat-container .mrkb-msg.admin .bubble {
    background: #ffffff;
    border: 1px solid #eee;
    border-bottom-left-radius: 2px;
}

.mrkb-floating-chat-container .mrkb-chat-input {
    display: flex;
    padding: 8px;
    border-top: 1px solid #ddd;
    background: #fff;
}

.mrkb-floating-chat-container .mrkb-chat-input textarea {
    flex: 1;
    resize: none;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 12px;
    font: inherit;
}

.mrkb-floating-chat-container .mrkb-chat-input button {
    margin-left: 6px;
    background: #25d366;
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 20px;
    cursor: pointer;
    font: inherit;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .contact-floating { bottom: 15px; right: 15px; }
    .contact-floating-btn { width: 50px; height: 50px; }
    .contact-floating-btn svg { width: 25px; height: 25px; }
    .contact-floating-menu { min-width: 180px; }
    .mrkb-floating-chat-container { width: 280px; height: 380px; right: 0; }
}
/* جلوگیری از اسکرول والد در موبایل */
.mrkb-floating-chat-container .mrkb-chat-messages,
#mrkb-chat-app .mrkb-chat-messages {
    overscroll-behavior: contain;
}
.mrkb-status-online { color: #2e7d32; margin-bottom: 10px; font-weight: bold; }
.mrkb-status-offline { color: #c62828; margin-bottom: 10px; font-weight: bold; }
/* استایل یکسان برای سلکتور دپارتمان در فرم اطلاعات */
.mrkb-floating-chat-container .mrkb-chat-info-form select,
#mrkb-chat-info-form select {
    display: block;
    width: 90%;
    margin: 8px auto;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    background: #fff;
    box-sizing: border-box;
}