/* Size tables — PSS shaft seals and cutlass bearings category pages
   (taxons/spec_table) and the size-matched links on their product pages
   (products/_spec_related). Tokens come from marinerparts.css. */

.sizetable-head .sizetable-note { margin-top: 8px; color: var(--ink-mute); font-size: 14px; }
.sizetable-head .sizetable-note a { color: var(--accent-deep); }

.sizetable { margin: 8px 0 48px; }

/* ── Filters ── */
.sizetable-filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end;
  padding: 16px; margin-bottom: 16px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.sizetable-field { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.sizetable-field > span, .sizetable-chips legend {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute);
}
.sizetable-field select {
  height: 40px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-elev);
}
.sizetable-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sizetable-chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.sizetable-chips legend { width: 100%; margin-bottom: 4px; padding: 0; }
.sizetable-chips label {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--bg-elev);
}
.sizetable-chips label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--bg-elev); }
.sizetable-chips label.is-disabled { opacity: 0.4; cursor: not-allowed; }
.sizetable-chips input { position: absolute; opacity: 0; pointer-events: none; }
.sizetable-chips .n { font-size: 11px; opacity: 0.7; }
.sizetable-check { display: inline-flex; align-items: center; gap: 8px; height: 40px; font-size: 14px; cursor: pointer; }
.sizetable-count { margin-left: auto; font-size: 13px; color: var(--ink-mute); display: flex; gap: 12px; align-items: center; height: 40px; }
.sizetable-count span { font-weight: 700; color: var(--ink); }
.sizetable-clear {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--accent-deep);
  text-decoration: underline; cursor: pointer;
}

/* ── Table ── */
.sizetable-table {
  width: 100%; border-collapse: collapse; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; font-size: 14px;
}
.sizetable-table th, .sizetable-table td { padding: 10px 12px; text-align: left; vertical-align: middle; }
.sizetable-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg); color: var(--ink-mute); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.sizetable-table .gst { font-weight: 400; text-transform: none; letter-spacing: 0; }
.sizetable-table tbody tr { border-bottom: 1px solid var(--line-soft); }
.sizetable-table tbody tr:hover:not(.sizetable-group) { background: color-mix(in oklab, var(--accent) 5%, transparent); }
.sizetable-table .num { text-align: right; white-space: nowrap; }
.sizetable-group th {
  padding-top: 18px; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--bg-elev); border-bottom: 1.5px solid var(--ink);
}
.sizetable-part a { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.sizetable-part a:hover .sizetable-sku, .sizetable-part a:hover .sizetable-name { color: var(--accent-deep); text-decoration: underline; }
.sizetable-name { font-weight: 600; }
.sizetable-sku { font-size: 12px; color: var(--ink-mute); }
.sizetable-table td:first-child:not(.sizetable-part) .sizetable-sku { color: var(--ink); }
.sizetable-part .tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: #fff4c2; color: #7a5a00; vertical-align: 1px;
}
.sizetable-fit { color: var(--ink-mute); font-size: 13px; white-space: nowrap; }
.sizetable-table .badge { white-space: nowrap; }
.sizetable-buy { width: 1%; }
.sizetable-buy form { margin: 0; }
.sizetable-atc {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 0; border-radius: var(--radius); background: var(--ink); color: var(--bg-elev);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sizetable-atc:hover { background: var(--accent-deep); }
.sizetable-empty td { padding: 24px 12px; text-align: center; color: var(--ink-mute); }
.sizetable-empty a { color: var(--accent-deep); }

.sizetable-others { margin: 0 0 64px; }
.sizetable-others h2 { font-size: 20px; margin-bottom: 16px; }

/* Phones: each row becomes a card with labelled values. */
@media (max-width: 760px) {
  .sizetable-filters { padding: 12px; }
  .sizetable-field { min-width: 0; flex: 1 1 140px; }
  .sizetable-count { margin-left: 0; width: 100%; }
  .sizetable-table, .sizetable-table tbody { display: block; border: 0; background: none; }
  .sizetable-table thead { display: none; }
  .sizetable-table tbody tr:not(.sizetable-group):not(.sizetable-empty) {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-bottom: 10px; padding: 12px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .sizetable-table tbody tr[hidden] { display: none !important; }
  .sizetable-table tbody td { padding: 0; }
  .sizetable-table tbody td[data-label]::before {
    content: attr(data-label); display: block; font-size: 10px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
  }
  .sizetable-table .sizetable-part { grid-column: 1 / -1; }
  .sizetable-table .num { text-align: left; }
  .sizetable-buy { width: auto; grid-column: 1 / -1; }
  .sizetable-atc { width: 100%; justify-content: center; height: 40px; }
  .sizetable-group { display: block; }
  .sizetable-group th { display: block; padding: 16px 0 8px; background: none; }
  .sizetable-fit { white-space: normal; }
}

/* ── Product page: size-matched links ── */
.spec-related { margin: 32px 0 0; }
.spec-related-title { font-size: 18px; margin-bottom: 12px; }
.spec-related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.spec-related-link {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev);
  color: var(--ink); text-decoration: none;
}
.spec-related-link:hover { border-color: var(--accent); }
.spec-related-name { font-weight: 600; }
.spec-related-meta { font-size: 13px; color: var(--ink-mute); }

.sizetable .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
