/* ==================================================================
   HUDSON VALLEY PROMOS — PRINT
   ------------------------------------------------------------------
   Two jobs:

   1. When someone hits Print on a builder, produce an actual estimate
      document — not a screenshot of a web page with the nav in it.
      `#printdoc-host` is populated on demand by share.js and is the
      only thing that appears.

   2. When someone prints a normal page anyway (cart, order, account),
      make it legible: drop the chrome, unstack the sticky rails,
      show link destinations.

   B2B customers print and PDF constantly — for requisitions, for
   filing, for the person who still wants paper. It's cheap to get
   right and conspicuous when it isn't.
   ================================================================== */

@media print {

  /* ---------- page setup ---------------------------------------- */
  @page { margin: 14mm 14mm 16mm; }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  /* Color-accurate where it matters, ink-cheap where it doesn't */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* ---------- hide the interface -------------------------------- */
  .ubar, .mast, .pnav, .footer, .toast, .burger,
  .facets, .facets-mobile-toggle, .toolbar select,
  .pcard-fav, .qactions, .qactions-note,
  .dropzone, .preflight-foot, .stage-note,
  .btn, .crumbs, .brandbar, .zipcheck,
  [data-pfslot], [data-csepslot],
  .hero-btns, .quote-cta .row, .socials,
  .hero-video {
    display: none !important;
  }

  /* ---------- the generated estimate ----------------------------
     When a print document exists it is the ONLY thing that prints. */
  #printdoc-host:not(:empty) ~ * { display: none !important; }
  body:has(#printdoc-host:not(:empty)) > *:not(#printdoc-host) { display: none !important; }
  #printdoc-host { display: block !important; }

  .printdoc { color: #000; }

  .printdoc-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 24pt; padding-bottom: 10pt; margin-bottom: 16pt;
    border-bottom: 2pt solid #1B2426;
  }
  .printdoc-brand {
    font-family: 'Barlow Condensed', Arial Narrow, sans-serif;
    font-weight: 700; font-size: 20pt; letter-spacing: .01em;
    text-transform: uppercase; line-height: 1;
  }
  .printdoc-meta, .printdoc-metaline { font-size: 8.5pt; color: #444; margin-top: 4pt; line-height: 1.4; }
  .printdoc-ref { text-align: right; white-space: nowrap; }
  .printdoc-reflabel {
    font-size: 8pt; letter-spacing: .12em; text-transform: uppercase; color: #444;
  }
  .printdoc-refnum {
    font-family: 'Barlow Condensed', Arial Narrow, sans-serif;
    font-weight: 700; font-size: 15pt; line-height: 1.1;
  }
  .printdoc-title {
    font-family: 'Barlow Condensed', Arial Narrow, sans-serif;
    font-weight: 700; font-size: 16pt; text-transform: uppercase;
    margin: 0 0 12pt; line-height: 1.1;
  }

  .printdoc-spec { width: 100%; border-collapse: collapse; margin-bottom: 14pt; }
  .printdoc-spec th, .printdoc-spec td {
    text-align: left; vertical-align: top; padding: 3pt 8pt 3pt 0;
    font-size: 9.5pt; border-bottom: .5pt solid #ddd;
  }
  .printdoc-spec th { width: 30%; font-weight: 700; color: #333; }

  .printdoc-lines { width: 100%; border-collapse: collapse; margin-bottom: 14pt; }
  .printdoc-lines th, .printdoc-lines td {
    text-align: left; padding: 5pt 8pt 5pt 0; font-size: 10pt;
    border-bottom: .5pt solid #ccc; vertical-align: top;
  }
  .printdoc-lines thead th {
    font-size: 8pt; letter-spacing: .1em; text-transform: uppercase;
    border-bottom: 1pt solid #1B2426; color: #333;
  }
  .printdoc-lines small { font-size: 8.5pt; color: #555; }
  .printdoc-lines .num { text-align: right; white-space: nowrap; }
  .printdoc-lines tfoot td { border-bottom: none; padding-top: 4pt; }
  .printdoc-lines tfoot tr.total td {
    border-top: 1.5pt solid #1B2426; font-weight: 700; font-size: 12pt; padding-top: 7pt;
  }

  .printdoc-terms {
    margin-top: 18pt; padding-top: 10pt; border-top: .5pt solid #ccc;
    font-size: 8.5pt; color: #333; line-height: 1.5;
    break-inside: avoid; page-break-inside: avoid;
  }
  .printdoc-head, .printdoc-spec { break-inside: avoid; page-break-inside: avoid; }
  .printdoc-terms p { margin-bottom: 5pt; }
  .printdoc-url { word-break: break-all; font-size: 7.5pt; color: #555; }

  /* ---------- printing an ordinary page -------------------------- */
  .wrap { max-width: none !important; padding: 0 !important; }
  .split, .build, .cart-layout, .pdp, .acct, .cols-2, .cols-3, .cols-4 {
    display: block !important;
  }
  .prail, .summary, .facets, .acct-nav, .stage { position: static !important; }
  .panel, .order, .citem, .invrow, .duecard {
    border: .5pt solid #bbb !important; box-shadow: none !important;
    break-inside: avoid; page-break-inside: avoid;
  }
  .panel-dark { background: #fff !important; color: #000 !important; }
  .panel-dark h2, .panel-dark h3, .panel-dark p { color: #000 !important; }
  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  table { break-inside: auto; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  img, svg { max-width: 100% !important; }

  /* show where links actually go, but not for anchors or JS hooks */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }

  /* placeholders are noise on paper */
  .ph::after { color: #999 !important; }
  .ph { background: #f4f4f4 !important; border: .5pt dashed #ccc; }
}
