.mobile-panel-links,
.od-mobile-channel,
.pd-mobile-action {
    display: none;
}

.mobile-menu-toggle {
    color: inherit;
    background: transparent;
    border: 0;
}

.od-list-message {
    color: var(--bs-secondary-color, #64748b);
    font-size: .875rem;
}

.od-list-message:has(:empty + [hidden]) {
    display: none;
}

/* Keep the previous page visible during a reload. The live regions report progress. */
.mobile-orders .dataTables_wrapper:has(#orders-table tbody tr[data-id]) .dataTables_processing,
.mobile-products .dataTables_wrapper:has(#zero-config tbody tr[data-id]) .dataTables_processing {
    display: none !important;
}

@media (max-width: 991px) {
    .header-container .mobile-menu-toggle,
    #sidebar .mobile-menu-toggle,
    .header-container :is(#incident-bell-item, #user-bell-item, .user-profile-dropdown) > .nav-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #sidebar .mobile-panel-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 12px;
        margin: 0;
        border-bottom: 1px solid rgba(127, 127, 127, .3);
    }

    #sidebar .mobile-panel-links a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 8px;
        border-radius: 8px;
        border: 1px solid rgba(127, 127, 127, .35);
    }

    #sidebar .mobile-panel-links a[aria-current="page"] {
        background: #4361ee;
        color: #fff;
    }

    .main-container:not(.sbar-open) #sidebar {
        visibility: hidden;
    }
}

@media (max-width: 767px) {
    #loginForm .form-control,
    #otpLoginSection .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    #loginForm .iti,
    #otpLoginSection .iti {
        width: 100%;
    }

    #loginForm .form-check-inline {
        margin-inline-end: .5rem;
    }

    #loginForm :is(button, a.btn),
    #otpLoginSection :is(button, a.btn) {
        min-height: 44px;
    }

    .header-container .navbar #top-notice {
        display: none;
    }

    .header-container .navbar {
        position: relative;
    }

    .header-container .navbar > ul:has(#user-bell-item),
    .header-container .navbar :is(#incident-bell-item, #user-bell-item) {
        position: static !important;
    }

    .header-container .navbar :is(#incident-bell-item, #user-bell-item) .dropdown-menu {
        position: absolute !important;
        inset: 100% 12px auto auto !important;
        transform: none !important;
        min-width: 0 !important;
        width: min(20rem, calc(100vw - 24px));
    }

    :is(.mobile-orders, .mobile-products, .mobile-product-edit) #content > .layout-px-spacing {
        padding-inline: 12px !important;
    }

    .mobile-orders .od-page-header,
    .mobile-products .products-dashboard-page .pd-page-header {
        padding-block: 16px 12px;
    }

    .mobile-orders .od-page-header-actions,
    .mobile-orders .od-search-wrap,
    .mobile-orders .od-search-wrap .od-search-input,
    .mobile-products .products-dashboard-page .pd-search-wrap {
        width: 100%;
        max-width: 100%;
    }

    :is(.mobile-orders, .mobile-products, .mobile-product-edit)
        :is(.form-control, .form-select, .od-search-input, .pd-search-input, .pd-ctrl-select, .pd-sort-select) {
        min-height: 44px;
        font-size: 16px !important;
        min-width: 0;
        max-width: 100%;
    }

    :is(.mobile-orders, .mobile-products) :is(.od-kpi-row, .pd-kpi-row),
    .mobile-orders .od-view-toggle,
    .mobile-orders .od-table-card :is(.dataTables_filter, .dataTables_length),
    .mobile-orders .od-channel-pills-group {
        display: none;
    }

    .mobile-orders .od-channels-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
        padding: 8px;
    }

    .mobile-orders .od-mobile-channel {
        display: block;
    }

    .mobile-orders .od-filter-trigger-btn {
        min-height: 44px;
        padding-inline: 10px;
    }

    .mobile-orders .od-list-controls {
        gap: 6px;
    }

    .mobile-orders .od-list-message {
        padding-block: 6px;
    }

    .mobile-orders .od-filter-panel,
    .mobile-orders #orderDetailCanvas {
        max-width: 100%;
    }

    .mobile-orders .od-filter-panel .offcanvas-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .mobile-products .products-dashboard-page .pd-controls-right {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-products .products-dashboard-page .pd-control-group {
        display: grid;
        gap: 4px;
    }

    .mobile-products .pd-filter-bar :is(.marketplace-filter, .pd-qf-btn),
    .mobile-products .pd-header-actions button,
    :is(.mobile-orders, .mobile-products, .mobile-product-edit) .modal :is(.btn, .btn-close),
    :is(.mobile-orders, .mobile-products) .swal2-actions button {
        min-height: 44px;
    }

    .mobile-orders .od-table-card,
    .mobile-products .products-dashboard-page .pd-table-card {
        background: transparent !important;
        border: 0;
        box-shadow: none;
    }

    :is(.mobile-orders #orders-table, .mobile-products #zero-config),
    :is(.mobile-orders #orders-table, .mobile-products #zero-config) tbody {
        display: block;
        width: 100%;
    }

    :is(.mobile-orders #orders-table, .mobile-products #zero-config) thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    :is(.mobile-orders #orders-table, .mobile-products #zero-config) tfoot {
        display: none;
    }

    :is(.mobile-orders #orders-table, .mobile-products #zero-config) tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0 0 12px;
        border: 1px solid #dbe3ee;
        border-radius: 12px;
        overflow: hidden;
    }

    .mobile-orders .od-table-card #orders-table tbody td,
    .mobile-products .products-dashboard-page .pd-table-card #zero-config tbody td {
        grid-column: 1 / -1;
        display: block;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0;
        padding: 9px 12px !important;
        border-radius: 0;
        border-inline: 0;
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: start !important;
        background: #fff;
    }

    .mobile-orders #orders-table .ord-identity-cell {
        display: flex;
        flex-flow: row wrap;
        align-items: center;
        gap: 6px 10px;
    }

    .mobile-orders #orders-table :is(.ord-btn, .btn, .open-order-canvas, .copy-btn),
    .mobile-products #zero-config :is(.btn, .pd-actions-menu-toggle) {
        min-height: 44px;
        min-width: 44px;
        max-width: 100%;
        white-space: normal;
    }

    .mobile-products .products-dashboard-page .pd-table-card #zero-config tbody tr[data-id]
        > :is(td:nth-child(3), td:nth-child(4)) {
        grid-column: auto;
    }

    .mobile-products #zero-config .pd-actions-cell {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .mobile-products .products-dashboard-page #zero-config tbody td:nth-child(7) {
        position: static;
        box-shadow: none;
    }

    .mobile-products .pd-mobile-action {
        display: inline-flex;
        align-items: center;
    }

    :is(.mobile-orders, .mobile-products) .dataTables_paginate ul.pagination {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }

    :is(.mobile-orders, .mobile-products) .dataTables_paginate .page-link {
        min-width: 44px;
        min-height: 44px;
        display: grid;
        place-items: center;
    }

    :is(.mobile-orders, .mobile-products, .mobile-product-edit) :is(.modal-title, .modal-body, .swal2-popup) {
        overflow-wrap: anywhere;
    }

    .mobile-orders #manual-invoice-file {
        width: 100%;
    }
}
