/* Print Styles for Compare Page - Works for both Table and Card views */
@media print {
    /* Hide non-printable elements */
    .compare-header-section,
    .btn,
    .actions,
    .view-options,
    .compare-list-remove {
        display: none !important;
    }

    /* IMPORTANT: Hide cards, always show table for printing */
    .compare-cards-wrapper {
        display: none !important;
    }

    /* Show print header */
    .print-header {
        display: block !important;
        margin-bottom: 2rem;
    }

    /* ALWAYS show and make table visible for printing */
    .compare-list-table-wrapper {
        width: 100% !important;
        overflow: visible !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        height: auto !important;
    }

    .compare-list-table {
        width: 100% !important;
        table-layout: auto;
        border-collapse: collapse;
        font-size: 12px;
        display: table !important;
        visibility: visible !important;
    }

    .compare-list-table tr td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        text-align: left;
        vertical-align: top;
        word-wrap: break-word;
        overflow: hidden !important;
        position: relative !important;
    }

    /* Constrain all HTML content within table cells */
    .compare-list-table tr td * {
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        position: relative !important;
        box-sizing: border-box !important;
    }

    /* Fix for lists and formatted content */
    .compare-list-table tr td ul,
    .compare-list-table tr td ol {
        margin: 0 0 0 20px !important;
        padding: 0 !important;
        list-style-position: inside !important;
    }

    .compare-list-table tr td li {
        margin: 4px 0 !important;
        padding: 0 !important;
        font-size: 10px !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
    }

    /* Remove any absolute/fixed positioning from content */
    .compare-list-table tr td div,
    .compare-list-table tr td span,
    .compare-list-table tr td p {
        position: relative !important;
        display: block !important;
        max-width: 100% !important;
    }

    /* Hide tooltips, popovers, and highlights in print */
    .compare-list-table tr td .tooltip,
    .compare-list-table tr td .popover,
    .compare-list-table tr td .highlight,
    .compare-list-table tr td mark {
        display: none !important;
    }

    .compare-list-table tr:nth-child(even) {
        background: #f9f9f9 !important;
    }

    .compare-list-table tr td:first-child {
        font-weight: bold;
        color: #333 !important;
        background: #f5f5f5 !important;
        width: 25%;
    }

    .compare-list-product-img {
        width: auto;
        max-width: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    .compare-list-product-img img {
        max-height: 100px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .compare-list-table-content {
        font-size: 11px !important;
        color: #333 !important;
        font-weight: 400;
        line-height: 1.3;
    }

    /* Ensure table rows don't break across pages */
    .compare-list-table tr {
        page-break-inside: avoid;
    }

    /* Page setup */
    @page {
        margin: 0.75in;
        size: landscape;
    }

    body {
        font-family: Arial, sans-serif;
        font-size: 12px;
        color: #333;
        line-height: 1.4;
    }

    /* Print title */
    .print-header h2 {
        font-size: 18px;
        margin-bottom: 1rem;
        text-align: center;
        color: #333;
    }

    /* Restore the original table styles for printing */
    .compare-list-table tr td {
        border: 1px solid #f1f1f1;
        padding: 11px;
        text-align: left;
    }

    .compare-list-table tr:nth-child(even) {
        background: #fafafa;
    }

    .compare-list-table tr td:first-child {
        min-width: 200px;
        max-width: 300px;
        font-weight: bold;
        color: #010101;
        page-break-inside: avoid;
    }

    .compare-list-table .compare-list-product-img {
        height: auto;
        width: 230px;
        margin: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .compare-list-table .compare-list-product-img img {
        height: auto;
        max-height: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .compare-list-table .compare-list-table-content {
        font-size: 1rem;
        color: #010101;
        font-weight: 400;
    }

    /* Force all content to stay within table cell boundaries */
    .compare-list-table td {
        overflow: hidden !important;
        max-width: 100% !important;
    }

    /* Remove background colors and highlights from formatted content */
    .compare-list-table td * {
        background-color: transparent !important;
        background: none !important;
    }

    /* Ensure first column (labels) stay solid background */
    .compare-list-table tr td:first-child {
        background: #f5f5f5 !important;
    }

    .compare-list-table tr:nth-child(even) td:first-child {
        background: #f5f5f5 !important;
    }

    /* Remove any margin/padding that might cause overflow */
    .compare-list-table td ul,
    .compare-list-table td ol,
    .compare-list-table td li,
    .compare-list-table td p,
    .compare-list-table td div {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 0 !important;
    }
}