/* Catalog-Pdf — screen preview + print-to-PDF */

.catalog-pdf-body {
  background: #e8edf3;
}

.cp-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: calc(var(--z-sticky) - 1);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(12, 32, 64, 0.06);
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem) 0.95rem;
}

.cp-toolbar-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.cp-toolbar-copy strong {
  display: block;
  font-size: 1.05rem;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.cp-toolbar-copy span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: 46rem;
  line-height: 1.45;
}

.cp-toolbar-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cp-toolbar-actions .btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.cp-toolbar-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
  margin-top: 0.75rem;
}

.cp-toolbar-opts fieldset {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.cp-toolbar-opts legend {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 0.3rem;
}

.cp-toolbar-opts label {
  font-size: 0.8125rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.cp-check {
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cp-series-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.cp-series-filters > span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-right: 0.15rem;
}

.cp-filter-btn {
  border: 1px solid var(--border);
  background: #f7f9fc;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.cp-filter-btn:hover,
.cp-chip:hover {
  border-color: #c0d8f0;
  color: var(--accent);
}

.cp-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.18rem 0.55rem 0.18rem 0.4rem;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cp-chip em {
  font-style: normal;
  color: var(--text-tertiary);
  font-size: 0.68rem;
}

.cp-hint {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.cp-hint b { color: var(--text-primary); }

.cp-stage {
  padding: 1.5rem clamp(0.75rem, 2vw, 2rem) 3rem;
}

.cp-sheet {
  background: #fff;
  width: min(100%, 11in);
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(12, 32, 64, 0.12);
  color: #1a2433;
}

html.pdf-letter.pdf-landscape .cp-sheet { width: min(100%, 11in); }
html.pdf-letter.pdf-portrait .cp-sheet { width: min(100%, 8.5in); }
html.pdf-a4.pdf-landscape .cp-sheet { width: min(100%, 297mm); }
html.pdf-a4.pdf-portrait .cp-sheet { width: min(100%, 210mm); }

.cp-doc {
  padding: 0.55in 0.5in 0.5in;
}

/* ----- Cover ----- */
.cp-cover {
  background: linear-gradient(145deg, #0a1e3d 0%, #122a58 52%, #1138d4 130%);
  color: #fff;
  min-height: 8.2in;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.55in 0.5in;
  page-break-after: always;
  break-after: page;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cp-cover-logo {
  width: 220px;
  max-width: 46%;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
}

.cp-cover-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.78;
  margin-bottom: 0.55rem;
}

.cp-cover h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 14ch;
}

.cp-cover-sub {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  opacity: 0.86;
  max-width: 28rem;
  line-height: 1.5;
}

.cp-cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.cp-cover-meta span {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.cp-cover-foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0.92;
}

.cp-cover-foot strong { display: block; font-size: 0.95rem; margin-bottom: 0.2rem; }

/* ----- TOC / closing ----- */
.cp-toc,
.cp-close {
  page-break-after: always;
  break-after: page;
  padding: 0.15in 0 0.2in;
}

.cp-toc h2,
.cp-close h2,
.cp-series-hdr .cp-series-name {
  letter-spacing: -0.02em;
}

.cp-toc h2,
.cp-close h2 {
  font-size: 1.45rem;
  color: #0c2040;
  margin-bottom: 0.85rem;
}

.cp-toc-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.25rem;
}

.cp-toc-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.38rem 0;
  border-bottom: 1px solid #eef1f5;
  font-size: 0.84rem;
}

.cp-toc-num {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1138d4;
}

.cp-toc-name { font-weight: 600; color: #1a2433; }
.cp-toc-count { color: #6e6e73; font-size: 0.75rem; }

.cp-close p {
  font-size: 0.88rem;
  color: #3b4553;
  line-height: 1.6;
  max-width: 40rem;
  margin-bottom: 0.75rem;
}

.cp-close-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.1rem;
}

.cp-close-card {
  border: 1px solid #e5eaf1;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}

.cp-close-card h3 {
  font-size: 0.92rem;
  color: #0c2040;
  margin-bottom: 0.3rem;
}

.cp-close-card p,
.cp-legal {
  font-size: 0.78rem;
  color: #5b6573;
  line-height: 1.55;
}

.cp-legal { margin-top: 0.6rem; }

/* ----- Series / products ----- */
.cp-series {
  page-break-before: always;
  break-before: page;
  margin-top: 1.25rem;
}

.cp-series:first-of-type {
  page-break-before: auto;
  break-before: auto;
}

.cp-series-hdr {
  background: linear-gradient(45deg, #172c74, #0d2860);
  color: #fff;
  padding: 0.45rem 0.7rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.15rem;
  page-break-after: avoid;
  break-after: avoid;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cp-series-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cp-series-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cp-product {
  display: grid;
  grid-template-columns: 96px minmax(160px, 0.95fr) minmax(220px, 1.35fr);
  gap: 10px 14px;
  padding: 10px 6px;
  border-bottom: 1px solid #e8edf2;
  page-break-inside: avoid;
  break-inside: avoid;
  align-items: center;
}

.cp-product[data-status="discontinued"] { opacity: 0.92; }

.cp-model-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  padding: 4px;
}

.cp-model h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #121820;
  line-height: 1.25;
}

.cp-sku {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #1138d4;
  background: #ebf2f9;
  padding: 1px 6px;
  border-radius: 4px;
}

.cp-tag {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  color: #5b6573;
}

.cp-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 0;
  margin-top: 0.35rem;
}

.cp-specs li {
  font-size: 0.68rem;
  color: #3b4553;
  line-height: 1.35;
}

.cp-specs li:not(:last-child)::after {
  content: " · ";
  color: #9aa3ad;
}

.cp-packages {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-pkg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcfe;
}

.cp-pkg-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 6px;
}

.cp-pkg-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a2433;
  line-height: 1.3;
}

.cp-pkg-price { margin-top: 1px; }

.cp-old {
  text-decoration: line-through;
  color: #9aa3ad;
  font-size: 0.68rem;
  margin-right: 6px;
}

.cp-new {
  color: #1138d4;
  font-weight: 700;
  font-size: 0.82rem;
}

.cp-note {
  font-size: 0.72rem;
  color: #5b6573;
  padding: 4px 2px;
}

.cp-product[hidden],
.cp-series[hidden],
.cp-toc-list li[hidden] { display: none !important; }

html.pdf-portrait .cp-product {
  grid-template-columns: 84px 1fr;
}

html.pdf-portrait .cp-packages {
  grid-column: 1 / -1;
}

html.pdf-portrait .cp-cover { min-height: 9.6in; }
html.pdf-portrait .cp-toc-list,
html.pdf-portrait .cp-cover-foot,
html.pdf-portrait .cp-close-grid { grid-template-columns: 1fr; }

@media (max-width: 800px) {
  .cp-product {
    grid-template-columns: 72px 1fr;
  }
  .cp-packages { grid-column: 1 / -1; }
  .cp-toc-list,
  .cp-cover-foot,
  .cp-close-grid { grid-template-columns: 1fr; }
  .cp-doc { padding: 1rem; }
  .cp-cover { min-height: auto; padding: 1.4rem 1.1rem; }
}

@media print {
  .site-header,
  .site-footer,
  .whatsapp-float,
  .cp-toolbar { display: none !important; }

  html, body.catalog-pdf-body {
    background: #fff !important;
    padding-top: 0 !important;
    overflow: visible !important;
  }

  .cp-stage { padding: 0; }
  .cp-series { margin-top: 0; }
  .cp-sheet {
    width: auto !important;
    max-width: none !important;
    box-shadow: none;
  }
  .cp-doc { padding: 0; }

  .cp-cover {
    min-height: calc(100vh - 8px);
    min-height: calc(100dvh - 8px);
  }

  a { color: inherit !important; text-decoration: none !important; }
  a[href]::after { content: none !important; }

  img { max-width: none; }

  .cp-product,
  .cp-series-hdr,
  .cp-toc-list li {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
