/* ── INBOX ───────────────────────────────────────────────────── */
.ls-inbox-wrap {
    display: flex;
    height: calc(100vh - 180px);
    min-height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin: 0 0 40px;
}

/* Sidebar */
.ls-inbox-sidebar {
    width: 320px;
    min-width: 320px;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.ls-inbox-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
}

.ls-inbox-header h2 { margin: 0; font-size: 18px; }

.ls-inbox-badge {
    background: #e44;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.ls-inbox-list { flex: 1; overflow-y: auto; }

.ls-inbox-empty-list {
    padding: 30px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Conversazione item */
.ls-conv-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .15s;
    position: relative;
}
.ls-conv-item:hover { background: #f5f5f5; }
.ls-conv-item.active { background: #e8f4fd; border-left: 3px solid #0073aa; }

.ls-conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-conv-info { flex: 1; min-width: 0; }

.ls-conv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.ls-conv-name { font-weight: 600; font-size: 14px; color: #222; }
.ls-conv-time { font-size: 11px; color: #aaa; white-space: nowrap; }

.ls-conv-product {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
}
.ls-conv-product img { width: 22px; height: 22px; border-radius: 3px; object-fit: cover; }
.ls-conv-product span { font-size: 11px; color: #0073aa; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.ls-conv-preview { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ls-conv-unread {
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    align-self: center;
    flex-shrink: 0;
}

/* Admin bar */
.ls-inbox-admin-bar {
    padding: 10px 16px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
}
.ls-inbox-admin-bar button { width: 100%; }

/* Main area */
.ls-inbox-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ls-inbox-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    gap: 16px;
    font-size: 15px;
}

/* Thread */
#ls-inbox-thread {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.ls-thread-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.ls-thread-user { display: flex; align-items: center; gap: 12px; }
.ls-thread-user strong { font-size: 16px; }

.ls-thread-product {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f7ff;
    border: 1px solid #c8e0f4;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}
.ls-thread-product img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }

.ls-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9f9f9;
}

/* Messaggi */
.ls-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
}
.ls-msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.ls-msg-theirs { align-self: flex-start; }

.ls-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-msg-bubble { max-width: 100%; }

.ls-msg-text {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ls-msg-mine .ls-msg-text { background: #0073aa; color: #fff; border-bottom-right-radius: 4px; }
.ls-msg-theirs .ls-msg-text { background: #fff; color: #333; border: 1px solid #e8e8e8; border-bottom-left-radius: 4px; }

.ls-msg-attachment { max-width: 200px; border-radius: 8px; margin-top: 6px; display: block; }

.ls-msg-time { font-size: 10px; color: #aaa; margin-top: 3px; text-align: right; }
.ls-msg-theirs .ls-msg-time { text-align: left; }

/* Reply box */
.ls-thread-reply {
    padding: 12px 16px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ls-thread-reply textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    resize: none;
    font-size: 14px;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.4;
}

.ls-thread-reply textarea:focus { outline: none; border-color: #0073aa; }

.ls-thread-reply-actions { flex-shrink: 0; }

/* Form nuovo messaggio */
#ls-inbox-new, #ls-inbox-broadcast {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ls-new-msg-form { max-width: 600px; }
.ls-new-msg-form .ls-field { margin-bottom: 14px; }
.ls-new-msg-form label { display: block; font-size: 12px; font-weight: 700; color: #666; margin-bottom: 4px; text-transform: uppercase; }
.ls-new-msg-form input, .ls-new-msg-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.ls-new-msg-form textarea { resize: vertical; }

/* Autocomplete */
.ls-suggestions {
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.ls-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}
.ls-suggestion-item:hover { background: #f0f7ff; }
.ls-suggestion-item img { width: 28px; height: 28px; border-radius: 50%; }

/* Product tag */
.ls-product-tag {
    background: #f0f7ff;
    border: 1px solid #c8e0f4;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #0073aa;
    font-weight: 600;
}

/* Contact vendor button on product page */
.ls-contact-vendor-box { margin: 12px 0; }
.ls-contact-vendor-btn {
    display: inline-block;
    background: #f8f8f8;
    border: 2px solid #0073aa;
    color: #0073aa !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}
.ls-contact-vendor-btn:hover { background: #0073aa; color: #fff !important; }
.ls-contact-login { font-size: 13px; color: #666; }
.ls-contact-login a { color: #0073aa; }

/* Success/error */
.ls-inbox-msg .success, .ls-broadcast-msg .success { color: #2e7d32; font-weight: 600; }
.ls-inbox-msg .error, .ls-broadcast-msg .error { color: #c62828; font-weight: 600; }

/* Mobile */
@media (max-width: 768px) {
    .ls-inbox-wrap { flex-direction: column; height: auto; min-height: 0; }
    .ls-inbox-sidebar { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid #e8e8e8; max-height: 300px; }
    .ls-inbox-main { min-height: 400px; }
    .ls-msg { max-width: 90%; }
}

/* ── SISTEMA OFFERTE ────────────────────────────────────────── */
.ls-reply-type-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.ls-reply-type-btn {
    padding: 6px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.ls-reply-type-btn.active,
.ls-reply-type-btn:hover { border-color: #0073aa; color: #0073aa; background: #f0f7ff; }

.ls-offer-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.ls-offer-currency {
    padding: 10px 12px;
    background: #f5f5f5;
    font-weight: 700;
    color: #555;
    border-right: 1px solid #ddd;
}
.ls-offer-input-wrap input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 16px;
    outline: none;
}

/* Messaggio offerta nel thread */
.ls-msg-offer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #fff9e6;
    border: 2px solid #f0c040;
    border-radius: 12px;
    min-width: 220px;
}
.ls-offer-icon { font-size: 24px; }
.ls-offer-details { flex: 1; }
.ls-offer-label { display: block; font-size: 11px; color: #888; text-transform: uppercase; }
.ls-offer-price { display: block; font-size: 20px; font-weight: 700; color: #333; }

.ls-offer-actions { display: flex; gap: 8px; width: 100%; }
.ls-offer-accept, .ls-offer-reject {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}
.ls-offer-accept { background: #2e7d32; color: #fff; }
.ls-offer-accept:hover { background: #1b5e20; }
.ls-offer-reject { background: #f5f5f5; color: #c62828; border: 1px solid #c62828; }
.ls-offer-reject:hover { background: #ffebee; }

.ls-offer-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    width: 100%;
    text-align: center;
}
.ls-offer-badge.accepted { background: #e8f5e9; color: #2e7d32; }
.ls-offer-badge.rejected { background: #ffebee; color: #c62828; }
.ls-offer-badge.pending  { background: #fff9e6; color: #f57c00; }

/* Pulsante Acquista ora nell'inbox */
.ls-buy-now-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #0073aa;
    color: #fff !important;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 8px;
    font-size: 14px;
}
.ls-buy-now-btn:hover { background: #005a87; }

.ls-buy-now-box {
    background: #e8f4fd;
    border: 2px solid #0073aa;
    border-radius: 10px;
    padding: 14px;
    margin: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Messaggio sistema */
.ls-msg-system {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 6px 20px;
    font-style: italic;
}
