@media print {

    /* ==========================================================================
       1. PAGE SETUP & GLOBAL RESETS
       ========================================================================== */
    @page {
        size: letter portrait; /* or A4 portrait */
        margin: 15mm 15mm 15mm 15mm; /* top right bottom left */
    }
    /* Force Color and Background Rendering */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background-color: #ffffff;
        color: #000000;
        font-size: 10.5pt;
        line-height: 1.3;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        text-shadow: none;
    }

    /* Reset container widths for printing */
    .site-content,
    .col-main,
    #page,
    #content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-top: 0;
        float: none;
    }

    .col-main {
        width: 7.4in; /* Kept your exact print boundary width */
    }


    /* ==========================================================================
       2. HIDE SITE CHROME, NAV, AND UNWANTED ELEMENTS
       ========================================================================== */
    #masthead,
    #colophon,
    .header-container,
    .footer-wrapper,
    .contain-to-grid.sticky,
    #search_mini_form,
    .col-left.sidebar,
    [id^='ui-id-'],
    .btn-primary-outline,
    .no-print,
    button,
    .btn,
    body.enduser-invoices-view .sticky,
    body.enduser-invoices-view aside,
    body.enduser-invoices-view .exit-off-canvas,
    body.enduser-invoices-view .header-container,
    body.enduser-invoices-view .footer-wrapper,
    body.enduser-invoices-view .col-left.sidebar {
        display: none;
    }


    /* ==========================================================================
       3. TYPOGRAPHY & LINKS
       ========================================================================== */
    h1 {
        font-size: 14pt;
    }

    .page-title {
        text-align: center;
    }

    .review-label {
        font-weight: bold;
    }

    hr {
        margin: 0 0 10px 0;
        border: 0;
        border-top: 1px solid #ccc;
    }

    ul {
        line-height: 1.2;
    }

    a {
        color: #000000;
        text-decoration: none;
    }
    /* Suppress Appended Link URLs */
    a[href]::after {
        content: "" !important;
    }


    /* ==========================================================================
       4. EXPAND ACCORDIONS & PANELS FOR PRINTING
       ========================================================================== */
    [id^='panel'] {
        display: block;
        border: none;
        padding: 0;
        margin: 0;
    }

    #dealer-receipt-accordion {
        margin: 0 0 5px 0;
    }

    #dealer-receipt-accordion .accordion-navigation > a {
        background-color: #ffffff;
        color: #000000;
        box-shadow: none;
        font-size: 11pt;
    }


    /* ==========================================================================
       5. ORDER & INVOICE LAYOUT COMPONENTS
       ========================================================================== */
    div.row div {
        padding: 0;
    }

    .order-wrapper {
        border: 1px solid #000000;
        width: 92%;
        font-weight: bold;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .order-wrapper div {
        width: 31%;
    }

    .order-wrapper .orderPO span {
        padding-right: 2%;
    }

    .invoice-header-wrapper .logo {
        width: 25%;
    }

    .invoice-header-wrapper .label {
        width: 50%;
    }

    .invNum-wrapper .invNum span {
        padding-right: 84px;
    }

    .dr-wrapper .drNum span {
        padding-right: 25px;
    }

    .drNumber-wrapper .drNumber span {
        padding-right: 41px;
    }


    /* ==========================================================================
       6. LINE ITEMS & TABLES
       ========================================================================== */
    table {
        width: 100%;
        border-collapse: collapse;
    }

    table th {
        font-size: 10pt;
    }

    .table-minimum td {
        border-top: 1px solid #d9d9d9;
        font-weight: normal;
        padding: 0;
    }

    /* Prevent line items and summaries from breaking mid-row */
    tr,
    .item-wrapper,
    .totals-wrapper {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .item-wrapper div {
        display: inline-block;
        width: 105px;
        text-align: center;
        vertical-align: top;
    }

    .item-wrapper div:last-child {
        padding: 0;
    }

    .item-wrapper .item {
        text-align: left;
        font-size: 10.5pt;
    }

    .item-wrapper .custItem,
    .item-wrapper .itemDesc {
        text-align: left;
    }

    .item-wrapper .shipQty {
        font-size: 10.5pt;
    }

    .item-wrapper .extPrice {
        padding-left: 25px;
    }

    .item-label-wrapper {
        border: 1px solid #000000;
        break-after: avoid;
        page-break-after: avoid;
    }

    .item-label-wrapper .label {
        padding-right: 7%;
        width: 105px;
        font-size: 11pt;
        font-weight: bold;
    }

    .item-label-wrapper .DescLabel {
        padding-right: 10%;
    }

    .totals-wrapper div {
        display: inline-block;
        padding-right: 11%;
        width: 105px;
        font-weight: bold;
    }

    .totals-wrapper div:last-child {
        padding-right: 15%;
    }

    .totals-wrapper .labelTotal {
        width: 265px;
        text-align: right;
    }

    .totals-wrapper .qtyTotal {
        padding-right: 11%;
    }

    .totals-wrapper .priceTotal {
        padding-right: 10%;
    }

    /*******************************************************************************
     * EXPAND ALL ACCORDION PANELS
     ******************************************************************************/
    /* Force all accordion panel contents to be visible */
    #dealer-receipt-accordion .content,
    #dealer-receipt-accordion .accordion-navigation .content {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    /* Clean up accordion links/headers for the printed document */
    #dealer-receipt-accordion .accordion-section-title {
        pointer-events: none; /* Prevents cursor changes in PDF export */
        text-decoration: none;
        color: #000000 !important;
        font-weight: bold;
    }

    /* Prevent panels from breaking awkwardly across page splits */
    #dealer-receipt-accordion .accordion-navigation {
        break-inside: avoid;
        page-break-inside: avoid;
    }    
}