/* Product card shared by every public layout (components/product-card). Literal colours: this sheet
   also loads on the older layout, which does not define the v2 custom properties. */
.pcard {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dce3e9;
  container-type: inline-size;
  transition: border-color .15s ease;
}
.pcard:hover { border-color: #1c69d4; }
.pcard:hover .pcard-title { color: #1c69d4; }
/* The whole card is one link (the title's stretched ::after); show its focus on the card outline. */
.pcard:has(.pcard-title a:focus-visible) { outline: 3px solid #1c69d4; outline-offset: 2px; }
.pcard-title a:focus-visible { outline: none; }

/* Real photos fill the 4:3 frame; cut-out machine shots (white/transparent edges) sit whole on white. */
.pcard-media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; background: #f6f8fa; }
.pcard-media img { position: absolute; inset: 0; display: block; box-sizing: border-box; width: 100%; height: 100%; object-fit: cover; }
.pcard-media.is-cutout { background: #fff; border-bottom: 1px solid #edf1f4; }
/* Padding on the image itself: object-fit works on its content box, so the whole machine always fits. */
.pcard-media.is-cutout img { padding: 18px 22px; object-fit: contain; }
.pcard-media span { color: #5b6672; font-size: 14px; }

.pcard-body { display: flex; flex: 1; flex-direction: column; padding: 18px 20px 20px; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: #5b6672; }
.pcard-meta b { font-weight: 600; color: #1a2129; }
.pcard-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: #1a2129;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  transition: color .15s ease;
}
.pcard-title a { color: inherit; text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; }

.pcard-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 16px 0 0; }
.pcard-facts dt { margin: 0; color: #5b6672; font-size: 12.5px; font-weight: 400; line-height: 1.3; }
.pcard-facts dd {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 3px 0 0;
  color: #1a2129;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.pcard-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 14px 0 0;
  color: #5b6672;
  font-size: 14px;
  line-height: 1.55;
}
.pcard-foot { display: flex; align-items: baseline; gap: 12px; margin: auto 0 0; padding-top: 18px; font-size: 14px; line-height: 1.4; }
.pcard-price { color: #1a2129; font-weight: 700; }
.pcard-more { margin-left: auto; color: #1c69d4; font-weight: 600; white-space: nowrap; }

/* Narrow cards (4-up grids, tablets): stack the two facts. */
@container (max-width: 300px) {
  .pcard-body { padding: 16px; }
  .pcard-facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
/* Phone 2-up grid: one key fact, a longer title, no "view details" line (the whole card is tappable). */
@container (max-width: 220px) {
  .pcard-media.is-cutout img { padding: 10px 12px; }
  .pcard-body { padding: 12px 12px 14px; }
  .pcard-meta { font-size: 12px; }
  .pcard-meta b { display: none; }
  .pcard-title { font-size: 15px; -webkit-line-clamp: 3; }
  .pcard-facts { margin-top: 10px; }
  .pcard-facts > div + div { display: none; }
  .pcard-desc { margin-top: 10px; font-size: 13px; -webkit-line-clamp: 2; }
  .pcard-more { display: none; }
  .pcard-foot { padding-top: 10px; }
  .pcard-foot:not(:has(.pcard-price)) { display: none; }
}
/* Phones keep two cards per row (the cards compact themselves above). The catalog grid comes from the
   Vite-built app.css, which this sheet follows, so the override lives here instead of a rebuild. */
@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pcard, .pcard-title { transition: none; } }
