@page {
  size: A4 landscape;
  margin: 8mm;
}

.print-only {
  display: none !important;
}

@media print {
  .screen-version,
  .web-only {
    display: none !important;
  }

  .print-only,
  .pdf-version {
    display: block !important;
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
  }

  body {
    font-size: 8pt;
  }

  .pdf-page {
    position: relative;
    height: 194mm;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
  }

  .pdf-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .pdf-cover {
    justify-content: center;
  }

  .pdf-cover-card {
    position: relative;
    border: 1px solid #dcdcdc;
    border-radius: 5mm;
    padding: 14mm 12mm 12mm;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    overflow: hidden;
  }

  .pdf-cover-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5.5mm;
    background: #D6FE51;
  }

  .pdf-cover-logo {
    width: 48mm;
    height: auto;
    margin-bottom: 9mm;
  }

  .pdf-cover-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 8mm;
    margin: 0 0 4mm;
    padding: 0 3.2mm;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 7.8pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #222;
  }

  .pdf-cover h1 {
    margin: 0;
    font-family: 'Fixture Condensed', Arial, sans-serif;
    font-size: 31pt;
    line-height: 0.9;
    letter-spacing: 0.2px;
    max-width: 11ch;
  }

  .pdf-cover-subtitle {
    margin: 4mm 0 0;
    font-size: 10.5pt;
    color: #222;
    max-width: 70ch;
  }

  .pdf-cover-meta {
    margin: 10mm 0 0;
    padding-top: 4mm;
    border-top: 1px solid #e8e8e8;
    font-size: 8pt;
    color: #444;
  }



  .pdf-running-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 8mm;
    padding-bottom: 2.2mm;
    margin-bottom: 3.2mm;
    border-bottom: 1px solid #ececec;
  }

  .pdf-running-header-title {
    font-family: 'Fixture Condensed', Arial, sans-serif;
    font-size: 13pt;
    line-height: 0.95;
    letter-spacing: 0.15px;
    color: #111;
  }

  .pdf-running-header-meta {
    font-size: 7pt;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #666;
    white-space: nowrap;
  }

  .pdf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4.5mm;
    flex: 1;
  }

  .pdf-card {
    border: 1px solid #dcdcdc;
    border-radius: 2.4mm;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #ffffff;
  }

  .pdf-card-placeholder {
    visibility: hidden;
  }

  .pdf-card-image-wrap {
    height: 48mm;
    padding: 1.2mm;
    background: linear-gradient(180deg, #fcfcfc 0%, #f3f3f3 100%);
    border-bottom: 1px solid #dcdcdc;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pdf-card-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: scale(1.04);
    transform-origin: center;
  }

  .pdf-card-image-placeholder {
    font-size: 6pt;
    color: #777;
    text-align: center;
  }

  .pdf-card-body {
    padding: 3.2mm 3.2mm 3.4mm;
    display: flex;
    flex-direction: column;
    gap: 1.7mm;
    flex: 1;
  }

  .pdf-card-code {
    margin: 0;
    font-size: 6.1pt;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .pdf-card-name {
    margin: 0;
    font-family: 'Fixture Condensed', Arial, sans-serif;
    font-size: 11.4pt;
    line-height: 0.98;
    letter-spacing: 0.15px;
    min-height: 8.5mm;
  }

  .pdf-card-price {
    margin: 0;
    font-family: 'Fixture Condensed', Arial, sans-serif;
    font-size: 12.4pt;
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: 0.1px;
  }

  .pdf-card-badge {
    display: inline-block;
    width: fit-content;
    padding: 1mm 2.2mm;
    border-radius: 999px;
    background: #D6FE51;
    font-size: 6.8pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .pdf-card-description {
    margin: 0;
    font-size: 7.1pt;
    line-height: 1.35;
    color: #222;
    min-height: 10mm;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pdf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4mm;
    margin-top: auto;
    padding-top: 0.8mm;
  }

  .pdf-card-meta span {
    font-size: 5.7pt;
    padding: 0.8mm 1.8mm;
    background: #f4f4f4;
    border: 1px solid #ebebeb;
    border-radius: 999px;
    color: #444;
  }

  .pdf-page-number {
    margin-top: 2.4mm;
    padding-top: 2.2mm;
    border-top: 1px solid #ececec;
    font-size: 6.9pt;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: right;
    color: #555;
  }
}
