/* Print stylesheet - uses system fonts */

    /* 1. Global Resets & Hiding */
    @page {
        margin: 1.5cm; /* Standard margins */
        size: A4;
    }

    header, footer, .language-switch, #whatsapp-widget,
    .btn, .btn-download-wrapper, .breadcrumbs, .back-link,
    .products-sidebar, .mobile-menu-toggle, .unit-toggle-container,
    #inquiry-form, .contact-form-wrapper, .form-privacy-notice,
    .alert, #cookie-consent, .product-header-nav,
    .grain-effect, .grain-overlay {
        display: none !important;
    }

    .print-only {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        opacity: 1;
        display: block !important;
    }

    #print-qrcode-container {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid #ccc;
        text-align: center;
        page-break-inside: avoid;
    }

    #print-qrcode-container p {
        font-size: 8pt;
        color: #666;
        margin-bottom: 0.5rem;
    }

    #print-qrcode-canvas {
        display: inline-block;
        max-width: 128px;
    }

    body {
        background: white !important;
        color: #111 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        font-family: 'Geist Sans', system-ui, sans-serif !important;
        font-size: 9pt;
        line-height: 1.3;
    }

    /* Main Container becomes the Table */
    .container {
        display: table !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-collapse: collapse;
    }

    /* 2. Print Header (Table Header Group) */
    .print-header {
        display: table-header-group !important;
        border-bottom: 2px solid #0056b3;
    }

    /* Helper for header content to act as a cell */
    .print-header > div, /* Assuming existing structure might need wrapper, but usually header content is enough */
    .print-header::before { /* Spacer if needed */
        display: block; 
    }
    
    /* We need to ensure the content inside header is styled correctly within the group */
    .print-header-inner { /* Virtual wrapper logic */
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Retain original header styling logic but apply to children */
    .print-logo { float: left; }
    .print-contact { float: right; }
    /* Clearfix for float if flex doesn't work well in table-header-group in some browsers */
    .print-header::after { content: ""; display: table; clear: both; }

    .print-logo img {
        height: 45px;
        width: auto;
    }

    .print-contact {
        text-align: right;
        font-size: 8pt;
        color: #333;
    }

    /* 3. Main Content (Table Row Group) */
    .product-details-container {
        display: table-row-group !important;
    }
    
    /* Since row-group expects rows, and we have div, browser usually handles anon table objects. 
       But to be safe, we might treat it as a cell? 
       Actually, standard "display: block" inside table layout is tricky.
       Better: .container is table. .print-header is header-group.
       The rest of children are ...?
       
       Alternative: Layout Wrapper.
       Let's stick to the safest bet: Header is Fixed, Content has margin.
       BUT the user said that failed.
       
       Let's go with the TABLE strategy but ensure valid structure.
       HTML:
       <div class="container"> -> TABLE
         <div class="print-header"> -> THEAD -> TR -> TD
         <article> -> TBODY -> TR -> TD
         <div class="print-footer"> -> TFOOT -> TR -> TD
       </div>
    */
    
    .print-header {
        display: table-header-group !important;
    }
    .print-header-content-wrapper { /* We might need to wrap content in product.php if this fails, but let's try styling the div itself */
        /* table-header-group behaves like a container of rows. */
        height: 3cm; /* Reserve space */
    }

    /* WAIT. display: table-header-group must contain table-row.
       If .print-header contains just divs, the browser wraps them in anon row/cell.
       This usually works.
    */

    /* Footer */
    .print-footer {
        display: table-footer-group !important;
    }
    
    .print-footer-content {
        display: block;
        padding-top: 1rem;
        border-top: 1px solid #ccc;
        text-align: center;
        font-size: 7pt;
        color: #666;
    }

    /* Hide pseudo-footer */
    body::after { display: none !important; }

    /* Fix header inner layout since flex might be lost in table conversion depending on browser depth */
    .print-header {
        /* It creates a row. */
    }

    /* 4. Product Main Grid */
    /* Restore standard grid behavior within the "cell" */
    .product-main-grid {
        display: grid !important;
        grid-template-columns: 35% 60% !important;
        gap: 5% !important;
        margin-bottom: 1.5rem;
        align-items: start;
        break-inside: avoid;
        page-break-inside: avoid;
    }


    .print-contact p {
        margin: 0;
        line-height: 1.2;
    }

    /* 3. Product Main Grid (Top Section) */
    .product-main-grid {
        display: grid !important;
        grid-template-columns: 35% 60% !important;
        gap: 5% !important;
        margin-bottom: 1.5rem;
        align-items: start;
        page-break-inside: avoid;
    }

    .product-image-col {
        margin: 0 !important;
        width: 100% !important;
    }

    .product-image-wrapper {
        border: 1px solid #ddd !important;
        border-radius: 4px;
        padding: 0.25rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .product-image-large {
        max-height: 250px;
        width: auto;
        object-fit: contain;
    }

    .product-info-wrapper {
        width: 100% !important;
    }

    .product-info-wrapper h1 {
        font-size: 20pt !important;
        color: #0056b3 !important;
        margin: 0 0 0.25rem 0 !important;
        line-height: 1.1;
    }

    .product-meta {
        font-size: 8.5pt !important;
        color: #666 !important;
        margin-bottom: 0.75rem !important;
        font-style: italic;
    }

    .product-price {
        font-size: 14pt !important;
        color: #333 !important;
        font-weight: bold;
        margin: 0.5rem 0 1rem 0 !important;
        display: block;
    }

    .product-description {
        font-size: 9pt !important;
        text-align: justify;
        color: #333;
        margin-bottom: 0;
    }

    /* 4. Technical Specs Section */
    .product-specs-section {
        margin-top: 1.5rem !important;
        border-top: 1px solid #ccc !important;
        padding-top: 1rem !important;
    }

    .section-title {
        font-size: 14pt !important;
        color: #0056b3 !important;
        margin-bottom: 1rem !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.25rem;
    }

    .section-title::after { display: none !important; }

    /* Specs Grid */
    .specs-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 2rem !important;
        align-items: start;
    }

    .tech-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        padding: 0 !important; 
        margin-bottom: 1rem;
        background: transparent !important;
        
        /* Enforce keeping content together */
        break-inside: avoid;
        page-break-inside: avoid;
        
        height: auto !important;
        position: relative;
        overflow: visible !important; /* Prevent clipping */
    }

    .tech-card h3 {
        font-size: 10pt !important;
        background-color: #f1f5f9 !important;
        color: #333 !important;
        padding: 0.35rem 0.75rem !important;
        margin: 0 !important;
        border-bottom: 1px solid #ddd;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Remove vertical line decoration from h3 */
    .tech-card h3::before { display: none !important; }

    /* Tables */
    .tech-table, .performance-table-horizontal {
        width: 100%;
        border-collapse: collapse;
        font-size: 8.5pt !important;
    }

    .tech-table th, .tech-table td,
    .performance-table-horizontal th, .performance-table-horizontal td {
        padding: 0.25rem 0.75rem !important;
        border-bottom: 1px solid #eee !important;
        vertical-align: middle;
    }

    .tech-table tr:last-child th, .tech-table tr:last-child td {
        border-bottom: none !important;
    }

    .tech-table tr:nth-child(even) {
        background-color: #f9fafb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tech-table th {
        width: 45%;
        color: #555;
        font-weight: 600;
        text-align: left;
    }
    
    .tech-table td {
        text-align: right;
        color: #111;
    }
    
    /* Performance Table Specifics */
    .performance-table-horizontal th {
        text-align: center;
        background: #f1f5f9 !important;
        font-weight: bold;
        font-size: 6pt !important;
    }
    
    .performance-table-horizontal td {
        text-align: center;
        font-size: 6pt !important;
        white-space: nowrap !important;
    }

    /* Charts & Diagrams */
    .performance-chart-container {
        height: auto !important;
        aspect-ratio: 4 / 3 !important;
        border: 1px solid #ddd !important;
        padding: 0.25rem !important;
        background: white !important;
        margin-bottom: 0.5rem;
        overflow: visible !important; /* Ensure chart isn't clipped in print */
    }

    .tech-card, .specs-grid > div { 
        page-break-inside: avoid; 
        break-inside: avoid;
    }

    /* Print Specific Helpers */
    .print-no-image {
        padding: 2rem;
        border: 1px dashed #ccc;
        text-align: center;
        color: #999;
    }

    .print-applications-container {
        margin-top: 1rem;
    }

    .print-applications-title {
        font-size: 10pt !important;
        margin-bottom: 0.5rem !important;
        color: #0056b3 !important;
    }

    .print-applications-list {
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        font-size: 8.5pt !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.25rem 1rem !important;
    }

    .print-applications-list li {
        position: relative !important;
        padding-left: 0.75rem !important;
    }

    .print-applications-list li::before {
        content: "›" !important;
        position: absolute !important;
        left: 0 !important;
        color: #0056b3 !important;
        font-weight: bold !important;
    }

    .print-tech-card-centered {
        grid-column: 1 / -1 !important;
        text-align: center !important;
    }

    .print-diagram-image {
        max-width: 100% !important;
        max-height: 300px !important;
        padding: 1rem !important;
    }

    .print-qrcode-container {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid #ccc;
        text-align: center;
        page-break-inside: avoid;
    }

    .print-qrcode-label {
        font-size: 7pt !important;
        margin-bottom: 0.5rem !important;
        color: #666 !important;
    }

    /* Custom Print Footer */
    /* Handled by .print-footer with display: table-footer-group */
    body::after {
        display: none !important;
    }
    
    /* Ensure table headers repeat if table breaks */
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }

    .table-note-wrapper { display: none !important; }
    .sticky-col { box-shadow: none !important; }

    .tech-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        margin-bottom: 1.5rem !important;
    }
    .tech-card__header {
        background-color: #f1f5f9 !important;
        padding: 0.5rem 1rem !important;
        border-bottom: 1px solid #ddd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .tech-card__title {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        color: #111 !important;
    }
    .tech-card__title::before {
        content: ""; display: block; width: 3px; height: 15px;
        background: var(--color-accent) !important; border-radius: 2px;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .table-standard th, .table-standard td,
    .performance-table-horizontal th, .performance-table-horizontal td,
    .dimensions-table-refined th, .dimensions-table-refined td {
        border: 1px solid #000 !important;
    }
    .table-standard th, .performance-table-horizontal th, .dimensions-table-refined th {
        background-color: #eee !important;
        border-bottom: 2px solid #000 !important;
    }
