/* ==========================================================================
   products.css — product grid / table views for the search results page
   Loaded on top of /assets/css/style.css. The design tokens live in
   style.css (:root), so this file only wires up the page-specific pieces:
   the data table, the part-number link, the stock cell and the RFQ button.
   Kept deliberately small — the base design system already covers
   .pgrid / .pcard / .empty / .strip.
   ========================================================================== */

/* --------------------------------------------------------------- table ---- */
.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.product-table th,
.product-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.product-table th {
  font-weight: 550;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-tint);
  white-space: nowrap;
}

.product-table tbody tr:last-child td {
  border-bottom: 0;
}

.product-table tbody tr:hover {
  background: var(--surface-tint);
}

/* the table needs a wrapper to scroll on narrow screens, see .table-scroll */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------ image cell -- */
.product-img-cell {
  width: 84px;
}

.product-img-cell img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ---------------------------------------------------------- part number -- */
.partno-link {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.partno-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ datasheet --- */
.datasheet-link {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.datasheet-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------------- rfq ---- */
.rfq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.rfq-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.rfq-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rfq-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* legacy alias: the blog/sidebar templates used .rfq-btn too */
.btn-one,
.btn-two {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r);
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.btn-one {
  color: var(--on-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.btn-one:hover {
  color: var(--on-ink);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-two {
  color: var(--text);
  background: transparent;
  border-color: var(--line-strong);
}

.btn-two:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.w-auto {
  width: auto;
}

/* ---------------------------------------------------------- responsive ---- */
@media (max-width: 860px) {
  .product-table {
    font-size: 0.875rem;
  }

  .product-table th,
  .product-table td {
    padding: 12px 12px;
  }

  .product-img-cell {
    width: 64px;
  }

  .product-img-cell img {
    width: 54px;
    height: 54px;
  }
}
