﻿.review-prompt {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid #eee;
}

.review-prompt-text {
    font-size: 14px;
    margin-bottom: 8px;
}

.review-stars {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.star {
    cursor: pointer;
    transition: fill 0.2s;
}

    .star:hover {
        fill: #f5a623;
    }

.review-comment {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
}

.review-submit {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

    .review-submit:hover {
        background: #218838;
    }
    .msg-page {
    display: flex;
    height: calc(100vh - 140px);
    min-height: 500px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin: 16px 0;
}

/* ── Sidebar ── */
.msg-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.msg-sidebar-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.msg-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.msg-conv-list {
    flex: 1;
    overflow-y: auto;
}

.msg-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f8f8f8;
    transition: background 0.1s;
    cursor: pointer;
}

    .msg-conv-item:hover {
        background: #fafafa;
    }

    .msg-conv-item.msg-conv-active {
        background: #f0faf9;
        border-left: 3px solid #00b0a3;
    }

.msg-conv-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

    .msg-conv-avatar img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        object-fit: cover;
    }

.msg-conv-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #00b0a3;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-conv-body {
    flex: 1;
    min-width: 0;
}

.msg-conv-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.msg-conv-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-conv-time {
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
    margin-left: 8px;
}

.msg-conv-product {
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.msg-conv-last {
    font-size: 13px;
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-empty-list {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    padding: 40px 20px;
}

/* ── Chat area ── */
.msg-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.msg-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.msg-chat-back {
    display: none;
    font-size: 20px;
    color: #333;
    text-decoration: none;
    margin-right: 4px;
}

.msg-chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .msg-chat-header-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.msg-chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

    .msg-chat-header-name:hover {
        text-decoration: underline;
    }

/* Карточка объявления */
.msg-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

    .msg-product-card img {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        object-fit: cover;
        flex-shrink: 0;
    }

.msg-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .msg-product-name:hover {
        text-decoration: underline;
    }

/* Сообщения */
.msg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-date-divider {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin: 12px 0 8px;
    position: relative;
}

    .msg-date-divider::before,
    .msg-date-divider::after {
        content: '';
        position: absolute;
        top: 50%;
        width: calc(50% - 60px);
        height: 1px;
        background: #f0f0f0;
    }

    .msg-date-divider::before {
        left: 0;
    }

    .msg-date-divider::after {
        right: 0;
    }

.msg-bubble-wrap {
    display: flex;
    margin-bottom: 4px;
}

.msg-bubble-mine {
    justify-content: flex-end;
}

.msg-bubble-theirs {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.msg-bubble-mine .msg-bubble {
    background: #1a1a1a;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-bubble-theirs .msg-bubble {
    background: #f2f2f2;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.msg-bubble-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-bubble-time {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
}

.msg-bubble-mine .msg-bubble-time {
    color: rgba(255,255,255,0.6);
}

.msg-bubble-theirs .msg-bubble-time {
    color: #aaa;
}

/* Input */
.msg-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.msg-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    transition: border-color 0.15s;
}

    .msg-input:focus {
        border-color: #aaa;
    }

.msg-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

    .msg-send-btn:hover {
        background: #333;
    }

.msg-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ccc;
    font-size: 14px;
}

/* ── Иконка в шапке ── */
.msg-nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    color: #555;
    text-decoration: none;
    transition: border-color 0.15s;
}

    .msg-nav-icon:hover {
        border-color: #aaa;
        color: #1a1a1a;
    }

.msg-nav-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Mobile */
@@media (max-width: 700px) {
    .msg-sidebar {
        width: 100%;
        border-right: none;
    }

    .msg-sidebar-hidden-mobile {
        display: none;
    }

    .msg-chat-hidden-mobile {
        display: none;
    }

    .msg-chat-back {
        display: block;
    }

    .msg-bubble {
        max-width: 85%;
    }
}
