/* assets/css/responsive-tables.css - tables on phones and tablets (linked from includes/brand_head.php)
 * Tables keep their natural column widths and scroll left/right inside their own box,
 * instead of squeezing every column or pushing the whole page sideways. */

@media (max-width: 768px) {
    /* Page containers may shrink to the screen (a wide table must not widen the page) */
    main.main,
    .main,
    .main-wrapper,
    .main-content {
        min-width: 0;
    }

    /* Public pages: <body> is a centred flex column, so <main> would grow to fit a wide table */
    body > main.main {
        width: 100%;
        max-width: 100%;
        align-self: stretch;
    }

    /* The boxes around tables scroll sideways with the finger */
    .table-wrapper,
    .table-wrap,
    .table-responsive,
    .table-scroll,
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
        max-width: 100%;
    }

    /* Data tables in the merchant and admin areas: natural width, one line per cell */
    .main-content table,
    .main > .main-content table,
    .main .table-container table {
        min-width: max-content !important;
    }

    .main-content table th,
    .main-content table td,
    .main .table-container table th,
    .main .table-container table td {
        white-space: nowrap;
    }

    /* Thin, visible scrollbar so people can see the table moves sideways */
    .table-wrapper::-webkit-scrollbar,
    .table-wrap::-webkit-scrollbar,
    .table-scroll::-webkit-scrollbar,
    .comparison-table-wrapper::-webkit-scrollbar {
        height: 6px;
    }

    .table-wrapper::-webkit-scrollbar-thumb,
    .table-wrap::-webkit-scrollbar-thumb,
    .table-scroll::-webkit-scrollbar-thumb,
    .comparison-table-wrapper::-webkit-scrollbar-thumb {
        background: rgba(106, 138, 160, 0.45);
        border-radius: 6px;
    }
}
