@media print {
    /* Base page setup */
    html, body {
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
        font-family: Verdana, sans-serif !important;
    }

    /* Main content flow */
    .page-wrapper, main, .content, .container, .wrapper, .grid, .section {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide non-essential elements */
    header, footer, nav, .menu, .sidebar, .slider, .carousel, .popup, .ads, iframe, button {
        display: none !important;
    }

    /* Explicit footer removal (more specific targeting) */
    footer, 
    .footer, 
    .site-footer, 
    .footer-wrapper, 
    .footer-content, 
    .footer-inner, 
    .print-footer,
    .footer * { 
        display: none !important;
    }

    /* Images scale to page width */
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Remove backgrounds & shadows */
    * {
        background: none !important;
        box-shadow: none !important;
    }

    /* Text and headings */
    h1, h2, h3, h4, h5, h6, p, li, ul, ol {
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
        break-inside: avoid !important;
        page-break-inside: auto !important;
    }

    /* Show URLs for links */
    a:after {
        content: " (" attr(href) ")" !important;
    }

    /* --- Tables --- */
    .table-forcing, .responsive-table, .table-wrapper, .datatable {
        table-layout: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        word-wrap: break-word !important;
        overflow: visible !important;
    }

    .table-forcing th, .table-forcing td {
        display: table-cell !important;
        word-break: break-word !important; /* Allow text wrapping */
        white-space: normal !important;
        padding: 4px 6px !important;
        border: 1px solid #000 !important;
    }

    /* Shrink input fields to fit table cells */
    .table-forcing input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: inline-block !important;
        font-size: 12px !important;
        padding: 2px 4px !important;
        border: none !important;
        background: none !important;
    }

    /* Prevent inputs from breaking the table layout */
    .table-forcing input[type="text"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: inline-block !important;
    }

    /* Avoid breaking rows */
    .table-forcing tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    /* Remove scroll wrappers added by JS */
    .table-wrapper, .responsive-table {
        overflow: visible !important;
        height: auto !important;
    }
	@media print {
    /* Only hide footer on print-friendly pages */
    body.print-friendly footer, 
    body.print-friendly .footer, 
    body.print-friendly .site-footer, 
    body.print-friendly .footer-wrapper, 
    body.print-friendly .footer-content {
        display: none !important;
    }
	@media print {
    /* Hide the complex footer */
    footer, .footer, .site-footer, .footer-wrapper {
        display: none !important;
    }

    /* Ensure footer 3 (minimal) is shown */
    #footer3 {
        display: block !important;
    }
}

