/* Keep scrollable tables clipped while their action menus are visible. */
@media (min-width: 768px) {
    body.commerce-history-page .commerce-history-card .dataTables_scroll.hobi-table-actions-managed.commerce-dropdown-open {
        overflow: hidden !important;
    }
    body.commerce-history-page .commerce-history-card .dataTables_scrollBody.hobi-table-actions-managed.commerce-dropdown-open {
        overflow-x: auto !important;
        overflow-y: auto !important;
    }
    body.commerce-history-page .commerce-history-card .dataTables_scrollBody.hobi-table-actions-managed td:first-child.commerce-dropdown-open {
        position: sticky !important;
        left: 0;
    }
}

body .dataTables_scrollBody.hobi-table-actions-managed.of-visible {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* Commerce switches from a scrollable table to separate cards on phones. */
@media (max-width: 767px) {
    body.commerce-history-page .commerce-history-card .dataTables_scrollBody.hobi-table-actions-managed.of-visible {
        overflow: visible !important;
    }
}

/* The menu stays in its original DOM position, so action handlers retain their
   normal ancestors. JavaScript positions it in the viewport while open. */
body .dropdown-menu.hobi-table-actions-floating {
    position: fixed !important;
    margin: 0 !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2000 !important;
    box-sizing: border-box;
    max-width: calc(100vw - 16px) !important;
    min-width: min(210px, calc(100vw - 16px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}
body .dropdown-menu.hobi-table-actions-floating > li > a {
    white-space: normal;
    overflow-wrap: anywhere;
}
