/* ShipItAll — Buyer My Account Messages (v1.0.91) */

.sia-buyer-messages .sia-ma-empty {
    text-align:center; padding:40px 20px; background:#fafaf6; border-radius:12px;
}
.sia-buyer-messages .sia-ma-empty h3 { margin:0 0 8px; font-size:18px; }
.sia-buyer-messages .sia-ma-empty p  { margin:0 0 20px; color:#666; }

.sia-ma-thread-list { list-style:none; margin:0; padding:0; border:1px solid #e7e5de; border-radius:12px; overflow:hidden; background:#fff; }
.sia-ma-thread-item { border-bottom:1px solid #f0eee7; }
.sia-ma-thread-item:last-child { border-bottom:0; }
.sia-ma-thread-item a { display:grid; grid-template-columns:42px 1fr auto; gap:12px; align-items:center; padding:14px 16px; text-decoration:none; color:#222; transition:background .15s; }
.sia-ma-thread-item a:hover { background:#fafaf6; }
.sia-ma-thread-item.is-unread a { background:#fff7f4; }

.sia-ma-avatar { width:42px; height:42px; border-radius:50%; background:#E8380D; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; }
.sia-ma-thread-body { display:flex; flex-direction:column; gap:3px; min-width:0; }
.sia-ma-thread-top { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.sia-ma-thread-name { font-weight:600; color:#222; }
.sia-ma-thread-time { font-size:12px; color:#999; white-space:nowrap; }
.sia-ma-thread-subject { font-size:13px; color:#444; }
.sia-ma-thread-preview { font-size:13px; color:#666; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sia-ma-thread-dot { width:10px; height:10px; border-radius:50%; background:#E8380D; display:inline-block; }

/* === Thread detail === */
.sia-buyer-thread { display:flex; flex-direction:column; gap:14px; }

.sia-ma-back { display:inline-block; font-size:13px; color:#666; text-decoration:none; margin-bottom:8px; }
.sia-ma-back:hover { color:#E8380D; }

.sia-ma-thread-header { border-bottom:1px solid #e7e5de; padding-bottom:14px; }
.sia-ma-thread-title { display:flex; gap:12px; align-items:center; }
.sia-ma-thread-title strong { display:block; font-size:16px; }
.sia-ma-visit-store { font-size:12px; color:#E8380D; text-decoration:none; margin-left:8px; }
.sia-ma-subject { font-size:13px; color:#666; margin-top:2px; }

.sia-ma-product-ctx { display:flex; align-items:center; gap:10px; padding:10px 14px; background:#fafaf6; border-radius:10px; text-decoration:none; color:#444; font-size:13px; }
.sia-ma-product-ctx img { width:40px; height:40px; object-fit:cover; border-radius:6px; }

.sia-ma-notice { padding:10px 14px; border-radius:8px; font-size:13px; }
.sia-ma-notice-success { background:#e8f7ee; color:#0a7a36; border:1px solid #b7e4c6; }
.sia-ma-notice-warning { background:#fff7e5; color:#8a5a00; border:1px solid #f5d580; }
.sia-ma-notice-error   { background:#fdecec; color:#a11a1a; border:1px solid #f4b7b7; }

.sia-ma-bubbles { display:flex; flex-direction:column; gap:10px; max-height:500px; overflow-y:auto; padding:8px 2px; }
.sia-ma-empty-bubbles { text-align:center; color:#999; padding:30px 0; }
.sia-ma-bubble { max-width:75%; padding:10px 14px; border-radius:14px; font-size:14px; line-height:1.4; }
.sia-ma-bubble.is-mine   { align-self:flex-end; background:#E8380D; color:#fff; border-bottom-right-radius:4px; }
.sia-ma-bubble.is-theirs { align-self:flex-start; background:#fff; border:1px solid #e7e5de; color:#222; border-bottom-left-radius:4px; }
.sia-ma-bubble-meta { font-size:11px; opacity:.7; margin-top:4px; }

.sia-ma-reply-form { display:flex; flex-direction:column; gap:10px; border-top:1px solid #e7e5de; padding-top:14px; }
.sia-ma-reply-form textarea { width:100%; padding:10px 12px; border:1px solid #ddd; border-radius:10px; font:inherit; resize:vertical; min-height:72px; }
.sia-ma-reply-footer { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; }
.sia-ma-hint { font-size:11px; color:#999; max-width:60%; line-height:1.4; }

.sia-ma-closed { text-align:center; padding:16px; background:#f5f5f0; border-radius:10px; color:#666; font-size:13px; }

/* Unread badge in WC nav */
.woocommerce-MyAccount-navigation .sia-ma-unread-badge { display:inline-block; background:#E8380D; color:#fff; font-size:11px; font-weight:700; padding:1px 7px; border-radius:10px; margin-left:6px; }

@media (max-width:640px) {
  .sia-ma-reply-footer { flex-direction:column; align-items:stretch; }
  .sia-ma-hint { max-width:100%; }
  .sia-ma-bubble { max-width:90%; }
}
