/* Responsive checkout dialogs: keep every invoice field visible on narrow screens. */
@media (max-width: 680px) {
    .tsports-court-checkout-dialog,
    .tsports-social-close-dialog {
        max-width: 100vw !important;
        min-width: 0 !important;
    }

    .tsports-court-checkout-head > div,
    .tsports-social-close-head > div,
    .tsports-court-checkout-body,
    .tsports-social-close-body,
    .tsports-court-checkout-section,
    .tsports-social-close-table-wrap {
        min-width: 0 !important;
    }

    .tsports-court-checkout-section-title,
    .tsports-social-close-section-title {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.4 !important;
    }

    /* Court checkout: turn wide desktop tables into readable stacked cards. */
    .tsports-court-checkout-table-wrap {
        overflow: visible !important;
        max-width: 100% !important;
    }

    .tsports-court-checkout-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .tsports-court-checkout-table thead {
        display: none !important;
    }

    .tsports-court-checkout-table tbody {
        display: grid !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    .tsports-court-checkout-table tr {
        display: grid !important;
        min-width: 0 !important;
        padding: 6px 10px !important;
        border: 1px solid #e5ebf1 !important;
        border-radius: 10px !important;
        background: #fff !important;
    }

    .tsports-court-checkout-table td {
        display: grid !important;
        grid-template-columns: minmax(88px, 38%) minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 10px !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 7px 0 !important;
        border-bottom: 1px solid #eef2f6 !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .tsports-court-checkout-table td:last-child {
        border-bottom: 0 !important;
    }

    .tsports-court-checkout-table td::before {
        color: #607489 !important;
        font-size: .72rem !important;
        font-weight: 800 !important;
        line-height: 1.4 !important;
    }

    .tsports-court-checkout-section:nth-of-type(1) .tsports-court-checkout-table td:nth-child(1)::before { content: "Khoản"; }
    .tsports-court-checkout-section:nth-of-type(1) .tsports-court-checkout-table td:nth-child(2)::before { content: "Trạng thái"; }
    .tsports-court-checkout-section:nth-of-type(1) .tsports-court-checkout-table td:nth-child(3)::before { content: "SL"; }
    .tsports-court-checkout-section:nth-of-type(1) .tsports-court-checkout-table td:nth-child(4)::before { content: "Thành tiền"; }

    .tsports-court-checkout-section:nth-of-type(2) .tsports-court-checkout-table td:nth-child(1)::before { content: "Người chơi"; }
    .tsports-court-checkout-section:nth-of-type(2) .tsports-court-checkout-table td:nth-child(2)::before { content: "Giờ vào"; }
    .tsports-court-checkout-section:nth-of-type(2) .tsports-court-checkout-table td:nth-child(3)::before { content: "Đã thu"; }
    .tsports-court-checkout-section:nth-of-type(2) .tsports-court-checkout-table td:nth-child(4)::before { content: "Chưa thu"; }
    .tsports-court-checkout-section:nth-of-type(2) .tsports-court-checkout-table td:nth-child(5)::before { content: "Phí dịch vụ"; }

    .tsports-court-checkout-empty {
        display: block !important;
        text-align: center !important;
        padding: 14px 8px !important;
    }

    .tsports-court-checkout-empty::before {
        content: none !important;
    }

    /* Social checkout: the two columns should fit the viewport without horizontal scrolling. */
    .tsports-social-close-table-wrap {
        overflow-x: hidden !important;
    }

    .tsports-social-close-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .tsports-social-close-table th,
    .tsports-social-close-table td {
        min-width: 0 !important;
        padding: 11px 12px !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
    }

    .tsports-social-close-table th:first-child,
    .tsports-social-close-table td:first-child {
        width: 58% !important;
    }

    .tsports-social-close-table th:last-child,
    .tsports-social-close-table td:last-child {
        width: 42% !important;
        text-align: right !important;
        white-space: normal !important;
    }

    .tsports-social-close-total {
        min-width: 0 !important;
        flex-wrap: wrap !important;
    }

    .tsports-social-close-total strong {
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .tsports-court-checkout-foot,
    .tsports-social-close-foot {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 2 !important;
    }
}

@media (max-width: 390px) {
    .tsports-court-checkout-head h2,
    .tsports-social-close-head h2 {
        font-size: 1.18rem !important;
    }

    .tsports-court-checkout-head p,
    .tsports-social-close-head p {
        font-size: .82rem !important;
    }

    .tsports-court-checkout-table td {
        grid-template-columns: minmax(78px, 35%) minmax(0, 1fr) !important;
        font-size: .8rem !important;
    }

    .tsports-social-close-table th,
    .tsports-social-close-table td {
        padding: 10px 9px !important;
        font-size: .8rem !important;
    }

    .tsports-court-checkout-foot,
    .tsports-social-close-foot {
        gap: 7px !important;
        padding: 10px !important;
    }

    .tsports-court-checkout-foot button,
    .tsports-social-close-foot button {
        font-size: .82rem !important;
        line-height: 1.3 !important;
    }
}
