/* PaperGold: geometry belongs to the site, not to an individual CSV import.
 * WP Table Builder rewrites width:100% to width:auto and gives automatic
 * cells a 100px width. Override that geometry on desktop, retaining cell
 * formatting, explicitly sized columns, merged cells and technical icons.
 */
@media (min-width: 768px) {
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] table.wptb-preview-table {
    width: 100% !important;
    table-layout: fixed !important;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] table.wptb-preview-table td[data-wptb-css-td-auto-width="true"],
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] table.wptb-preview-table th[data-wptb-css-td-auto-width="true"] {
    width: auto !important;
  }
}

/* Preserve the mobile rule published on 2026-10-21 in the versioned plugin,
 * so existing and newly imported tables share the same behavior.
 */
@media (max-width: 767px) {
  body.single-product .summary { min-width: 0; max-width: 100%; }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"]::before {
    content: "Scorri la tabella lateralmente per vedere tutte le colonne";
    display: block;
    position: sticky;
    left: 0;
    width: 100%;
    padding: 0 0 6px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
    white-space: normal;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] .wptb-table-container-matrix {
    width: max-content !important;
    min-width: 100%;
    max-width: none;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] table.wptb-preview-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] td,
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] th {
    width: auto !important;
    padding: 8px !important;
  }
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] .wptb-text-container,
  body.single-product .wptb-table-container[data-wptb-horizontal-scroll-status="true"] p {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none;
  }
}
