@media print {
    .order_list-item-view {
        @page { size: landscape; margin: 10mm; }
        .page-header,
        .page-footer,
        .nav-sections,
        .breadcrumbs,
        .order-list-toolbar {
            display: none !important;
        }

        .table-wrapper {
            overflow: visible !important;
        }

        .table-mobile-1col {
            display: table !important;
            width: 100% !important;
        }

        .table-mobile-1col thead {
            display: table-header-group !important;
        }

        .table-mobile-1col tbody {
            display: table-row-group !important;
        }

        .table-mobile-1col tr {
            display: table-row !important;
            page-break-inside: avoid;
            break-inside: avoid;
        }

        .table-mobile-1col td,
        .table-mobile-1col th {
            display: table-cell !important;
            padding: 4px 6px !important;
            font-size: 9pt !important;
            vertical-align: top !important;
            page-break-inside: avoid;
            break-inside: avoid;
        }

        /* Firefox: prevent orphaned text lines inside cells */
        .table-mobile-1col td {
            orphans: 4;
            widows: 4;
        }

        .table-mobile-1col td::before {
            display: none !important;
        }
    }

    .saporder-order-view,
    .sales-order-view {
        @page { size: landscape; margin: 10mm; }

        .page-header,
        .page-footer,
        .nav-sections,
        .breadcrumbs,
        .order-list-toolbar,
        .page-title,
        a,
        button {
            display: none !important;
        }

        /* ---------- FORCE DESKTOP LAYOUT ---------- */

        .order-container {
            width: 100% !important;
        }

        .order-container > div:first-child {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
            gap: 20px !important;
        }

        /* Purchase / shipping / payment row */
        .order-container > div:nth-child(2) {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
        }

        .order-container > div:first-child > div:nth-child(1) {
            order: 0 !important;  /* address block — comes first (left) */
        }

        .order-container > div:first-child > div:nth-child(2) {
            order: 0 !important;  /* order info block — comes second (right) */
            text-align: right !important;
            min-width: 220px !important;
        }

        /* ---------- TABLE FIX ---------- */

        .table-wrapper {
            overflow: visible !important;
        }

        table {
            width: 100% !important;
            border-collapse: collapse !important;
        }

        thead {
            display: table-header-group !important;
        }

        tbody {
            display: table-row-group !important;
        }

        tfoot {
            display: table-row-group !important;
        }

        tr {
            display: table-row !important;
            page-break-inside: avoid;
            break-inside: avoid;
        }

        td,
        th {
            display: table-cell !important;
            font-size: 9pt !important;
            padding: 4px 6px !important;
            vertical-align: top !important;
            color: #091F2C !important;
        }

        th.qty-to-order,
        td.qty-to-order {
            display: none !important;
        }

        th.select,
        td.select {
            display: none !important;
        }

        td::before {
            display: none !important;
        }

        /* prevent weird wrapping */
        .items-qty li {
            display: flex !important;
            justify-content: space-between !important;
        }

        /* prevent row splitting */
        tr,
        td,
        th {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }

    }
}
