
/* ==========================================================
   RAKTREE - Seller Orders
   DESIGN ONLY
   ไม่แตะ logic / API / seller_orders-db.js
   ========================================================== */

#tab-orders {
    width: 100%;
}

#tab-orders .orders-container {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e7eee8;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 28px rgba(27, 94, 32, 0.07);
}

/* ---------- Header ---------- */

#tab-orders .orders-container > .header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 20px;
    padding: 0 2px;
}

#tab-orders .orders-container > .header h3 {
    margin: 0;
    color: #185b25;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.4;
}

#tab-orders .orders-container > .header p {
    margin: 5px 0 0 !important;
    color: #7a847d !important;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ---------- Table ---------- */

#tab-orders .orders-container > div[style*="overflow"] {
    width: 100%;
    overflow-x: auto !important;
    border: 1px solid #edf1ee;
    border-radius: 12px;
    background: #fff;
}

#tab-orders table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    background: #fff;
}

#tab-orders table th {
    padding: 13px 14px;
    border-bottom: 1px solid #e4eae5;
    background: #f5f8f5;
    color: #506058;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    white-space: nowrap;
}

#tab-orders table th:first-child {
    border-top-left-radius: 11px;
}

#tab-orders table th:last-child {
    border-top-right-radius: 11px;
}

#tab-orders table td {
    padding: 14px;
    border-bottom: 1px solid #edf1ee;
    color: #344139;
    font-size: 0.88rem;
    line-height: 1.5;
    vertical-align: middle;
    background: #fff;
}

#tab-orders table tbody tr:last-child td {
    border-bottom: 0;
}

#tab-orders table tbody tr:hover td {
    background: #fbfdfb;
}

/* ---------- Order number ---------- */

#tab-orders table td:first-child {
    color: #174f24;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Money ---------- */

#tab-orders table td:nth-child(4) {
    color: #23763a;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Date ---------- */

#tab-orders table td:nth-child(6) {
    color: #68736c;
    white-space: nowrap;
}

/* ---------- Loading / empty ---------- */

#tab-orders table tbody td[colspan] {
    padding: 34px 20px !important;
    color: #89928c !important;
    text-align: center !important;
}

/* ---------- Status ---------- */

/* Works with common classes produced by the existing JS. */
#tab-orders .status,
#tab-orders .order-status,
#tab-orders .order-status-badge,
#tab-orders .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    box-sizing: border-box;
    padding: 5px 11px;
    border-radius: 999px;
    background: #edf6ef;
    color: #246936;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

#tab-orders .pending,
#tab-orders .status-pending {
    background: #fff7df;
    color: #8a6900;
}

#tab-orders .accepted,
#tab-orders .status-accepted {
    background: #eaf6ec;
    color: #246936;
}

#tab-orders .shipping,
#tab-orders .status-shipping {
    background: #fff1dd;
    color: #9a5b00;
}

#tab-orders .shipped,
#tab-orders .delivered,
#tab-orders .completed,
#tab-orders .status-shipped,
#tab-orders .status-delivered,
#tab-orders .status-completed {
    background: #e8f6ea;
    color: #17662a;
}

#tab-orders .cancelled,
#tab-orders .canceled,
#tab-orders .status-cancelled,
#tab-orders .status-canceled {
    background: #fdebed;
    color: #b3262e;
}

/* ---------- Action area ---------- */

#tab-orders table td:last-child {
    white-space: nowrap;
}

#tab-orders table td:last-child button {
    box-sizing: border-box;
    min-height: 34px;
    margin: 0 4px 4px 0;
    padding: 7px 11px;
    border: 1px solid #cddbd0;
    border-radius: 8px;
    background: #ffffff;
    color: #245d31;
    font-family: inherit;
    font-size: 0.80rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

#tab-orders table td:last-child button:hover {
    border-color: #77ad82;
    background: #f1f8f2;
    color: #185b25;
}

#tab-orders table td:last-child button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Buttons that the existing JS may mark as primary/action. */
#tab-orders table td:last-child button.order-action-btn,
#tab-orders table td:last-child button.primary,
#tab-orders table td:last-child button.accept,
#tab-orders table td:last-child button.shipping,
#tab-orders table td:last-child button.tracking {
    border-color: #2d8b46;
    background: #2d8b46;
    color: #fff;
}

#tab-orders table td:last-child button.order-action-btn:hover,
#tab-orders table td:last-child button.primary:hover,
#tab-orders table td:last-child button.accept:hover,
#tab-orders table td:last-child button.shipping:hover,
#tab-orders table td:last-child button.tracking:hover {
    border-color: #236f37;
    background: #236f37;
    color: #fff;
}

/* ---------- Order detail modal ----------
   จำกัดขนาดเพื่อไม่ให้รูปสินค้า/เนื้อหาขยาย modal ใหญ่เกินไป
   ---------- */

#sellerOrderDetailModal.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    background: rgba(24, 42, 29, .48);
    backdrop-filter: blur(2px);
}

#sellerOrderDetailModal.modal-overlay.show,
#sellerOrderDetailModal.modal-overlay.active {
    display: flex;
}

#sellerOrderDetailModal .modal-content {
    width: min(680px, 94vw) !important;
    max-width: 680px !important;
    max-height: 82vh !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 24px !important;
    border: 1px solid #e2eae3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

/* Close button generated by the working HTML */
#sellerOrderDetailModal .modal-content > button:first-child {
    float: right !important;
    width: 32px;
    height: 32px;
    margin: -4px -4px 8px 12px;
    padding: 0 !important;
    border: 1px solid #dfe6e1 !important;
    border-radius: 50%;
    background: #f5f7f5 !important;
    color: #526057 !important;
    font-family: inherit;
    font-size: 17px;
    line-height: 30px;
    cursor: pointer;
}

#sellerOrderDetailModal .modal-content > button:first-child:hover {
    background: #eaf2eb !important;
}

/* ---------- Modal content ---------- */

#sellerOrderDetailModal #sellerOrderDetailContent {
    clear: both;
    color: #344139;
    font-size: .90rem;
    line-height: 1.65;
}

#sellerOrderDetailModal #sellerOrderDetailContent h3,
#sellerOrderDetailModal #sellerOrderDetailContent h4 {
    color: #185b25;
    line-height: 1.4;
}

#sellerOrderDetailModal #sellerOrderDetailContent h3 {
    margin: 0 0 6px;
    font-size: 1.08rem;
}

#sellerOrderDetailModal #sellerOrderDetailContent h4 {
    margin: 14px 0 7px;
    font-size: .96rem;
}

#sellerOrderDetailModal #sellerOrderDetailContent p {
    margin: 5px 0;
}

#sellerOrderDetailModal #sellerOrderDetailContent hr {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid #e8eee9;
}

/* IMPORTANT: product/payment images must never stretch the modal. */
#sellerOrderDetailModal #sellerOrderDetailContent img {
    display: block;
    width: auto !important;
    max-width: 220px !important;
    max-height: 240px !important;
    height: auto !important;
    margin: 8px 0;
    box-sizing: border-box;
    object-fit: contain;
    border: 1px solid #e1e7e2;
    border-radius: 10px;
    background: #f7f9f7;
}

/* Keep QR/slip images readable but controlled. */
#sellerOrderDetailModal #sellerOrderDetailContent img[src*="qr"],
#sellerOrderDetailModal #sellerOrderDetailContent img[src*="QR"],
#sellerOrderDetailModal #sellerOrderDetailContent img[src*="slip"],
#sellerOrderDetailModal #sellerOrderDetailContent img[src*="Slip"] {
    max-width: 220px !important;
    max-height: 260px !important;
}

/* Forms inside the existing detail modal */
#sellerOrderDetailModal #sellerOrderDetailContent input,
#sellerOrderDetailModal #sellerOrderDetailContent select,
#sellerOrderDetailModal #sellerOrderDetailContent textarea {
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

#sellerOrderDetailModal #sellerOrderDetailContent input[type="text"],
#sellerOrderDetailModal #sellerOrderDetailContent select,
#sellerOrderDetailModal #sellerOrderDetailContent textarea {
    padding: 9px 11px;
    border: 1px solid #d6e0d8;
    border-radius: 9px;
    background: #fff;
    outline: none;
}

#sellerOrderDetailModal #sellerOrderDetailContent input[type="text"]:focus,
#sellerOrderDetailModal #sellerOrderDetailContent select:focus,
#sellerOrderDetailModal #sellerOrderDetailContent textarea:focus {
    border-color: #2d8b46;
    box-shadow: 0 0 0 3px rgba(45, 139, 70, .09);
}

/* ---------- Replacement claim blocks remain functional ---------- */

#sellerOrderDetailModal .seller-replacement-shipping-box,
#sellerOrderDetailModal .seller-replacement-completed-box {
    box-sizing: border-box;
}

@media (max-width: 760px) {
    #tab-orders .orders-container {
        padding: 17px;
        border-radius: 14px;
    }

    #tab-orders .orders-container > .header {
        display: block;
        margin-bottom: 15px;
    }

    #tab-orders table {
        min-width: 850px;
    }

    #sellerOrderDetailModal.modal-overlay {
        padding: 10px;
    }

    #sellerOrderDetailModal .modal-content {
        width: min(680px, 96vw) !important;
        max-height: 88vh !important;
        padding: 18px !important;
        border-radius: 14px;
    }

    #sellerOrderDetailModal #sellerOrderDetailContent img {
        max-width: 190px !important;
        max-height: 210px !important;
    }
}

@media (max-width: 520px) {
    #tab-orders .orders-container {
        padding: 13px;
    }

    #tab-orders table {
        min-width: 780px;
    }

    #sellerOrderDetailModal .modal-content {
        width: 96vw !important;
        padding: 15px !important;
    }
}

/* ==========================================================
   SELLER ORDERS - DETAIL MODAL
   จัดเฉพาะหน้าตา "ดูรายละเอียดคำสั่งซื้อ"
   ใช้กับ seller_orders.js ชุดที่แสดงข้อมูลได้แล้ว
   ไม่เปลี่ยน API / data / logic
   ========================================================== */

/* ---------- Modal ---------- */
#sellerOrderDetailModal.seller-order-modal {
    padding: 24px;
    background: rgba(24, 36, 27, 0.52);
    backdrop-filter: blur(3px);
}

#sellerOrderDetailModal .seller-order-modal-card {
    width: min(720px, 94vw);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

#sellerOrderDetailModal .seller-order-modal-head {
    min-height: 62px;
    box-sizing: border-box;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e8eee9;
}

#sellerOrderDetailModal .seller-order-modal-head h3 {
    margin: 0;
    color: #185c27;
    font-size: 1.08rem;
    font-weight: 700;
}

#sellerOrderDetailModal .seller-order-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e1e8e2;
    border-radius: 9px;
    background: #f6f8f6;
    color: #526158;
    font-size: 19px;
    line-height: 1;
}

#sellerOrderDetailModal .seller-order-close:hover {
    background: #edf5ee;
    color: #185c27;
}

/* ---------- Body ---------- */
#sellerOrderDetailModal .seller-order-modal-body {
    box-sizing: border-box;
    max-height: calc(88vh - 62px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 22px 24px;
    background: #f7faf7;

    color: #34423a;
    font-family: 'Sarabun', sans-serif;
    font-size: .92rem;
    line-height: 1.6;
}

/* ---------- Order number ---------- */
#sellerOrderDetailModal .seller-order-modal-body > h3 {
    margin: 0 0 16px;
    padding: 13px 15px;
    border: 1px solid #dce9de;
    border-radius: 11px;
    background: #fff;
    color: #185c27;
    font-size: 1.02rem;
    font-weight: 700;
}

/* ==========================================================
   ข้อมูลผู้ซื้อ
   เดิมเป็น <p> ติดกัน
   เปลี่ยนเป็นแถวข้อมูลแยกกันชัดเจน
   ========================================================== */

#sellerOrderDetailModal .seller-order-modal-body > p {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin: 0;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #edf1ed;
    color: #34423a;
}

#sellerOrderDetailModal .seller-order-modal-body > p:first-of-type {
    border-radius: 11px 11px 0 0;
}

#sellerOrderDetailModal .seller-order-modal-body > p:last-of-type {
    border-radius: 0 0 11px 11px;
    margin-bottom: 16px;
}

#sellerOrderDetailModal .seller-order-modal-body > p b {
    color: #718077;
    font-weight: 600;
}

#sellerOrderDetailModal .seller-order-modal-body > p b::after {
    content: '';
}

#sellerOrderDetailModal .seller-order-modal-body > p {
    overflow-wrap: anywhere;
}

#sellerOrderDetailModal .seller-order-modal-body > p b + * {
    min-width: 0;
}

/* ==========================================================
   รายการสินค้า
   ========================================================== */

#sellerOrderDetailModal .seller-order-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid #edf1ed;
}

#sellerOrderDetailModal .seller-order-detail-item:last-child {
    border-bottom: 0;
}

#sellerOrderDetailModal .seller-order-detail-item img {
    width: 82px !important;
    height: 82px !important;
    flex: 0 0 82px;
    object-fit: cover;
    border: 1px solid #e0e8e1;
    border-radius: 10px;
    background: #f1f5f1;
}

#sellerOrderDetailModal .seller-order-detail-item > div[style*="flex:1"] {
    flex: 1 !important;
    min-width: 0;
}

#sellerOrderDetailModal .seller-order-detail-item b {
    display: block;
    margin-bottom: 5px;
    color: #214d2c;
    font-size: .96rem;
    line-height: 1.45;
}

#sellerOrderDetailModal .seller-order-detail-item strong {
    flex: 0 0 auto;
    margin-left: auto;
    color: #278241;
    font-size: .94rem;
    white-space: nowrap;
}

/* บังคับข้อความรายละเอียดสินค้าให้อ่านง่าย */
#sellerOrderDetailModal .seller-order-detail-item > div > div {
    line-height: 1.5;
}

/* ---------- Total ---------- */
#sellerOrderDetailModal .seller-order-detail-total {
    box-sizing: border-box;
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid #d8e7da;
    border-radius: 11px;
    background: #f2faf3;
    color: #185c27;
    font-size: .96rem;
    font-weight: 700;
}

#sellerOrderDetailModal .seller-order-detail-total::after {
    content: '';
}

/* ==========================================================
   หลักฐานการชำระเงิน
   JS มี inline style อยู่ จึง override เฉพาะรูปแบบที่จำเป็น
   ========================================================== */

#sellerOrderDetailModal .seller-order-modal-body img[alt="หลักฐานการชำระเงิน"] {
    display: block;
    width: auto !important;
    max-width: min(300px, 100%) !important;
    max-height: 330px !important;
    margin: 10px auto 0 !important;
    object-fit: contain;
    border: 1px solid #dfe7e0;
    border-radius: 10px;
    background: #fff;
}

#sellerOrderDetailModal .seller-order-modal-body img[alt="หลักฐานการชำระเงิน"] + div {
    text-align: center;
}

/* กล่องหลักฐานที่ JS สร้างแบบ inline */
#sellerOrderDetailModal .seller-order-modal-body img[alt="หลักฐานการชำระเงิน"] {
    box-sizing: border-box;
}

/* ---------- Action area ---------- */
#sellerOrderDetailModal .seller-order-modal-body > div[style*="margin-top:18px"] {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px !important;
    padding-top: 15px;
    border-top: 1px solid #e4ebe5;
}

#sellerOrderDetailModal .seller-order-modal-body .order-action-btn {
    min-height: 38px;
    padding: 9px 15px;
    border: 0;
    border-radius: 9px;
    font-family: 'Sarabun', sans-serif;
    font-size: .86rem;
    font-weight: 600;
}

/* ---------- History ---------- */
#sellerOrderDetailModal .seller-order-modal-body > h4 {
    margin: 20px 0 8px;
    padding: 12px 14px;
    border: 1px solid #e1e9e2;
    border-radius: 11px 11px 0 0;
    background: #fff;
    color: #185c27;
    font-size: .96rem;
}

#sellerOrderDetailModal .seller-order-history {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf1ed;
    background: #fff;
    color: #405047;
    line-height: 1.5;
}

#sellerOrderDetailModal .seller-order-history:first-child {
    border-radius: 0;
}

#sellerOrderDetailModal .seller-order-history:last-child {
    border-bottom: 0;
    border-radius: 0 0 11px 11px;
}

#sellerOrderDetailModal .seller-order-history span {
    flex: 0 0 auto;
    color: #89928c;
    font-size: .82rem;
    white-space: nowrap;
}

/* ---------- Scrollbar ---------- */
#sellerOrderDetailModal .seller-order-modal-body::-webkit-scrollbar {
    width: 8px;
}

#sellerOrderDetailModal .seller-order-modal-body::-webkit-scrollbar-track {
    background: #eef3ef;
}

#sellerOrderDetailModal .seller-order-modal-body::-webkit-scrollbar-thumb {
    background: #c4d1c6;
    border-radius: 20px;
}

#sellerOrderDetailModal .seller-order-modal-body::-webkit-scrollbar-thumb:hover {
    background: #aebdb0;
}

/* ---------- Mobile ---------- */
@media (max-width: 620px) {
    #sellerOrderDetailModal.seller-order-modal {
        padding: 10px;
    }

    #sellerOrderDetailModal .seller-order-modal-card {
        width: 96vw;
        max-height: 92vh;
        border-radius: 15px;
    }

    #sellerOrderDetailModal .seller-order-modal-body {
        max-height: calc(92vh - 62px);
        padding: 15px;
    }

    #sellerOrderDetailModal .seller-order-modal-body > p {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    #sellerOrderDetailModal .seller-order-detail-item img {
        width: 70px !important;
        height: 70px !important;
        flex-basis: 70px;
    }

    #sellerOrderDetailModal .seller-order-detail-item strong {
        font-size: .88rem;
    }

    #sellerOrderDetailModal .seller-order-history {
        flex-direction: column;
        gap: 3px;
    }
}
/* =========================================================
   SELLER ORDER DETAIL
   ========================================================= */

#sellerOrderDetailModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 35, 25, 0.55);
    backdrop-filter: blur(3px);
}

#sellerOrderDetailModal.show {
    display: flex;
}

#sellerOrderDetailModal .modal-content {
    width: min(760px, 94vw);
    max-width: 760px !important;
    max-height: 86vh;
    overflow-y: auto;
    overflow-x: hidden;

    position: relative;
    box-sizing: border-box;

    padding: 28px 30px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);

    font-family: 'Sarabun', sans-serif;
    color: #26332b;
}

/* ปุ่มปิด */
#sellerOrderDetailModal > .modal-content > button {
    position: absolute;
    top: 18px;
    right: 18px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d9e3dc;
    border-radius: 50%;
    background: #ffffff;
    color: #526057;

    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    transition: .2s ease;
}

#sellerOrderDetailModal > .modal-content > button:hover {
    background: #edf7ef;
    border-color: #7db88b;
    color: #1b6b30;
}

/* =========================================================
   ปุ่ม "ดูรายละเอียด"
   ========================================================= */

.seller-db-order-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.seller-db-btn {
    appearance: none;
    border: 1px solid #2d8b46;
    border-radius: 9px;

    min-height: 36px;
    padding: 7px 15px;

    background: #ffffff;
    color: #216d35;

    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    font-weight: 600;

    line-height: 1.2;
    white-space: nowrap;

    cursor: pointer;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.seller-db-btn:hover {
    background: #edf8ef;
    border-color: #257b3d;
    color: #185c2b;
    box-shadow: 0 3px 10px rgba(45, 139, 70, .12);
}

.seller-db-btn:active {
    transform: translateY(1px);
}

.seller-db-btn.primary {
    background: #2d8b46;
    border-color: #2d8b46;
    color: #ffffff;
}

.seller-db-btn.primary:hover {
    background: #236f38;
    border-color: #236f38;
    color: #ffffff;
}

/* =========================================================
   หัวข้อรายละเอียด
   ========================================================= */

#sellerOrderDetailContent h3 {
    margin: 0;
    padding-right: 45px;

    color: #175d2b;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
}

#sellerOrderDetailContent h4 {
    margin: 0 0 12px;

    color: #1b5e20;
    font-size: 17px;
    font-weight: 700;
}

#sellerOrderDetailContent .detail-section {
    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #e8eee9;
}

/* =========================================================
   ข้อมูลผู้ซื้อ / ที่อยู่
   ========================================================= */

.seller-db-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;

    margin-top: 12px;
}

.seller-db-detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    min-height: 46px;
    box-sizing: border-box;

    padding: 11px 0;

    border-bottom: 1px solid #edf1ee;
}

.seller-db-detail-label {
    flex: 0 0 auto;

    color: #78847c;
    font-size: 14px;
    font-weight: 500;
}

.seller-db-detail-value {
    flex: 1;
    min-width: 0;

    color: #27342c;
    font-size: 14px;
    font-weight: 600;

    text-align: right;
    line-height: 1.65;

    overflow-wrap: anywhere;
    word-break: break-word;
}

/* =========================================================
   รายการสินค้า
   ========================================================= */

.seller-db-items {
    margin-top: 8px;

    border: 1px solid #e5ebe6;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.seller-db-item {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;

    border-bottom: 1px solid #edf1ee;
}

.seller-db-item:last-child {
    border-bottom: 0;
}

.seller-db-item img {
    flex: 0 0 72px;

    width: 72px;
    height: 72px;

    object-fit: cover;

    border: 1px solid #e0e7e1;
    border-radius: 10px;

    background: #f4f7f4;
}

.seller-db-item-main {
    flex: 1;
    min-width: 0;
}

.seller-db-item-name {
    color: #1b5e20;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

.seller-db-item-meta {
    margin-top: 4px;

    color: #7a847d;
    font-size: 13px;
    line-height: 1.5;
}

.seller-db-item-total {
    flex: 0 0 auto;

    color: #23803d;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

/* =========================================================
   หลักฐานการชำระเงิน
   ========================================================= */

.seller-db-slip {
    margin-top: 14px;
    padding: 16px;

    border: 1px solid #e1e9e2;
    border-radius: 12px;

    background: #f8fbf8;
}

.seller-db-slip strong {
    display: block;
    margin-bottom: 8px;

    color: #1b5e20;
    font-size: 15px;
}

.seller-db-slip img {
    display: block;

    width: auto;
    max-width: 260px;
    max-height: 320px;

    margin-top: 10px;

    object-fit: contain;

    border: 1px solid #dfe6e0;
    border-radius: 10px;

    background: #ffffff;

    cursor: pointer;
}

/* =========================================================
   ปุ่มด้านล่าง Modal
   ========================================================= */

.seller-db-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid #e7ece8;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 700px) {

    #sellerOrderDetailModal {
        padding: 12px;
    }

    #sellerOrderDetailModal .modal-content {
        width: 100%;
        max-height: 90vh;
        padding: 22px 18px;
        border-radius: 15px;
    }

    .seller-db-detail-grid {
        grid-template-columns: 1fr;
    }

    .seller-db-detail-row {
        flex-direction: column;
        gap: 4px;
    }

    .seller-db-detail-value {
        text-align: left;
    }

    .seller-db-item {
        align-items: flex-start;
    }

    .seller-db-item img {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }

    .seller-db-item-total {
        font-size: 14px;
    }
}


/* Tracking number dialog */
.seller-tracking-modal {
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10020;
}

.seller-tracking-modal.show { display: flex; }

.seller-tracking-card {
    position: relative;
    width: min(100%, 440px);
    box-sizing: border-box;
    padding: 28px;
    border: 1px solid #dfe9e1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(30, 70, 42, .18);
}

.seller-tracking-icon { font-size: 32px; margin-bottom: 8px; }
.seller-tracking-card h3 { margin: 0; color: #1b5e20; font-size: 22px; }
.seller-tracking-card > p { margin: 6px 0 20px; color: #6d786f; }
.seller-tracking-card label { display: block; margin-bottom: 7px; color: #334238; font-weight: 700; }
.seller-tracking-card label span { color: #c62828; }

.seller-tracking-card input {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cfdad1;
    border-radius: 9px;
    font: inherit;
    color: #26332b;
}

.seller-tracking-card input:focus {
    outline: none;
    border-color: #2d8b46;
    box-shadow: 0 0 0 3px rgba(45, 139, 70, .12);
}

.seller-tracking-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid #dfe6e1;
    border-radius: 50%;
    background: #fff;
    color: #627067;
    cursor: pointer;
}

.seller-tracking-error { min-height: 22px; padding-top: 5px; color: #c62828; font-size: 14px; }
.seller-tracking-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.seller-tracking-actions button { min-height: 44px; padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.seller-tracking-cancel { border: 1px solid #ccd7ce; background: #fff; color: #4f5e53; }
.seller-tracking-submit { border: 1px solid #2d8b46; background: #2d8b46; color: #fff; }
.seller-tracking-submit:hover { background: #236f38; }
.seller-db-detail-loading, .seller-db-detail-error { padding: 34px 12px; text-align: center; color: #66736a; }
.seller-db-detail-error { color: #c62828; }

@media (max-width: 520px) {
    .seller-tracking-card { padding: 24px 18px; }
    .seller-tracking-actions { flex-direction: column-reverse; }
    .seller-tracking-actions button { width: 100%; }
}
