/* Shared catalogue tables, including the two product views with a shadow root. */
:is(table.pm-tech-table, table[data-pm-table-ready]) {
  width: 100%;
  min-width: 0 !important;
  table-layout: auto;
  border-collapse: collapse;
}

:is(table.pm-tech-table, table[data-pm-table-ready]) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: middle;
  text-align: start;
  overflow-wrap: break-word;
}

.pm-tech-table .pm-tech-value {
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
  font-variant-numeric: tabular-nums;
}

.pm-tech-table :is(.pm-tech-code, .pm-tech-code :is(a, button, code, strong)) {
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
}

.pm-tech-table :is(td, th):has(.pm-order-action) { min-width: 0 !important; }
.pm-tech-table :is(.pm-lub-order, .pm-clamp-order) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
}
.pm-tech-table :is(input.pm-quantity, input[type=number]:not([type=hidden])) {
  box-sizing: border-box;
  width: 3.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 5px;
}
.pm-tech-table .pm-order-action {
  min-height: 36px;
  overflow-wrap: normal;
  word-break: normal;
}

.pm-tech-table .pm-tech-code :is(button, a) { max-width: none; }
.pm-table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.pm-table-scroll:focus-visible { outline: 2px solid #648527; outline-offset: -2px; }

@media (max-width: 850px) {
  :is(table.pm-tech-table, table[data-pm-table-ready]) > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding: 5px 6px; }
  .pm-tech-table :is(.pm-order-action, input.pm-quantity) { min-height: 44px; }
}

/* Headers may yield width to the values and the quantity controls. */
:is(table.pm-tech-table, table[data-pm-table-ready]) > thead > tr > th {
  overflow-wrap: anywhere;
}
@media (min-width: 1001px) {
  .pm-tech-table > tbody > tr > td:not(.pm-tech-code, .pm-tech-value) { overflow-wrap: anywhere; }
}

/* DM tables retain readable columns inside the existing scroll region. */
.pm-hyd-module .pm-hyd-group[data-hyd-group^="dm"] .pm-hyd-table table {
  min-inline-size: 41rem;
}
.pm-hyd-module .pm-hyd-group[data-hyd-group^="dm"] .pm-hyd-table thead th {
  min-inline-size: 6rem;
  overflow-wrap: normal;
  word-break: normal;
}
.pm-hyd-module .pm-hyd-group[data-hyd-group^="dm"] .pm-hyd-table :is(th:first-child, .pm-hyd-model > summary) {
  white-space: nowrap;
}
