/**
 * @file
 * Configurator Specs block — screen + print styles.
 */

/* ------------------------------------------------------------------ */
/* Screen styles                                                        */
/* ------------------------------------------------------------------ */

.configurator-specs-wrapper {
  margin-top: 1.5rem;
}

.specs-table th.specs-label-col {
  width: 40%;
  font-weight: 600;
  background-color: #f8f9fa;
}

/* Hide rows where JS sets data-spec-hidden="true" */
.specs-row[data-spec-hidden="true"] {
  display: none;
}

/* Print image — hidden on screen, shown in print */
.specs-print-image {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Print styles                                                         */
/* ------------------------------------------------------------------ */

@media print {

  /* Page setup */
  @page {
    margin: 15mm;
    size: A4 portrait;
  }

  /* Collapse body height so hidden elements don't generate extra pages */
  html, body {
    height: auto !important;
    overflow: visible;
    font-size: 11pt;
    color: #000;
  }

  /* Hide everything except the specs block */
  body > *:not(#configurator-specs) {
    display: none !important;
  }

  /* Specs block: natural flow */
  #configurator-specs {
    display: block !important;
    position: static !important;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Hide spec rows not relevant for this product */
  .specs-row[data-spec-hidden="true"] {
    display: none !important;
  }

  /* ---- Product info: name + SKU ---- */
  .specs-product-info {
    margin-bottom: 2mm;
  }

  .specs-product-info [data-spec="product-name"] {
    font-size: 20pt;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1mm;
    display: block;
  }

  .specs-product-info [data-spec="sku"] {
    font-size: 9pt;
    color: #e04000;
    font-family: monospace;
  }

  /* ---- Print image — full width, centered, below product name ---- */
  .specs-print-image {
    display: block !important;
    width: 100%;
    margin: 3mm 0 3mm 0;
    text-align: center;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 2mm;
    box-sizing: border-box;
  }

  .specs-print-image img {
    max-width: 60%;
    max-height: 40mm;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* ---- Table — clean white, no background ---- */
  .specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .specs-table th,
  .specs-table td {
    border: 1px solid #ddd;
    padding: 4px 8px;
  }

  .specs-table th.specs-label-col {
    background: none !important;
    width: 40%;
    font-weight: 600;
  }

  /* ---- Print footer — logo left, contact right, generated below ---- */
  .specs-print-footer {
    display: block !important;
    visibility: visible !important;
    margin-top: 8mm;
    padding-top: 3mm;
    border-top: 1px solid #ccc;
    font-size: 9pt;
  }

  .specs-print-footer strong {
    font-size: 14pt;
    font-weight: 700;
  }

  .specs-print-footer [data-spec="print-generated"] {
    margin-top: 3mm;
    color: #888;
    font-size: 8pt;
  }

  /* ---- Static specs table — included inside #configurator-specs via JS clone ---- */
  .static-specs-block-wrapper {
    margin-top: 6mm;
  }

  .static-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .static-specs-table th,
  .static-specs-table td {
    border: 1px solid #ddd;
    padding: 4px 8px;
  }

  .static-specs-table th.specs-label-col,
  .static-specs-table th {
    background: none !important;
    width: 40%;
    font-weight: 600;
  }

  /* Hide print button and screen heading */
  #configurator-print-btn,
  .specs-screen-heading {
    display: none !important;
  }

}
