/* Print styles for Cenik page - preserves ALL visual styles for print and PDF */

/* Force color printing */
* {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

/* Print header/footer - hidden on screen */
.cenik-print-header,
.cenik-print-footer {
    display: none;
}

@media print {
    /* ==========================================
       PAGE SETUP - Minimal margins for max space
       ========================================== */
    @page {
        size: A4 portrait;
        margin: 3mm 4mm 5mm 4mm;
    }

    /* ==========================================
       HIDE ELEMENTS
       ========================================== */
    header,
    nav,
    footer,
    .sideMenu,
    .cenik-print-button,
    .sestavite-paket-container,
    .toc-title,
    .cta-section,
    #mainNavigation,
    #mainHeader,
    #mainFooter,
    .main-navigation,
    .mobile-menu,
    .side-menu,
    .cookie-consent,
    .chat-widget,
    .button-small,
    .button-cta,
    .package-highlight,
    .note-important,
    .cenik-print-header,
    .open-aisearch.desktop,
    .open-aisearch,
    .cenik-cta-section {
        display: none !important;
    }

    /* ==========================================
       PRINT FOOTER - Compact
       ========================================== */
    .cenik-print-footer {
        display: block !important;
        text-align: center;
        font-size: 8px;
        color: #888;
        padding: 6px 0 0 0;
        margin-top: 8px;
        border-top: 1px solid #d2d2d2;
        background: white;
        font-family: 'Open Sans', Arial, sans-serif;
    }

    /* ==========================================
       LAYOUT - FULL WIDTH, NO SPACING
       ========================================== */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Open Sans', Arial, sans-serif !important;
        font-size: 8px !important;
        line-height: 1.15 !important;
        color: #404041 !important;
    }

    .main-content.cenik-page-styles {
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        grid-template-columns: none !important;
    }

    .cenik-content-column {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
    }

    .table-container,
    .pricing-section,
    .exclusive-section {
        margin: 0 0 8px 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* ==========================================
       TABLE BASE STYLES - COMPACT
       Using separate border model for better control over rowspan borders
       ========================================== */
    .cenik-page-styles table {
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 8px !important;
        font-family: 'Open Sans', Arial, sans-serif !important;
        page-break-inside: auto !important;
    }

    /* ==========================================
       TABLE HEADERS (TH) - COMPACT
       ========================================== */
    .cenik-page-styles th {
        background: #52AFEA !important;
        color: white !important;
        padding: 2px 3px !important;
        text-align: center !important;
        font-weight: 600 !important;
        font-size: 7px !important;
        white-space: nowrap !important;
        border: 1px solid #e5e5e5 !important;
        line-height: 1.1 !important;
    }

    .cenik-page-styles th:first-child {
        background-color: #fff !important;
        color: #404041 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Dark header row */
    .cenik-page-styles th[style*="#383838"],
    .cenik-page-styles th[style*="background: #383838"],
    .cenik-page-styles th[style*="background:#383838"],
    thead tr:nth-child(2) th[style*="#383838"] {
        background: #383838 !important;
        color: #fff !important;
    }

    /* ==========================================
       TABLE CELLS (TD) - ULTRA COMPACT
       With separate border model: use bottom/right borders only
       to avoid double borders at cell junctions
       ========================================== */
    .cenik-page-styles td {
        padding: 1px 2px !important;
        border-top: none !important;
        border-left: none !important;
        border-bottom: 1px solid #d2d2d2 !important;
        border-right: 1px solid #d2d2d2 !important;
        vertical-align: middle !important;
        line-height: 1.05 !important;
        font-size: 8px !important;
    }

    /* ==========================================
       CATEGORY CELLS - COMPACT
       Border matches screen: #d2d2d2 (section separator adds #b8b8b8 via JS)
       ========================================== */
    .cenik-page-styles .category,
    .cenik-page-styles td.category {
        background: #ededed !important;
        border-top: 1px solid #d2d2d2 !important;
        border-right: 1px solid #d2d2d2 !important;
        border-bottom: 1px solid #d2d2d2 !important;
        border-left: none !important;
        color: #404041 !important;
        font-weight: 600 !important;
        text-align: center !important;
        width: 80px !important;
        font-size: 7px !important;
        padding: 1px 2px !important;
        line-height: 1.05 !important;
    }

    /* ==========================================
       SERVICE CELLS - COMPACT
       ========================================== */
    .cenik-page-styles .service,
    .cenik-page-styles td.service {
        font-weight: 500 !important;
        padding-left: 6px !important;
        text-align: left !important;
        min-width: auto !important;
        font-size: 8px !important;
        line-height: 1.15 !important;
    }

    /* ==========================================
       PACKAGE CELLS - COMPACT
       ========================================== */
    .cenik-page-styles .package,
    .cenik-page-styles td.package {
        text-align: center !important;
        font-weight: 500 !important;
        width: 48px !important;
        vertical-align: middle !important;
        font-size: 8px !important;
        padding: 2px 2px !important;
    }

    /* Checkmark highlighted cells */
    .cenik-page-styles .package:has(.checkmark),
    .cenik-page-styles td.package:has(.checkmark) {
        background-color: #52afea30 !important;
    }

    /* Inline style backgrounds */
    .cenik-page-styles td[style*="background-color: #52afea30"],
    .cenik-page-styles td[style*="background-color:#52afea30"],
    .cenik-page-styles td[style*="background: #52afea30"] {
        background-color: #52afea30 !important;
    }

    /* ==========================================
       ICONS - COMPACT
       ========================================== */
    .cenik-page-styles .checkmark {
        color: #414040d6 !important;
        font-size: 7px !important;
        font-weight: bold !important;
    }

    .cenik-page-styles .cross {
        color: #414040d6 !important;
        font-size: 8px !important;
        font-weight: bold !important;
    }

    /* ==========================================
       PRICE ROW - COMPACT
       ========================================== */
    .cenik-page-styles .price-row,
    .cenik-page-styles tr.price-row {
        font-weight: 700 !important;
        font-size: 8px !important;
        text-align: center !important;
    }

    .cenik-page-styles .price-row td,
    .cenik-page-styles tr.price-row td {
        border-top: 2px solid #d2d2d2 !important;
        border-bottom: 2px solid #d2d2d2 !important;
        padding: 3px 4px !important;
    }

    /* ==========================================
       EXCLUSIVE SECTION - COMPACT
       ========================================== */
    .cenik-page-styles .exclusive-section {
        margin-top: 8px !important;
        overflow: visible !important;
    }

    .cenik-page-styles .exclusive-category {
        background: #ededed !important;
        border-left: none !important;
        color: #404041 !important;
        font-weight: 600 !important;
        text-align: center !important;
        width: 85px !important;
        font-size: 7.5px !important;
    }

    .cenik-page-styles .exclusive-section .package {
        font-size: 8px !important;
        font-weight: bold !important;
    }

    /* ==========================================
       SECTION BORDERS - thicker top border for section separators
       ========================================== */
    .cenik-page-styles tbody tr[style*="border-top: 2px solid #b8b8b8"] > td {
        border-top: 2px solid #b8b8b8 !important;
    }

    /* ==========================================
       NOTE SECTION - COMPACT
       ========================================== */
    .cenik-page-styles .note {
        background: #f1f5f9 !important;
        border-left: 2px solid #52AFEA !important;
        padding: 4px 6px !important;
        margin: 6px 0 !important;
        font-size: 7px !important;
        color: #64748b !important;
        border-radius: 0 4px 4px 0 !important;
        page-break-before: avoid !important;
        line-height: 1.2 !important;
    }

    /* ==========================================
       PAGE BREAK CONTROL
       ========================================== */
    tr {
        page-break-inside: avoid !important;
    }

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

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

    /* First table - try to keep on one page */
    .table-container:first-of-type {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    .pricing-section,
    .exclusive-section {
        page-break-inside: avoid !important;
    }

    tbody {
        page-break-inside: auto !important;
    }

    /* ==========================================
       INLINE STYLES PRESERVATION
       ========================================== */
    td[style*="color: #414040d6"],
    td[style*="color:#414040d6"] {
        color: #414040d6 !important;
    }

    td[style*="font-weight: bold"],
    td[style*="font-weight:bold"] {
        font-weight: bold !important;
    }

    td[style*="font-size: 11px"],
    td[style*="font-size:11px"],
    td[style*="font-size: 12px"],
    td[style*="font-size:12px"] {
        font-size: 7px !important;
    }

    /* ==========================================
       LINKS
       ========================================== */
    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    /* ==========================================
       IMAGES - SMALLER
       ========================================== */
    img {
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }

    th img[src*="favicon"],
    th img[src*="favicon.ico"] {
        width: 12px !important;
        height: 12px !important;
    }

    th div[style*="display: flex"] {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        font-size: 9px !important;
    }

    /* ==========================================
       TEXT - COMPACT
       ========================================== */
    .cenik-content-column p {
        font-size: 8px !important;
        margin: 4px 0 !important;
        line-height: 1.2 !important;
    }

    .cenik-content-column h4 {
        font-size: 10px !important;
        margin: 6px 0 3px 0 !important;
    }

    .cenik-content-column h2 {
        font-size: 11px !important;
        margin: 6px 0 !important;
    }

    /* ==========================================
       HEADER ROW HEIGHT OVERRIDE
       ========================================== */
    .cenik-page-styles thead tr[style*="height: 45px"],
    .cenik-page-styles thead tr {
        height: auto !important;
    }

    .cenik-page-styles thead tr th {
        height: auto !important;
        padding: 2px 3px !important;
    }

    /* Extra compact for first table */
    .table-container:first-of-type table {
        font-size: 7.5px !important;
    }

    .table-container:first-of-type td,
    .table-container:first-of-type th {
        padding: 1px 2px !important;
        line-height: 1.0 !important;
    }
}
