
@media print {
    @page {
        size: A4;
        margin: 0;
        padding: 0;
    }
    /* Set margins for the content */
    html, body, #printPdf {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
    }
    /* ---- */
    #printPdf, #wrapper{
        background-color: white;
    }
    #wrapper {
        min-height: auto !important;
    }
    #printPdf .areaLogoTop {
        justify-content: space-evenly !important;
    }
    body{
        width: 1024px !important;
    }
    #printPdf .un_cartResult_detail{
        margin-top: -10px !important;
        padding-top: 0px !important;
    }
    #printPdf .un_cartResult_area .un_cartResult_ttl--orange-pale_total{
        margin-top: 10px !important;
    }
    #printPdf .un_cartResult_itemWrap{
        margin-bottom: 20px !important;
    }
    /* window flow — fully hide the back-button area when printing. The .bl_backBtn button is already hidden, but
       the .areaButtonback container still has padding-top 35px → this extra white block sits after the Copyright,
       pushing the document slightly past page 1 → creating a BLANK PAGE 2 even though all content already fit page 1.
       Hide the whole container (like the mirai_eco flow) to remove the extra page. Only hidden when PRINTING; the preview still
       shows the button so the user can click back to the cart. */
    #printPdf.pdf_window .areaButtonback {
        display: none !important;
    }

    @supports (-webkit-touch-callout: none) { /*For iOs device*/
        #printPdf .areaLogoTop {
            padding-top: 16px;
            padding-bottom: 15px;
        }

        #printPdf #pdf-cart-door .pdf_result_header__band {
            font-size: 21px;
            padding: 4px 0;
        }
    }

    /* #printPdf .pdf-body {
        page-break-after: auto;
        page-break-inside: auto;
        break-inside: auto;
    } */

    /* Disabled page-break tuning kept for reference — the door PDF fits one page
       without it:
         #printPdf .pdf-body section { break-inside: avoid; page-break-inside: avoid; }
         .pdf-body .force-new-page .header_page { margin-bottom: 15px; }
         #printPdf .areaButtonback { padding-top: 35px; }
    */

    /* The four rules below were originally written for iOS only, inside an
       `@supports (-webkit-touch-callout: none)` block. The comment above used to
       run past its intended end (CSS has no nested comments) and swallowed the
       `@supports` line, so they have in fact applied to EVERY browser when
       printing — that printed layout is the one that ships and the one the
       single-page fit was measured against. They are therefore kept as plain
       print rules instead of being re-scoped to iOS.

       Dropped from this group: an override that set
       `.un_cartResult_title { padding: 2px 0 0 18px }`. In print it pushed the
       補助金の効果 heading 18px right of 補助金合計額 and the ①②③ rows, and zeroed
       the bottom padding so the heading touched its underline — neither showed
       up in the on-screen preview. Also dropped: a `.mt-10` rule with no target
       left in the PDF markup. */
    #printPdf .areaLogoTop .logo-img-left {
        width: 102px;
    }

    #printPdf #pdf-cart-door .pdf_group_title {
        font-size: 17px;
        padding: 1px 0 4px 0;
    }

    #printPdf .areaBottom {
        padding-top: 0px;
        font-size: 11px;
    }

    #printPdf .areaFooter {
        padding-top: 12px;
        padding-bottom: 0px;
    }
}

/* End printPdf*/