/* print-fix.css — affects PRINT / Save-as-PDF only. Does not change any terms text. */
@media print {
  @page { margin: 15mm; }

  /* Hide everything that is not the terms content */
  header, footer, nav,
  .g-terms-section,
  .g-terms-lowerbanner,
  .g-terms-contents-access-btn-div,
  .g-terms-contents-access-btn,
  #exportButton, #printButton,
  .swal2-container {
    display: none !important;
  }

  /* Fixed/absolute overlays repeat on every printed page and cover the text */
  body *:not(#contentToPrint):not(#contentToPrint *) {
    position: static !important;
  }

  html, body, .wrapper, main, .content, #subpage, .body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  #contentToPrint {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  #contentToPrint .row { page-break-inside: auto; }
  #contentToPrint h3, #contentToPrint h4 { page-break-after: avoid; }
  #contentToPrint li { page-break-inside: avoid; }

  /* Keep designed boxes whole: move the entire box to the next page instead of splitting it */
  .g-term-box-deff-pat-756,
  .g-term-alert-deff-pat-756,
  .g-term-content-deff-pat-756 > p,
  #contentToPrint p[style*="f8d7da"] {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Box titles stay attached to the box content */
  .g-term-title-deff-pat-756 {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  /* Bold labels (e.g. "No Refund Policy:") never end up alone at the bottom of a page */
  .g-term-label-deff-pat-756,
  .g-term-label-alert-deff-pat-756 {
    break-after: avoid;
  }

  /* Orphan/widow control for readable paragraphs */
  #contentToPrint p { orphans: 3; widows: 3; }

  /* Make sure box backgrounds and borders print in color */
  .g-term-box-deff-pat-756,
  .g-term-alert-deff-pat-756,
  #contentToPrint p[style*="f8d7da"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}