/* Task 1257: concise, overflow-safe operator product inventory. */
.operator-product-inventory .operator-product-table {
  table-layout: fixed;
}

.operator-product-table th:nth-child(1) { width: 32%; }
.operator-product-table th:nth-child(2) { width: 34%; }
.operator-product-table th:nth-child(3) { width: 16%; }
.operator-product-table th:nth-child(4) { width: 18%; }

.operator-product-main-link,
.operator-product-main-link strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.operator-product-variant-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.operator-product-variant-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  justify-content: space-between;
  min-width: 0;
}

.operator-product-variant-list li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .operator-product-inventory {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .operator-product-inventory .operator-product-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .operator-product-table thead { display: none; }
  .operator-product-table tbody {
    display: grid;
    gap: 12px;
    width: 100%;
  }

  .operator-product-table .operator-product-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    width: 100%;
    max-width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .operator-product-table .operator-product-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .operator-product-name-cell { grid-column: 1; grid-row: 1; }
  .operator-product-status-cell { grid-column: 2; grid-row: 1; }
  .operator-product-variant-cell { grid-column: 1 / -1; grid-row: 2; }
  .operator-product-action-cell { grid-column: 1 / -1; grid-row: 3; }

  .operator-product-main-link {
    min-height: 32px;
    padding: 4px 0;
    font-size: .96rem;
    line-height: 1.35;
  }

  .operator-product-variant-list {
    gap: 6px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .operator-product-variant-list li {
    display: grid;
    grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
  }

  .operator-product-variant-list li span:last-child {
    text-align: right;
  }

  .operator-product-action-cell .operator-card-actions {
    justify-content: flex-end;
  }

  .operator-product-action-cell .operator-card-actions form,
  .operator-product-action-cell .operator-card-actions .btn {
    width: auto;
  }
}
