/* ============================================================
   PETITLOU — MESSAGES EMPRUNTEUR ↔ PROPRIÉTAIRE  v1.0
   Design tokens : --pw-pink #F9867B · --pw-dark #3E211F
                   --pw-gray-bg #EEEEEE · --pw-radius 15px
   Typo : Nunito
   ============================================================ */

.pl-msg-wrap {
    font-family: Nunito, sans-serif;
    color: #3E211F;
}

.pl-msg-title {
    font-size: 22px;
    font-weight: 900;
    margin: 0 0 24px;
}

/* ─── LISTE DES CONVERSATIONS ─────────────────────────────── */

.pl-msg-empty {
    color: #3E211F;
    opacity: .7;
}

.pl-msg-conversation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pl-msg-conversation-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px 0 rgba(62,33,31,0.10);
    text-decoration: none;
    color: #3E211F;
}

.pl-msg-conversation-item.has-unread a {
    border: 1.5px solid #F9867B;
}

.pl-msg-conv-thumb-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.pl-msg-conv-thumb-wrap img:not(.pl-msg-avatar-badge) {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.pl-msg-avatar-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 100% !important;
    border: 2px solid #fff;
    object-fit: cover;
}

.pl-msg-conv-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pl-msg-conv-product {
    font-size: 13px;
    opacity: .7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-msg-badge {
    background: #F9867B;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ─── FIL DE DISCUSSION ────────────────────────────────────── */

.pl-msg-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    color: #3E211F;
    opacity: .7;
    text-decoration: none;
    font-size: 14px;
}

.pl-msg-context {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px 0 rgba(62,33,31,0.10);
    margin-bottom: 16px;
}

.pl-msg-context-thumb {
    position: relative;
    flex-shrink: 0;
}

.pl-msg-context-thumb img:not(.pl-msg-avatar-badge) {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.pl-msg-context-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pl-msg-context .dokan-report-abuse-button {
    flex-shrink: 0;
    margin: 0 !important;
    font-size: 13px !important;
    color: #3E211F !important;
    opacity: .7;
}

.pl-msg-context .dokan-report-abuse-button:hover {
    opacity: 1;
    color: #F9867B !important;
}

.pl-msg-context-product {
    font-weight: 800;
    color: #3E211F;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-msg-context-product:hover {
    color: #F9867B;
}

.pl-msg-context-product--deleted {
    opacity: .6;
    font-style: italic;
    font-weight: 700;
}

.pl-msg-context-name {
    font-size: 13px;
    opacity: .7;
}

.pl-msg-composer-disabled {
    margin: 0;
    padding: 12px 16px;
    background: #EEEEEE;
    border-radius: 5px;
    font-size: 14px;
    color: #3E211F;
    opacity: .7;
    text-align: center;
}

.pl-msg-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    background: #EEEEEE;
    border-radius: 5px;
    margin-bottom: 16px;
}

.pl-msg-empty-thread {
    margin: auto;
    color: #3E211F;
    opacity: .6;
    font-size: 14px;
    text-align: center;
}

.pl-msg-bubble {
    max-width: 75%;
    padding: 10px 16px;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 10px 0 rgba(62,33,31,0.10);
    position: relative;
}

.pl-msg-mine {
    align-self: flex-end;
    background: #F9867B;
    color: #fff;
}

.pl-msg-theirs {
    align-self: flex-start;
}

.pl-msg-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.pl-msg-photo {
    max-width: 100%;
    border-radius: 5px;
    display: block;
}

.pl-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.pl-msg-time {
    font-size: 11px;
    opacity: .65;
}

.pl-msg-status {
    font-size: 11px;
    font-style: italic;
    opacity: .8;
}

.pl-msg-handoff-panel-title {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 8px;
}

.pl-msg-handoff-notice {
    margin: 0;
    font-size: 14px;
}

/* ─── COMPOSITEUR ──────────────────────────────────────────── */

.pl-msg-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pl-msg-composer textarea {
    width: 100%;
    border: 1.5px solid #EEEEEE;
    border-radius: 5px;
    padding: 10px 16px;
    font-family: Nunito, sans-serif;
    font-size: 15px;
    color: #3E211F;
    resize: vertical;
}

.pl-msg-composer textarea:focus {
    outline: none;
    border-color: #F9867B;
}

.pl-msg-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pl-msg-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #EEEEEE;
    color: #3E211F;
    border-radius: 5px;
    padding: 10px 16px;
    font-family: Nunito, sans-serif;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s ease, color .2s ease;
}

.pl-msg-photo-btn:hover {
    background: #F9867B;
    color: #fff;
}

.pl-msg-photo-icon {
    font-size: 16px;
    line-height: 0;
}

.pl-msg-send-btn {
    background: #F9867B;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 16px;
    font-weight: 700;
    font-family: Nunito, sans-serif;
    cursor: pointer;
}

.pl-msg-send-btn:hover {
    background: #3E211F;
}

.pl-msg-error {
    color: #d63638;
    font-size: 13px;
}

/* ─── BOUTON "CONTACTER LE PROPRIÉTAIRE" (fiche produit) ──── */

.pl-contact-owner-btn.pl-msg-loading {
    opacity: .6;
    pointer-events: none;
}
