/* ==========================================================================
   Shared editorial product card (catalog grid + home featured grid)
   Main shot with a situ crossfade on hover, mono SKU + running number,
   hairline divider. Part of the machined identity kit.
   ========================================================================== */

/* ---------- product cards ---------- */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pcard {
  display: grid;
  align-content: start;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  animation: catUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) var(--pcard-delay, 0.2s) both;
}

.pcard:hover {
  border-color: color-mix(in srgb, var(--ds-primary) 40%, var(--ds-border));
  box-shadow: var(--shadow-2);
}

.pcard-media {
  position: relative;
  display: block;
  aspect-ratio: 7 / 5;
  overflow: hidden;
  /* product shots are cut out on pure white; matching the stage to that
     white makes the letterboxing around a contain-fit image disappear */
  background: #ffffff;
}

.pcard-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* a card can carry several photos; hover cycles through them */
.pcard-img { opacity: 0; }
.pcard-img.is-on { opacity: 1; }

.pcard:hover .pcard-img.is-on { transform: scale(1.03); }

.pcard-dots {
  position: absolute;
  inset-inline: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.pcard:hover .pcard-dots { opacity: 1; }

/* the dots sit on the white shot stage, so they are neutral too - the active
   one is simply darker, no teal */
.pcard-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lu-ink-900) 26%, transparent);
  transition: background 0.25s ease, transform 0.25s ease;
}

.pcard-dot.is-on {
  background: color-mix(in srgb, var(--lu-ink-950) 78%, transparent);
  transform: scale(1.4);
}

@media (hover: none) {
  .pcard-dots { opacity: 1; }
}

/* the hover cycle mixes photos with technical drawings; this pill says which
   section the slide on screen comes from (it stays quiet for plain photos) */
.pcard-kind {
  position: absolute;
  display: inline-block;
  inset-inline-start: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--ds-border);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-text);
  background: color-mix(in srgb, var(--ds-surface) 90%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.pcard:hover .pcard-kind,
.pcard:focus-within .pcard-kind {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .pcard-kind {
    opacity: 1;
    transform: none;
  }
}

/* Neutral, not teal: the pill sits on the white shot stage, and the teal fill
   read as a blue button stapled to the bottom of the card. */
.pcard-hint {
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lu-neutral-0) 18%, transparent);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lu-neutral-0);
  background: color-mix(in srgb, var(--lu-ink-950) 82%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pcard:hover .pcard-hint {
  opacity: 1;
  transform: translateY(0);
}

[dir="rtl"] .pcard-hint svg { transform: scaleX(-1); }

.pcard-body {
  display: grid;
  gap: 5px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ds-border);
}

.pcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pcard-code {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-primary);
}

.pcard-no {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--ds-text) 34%, transparent);
}

.pcard-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.pcard-title a {
  color: var(--ds-text);
  text-decoration: none;
  transition: color 140ms ease;
}

.pcard-title a:hover { color: var(--ds-primary); }

.pcard-desc {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ds-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* responsive handled by the grids that host the cards */

/* Phone: ONE card per row (readable) with a notably larger photo. */
@media (max-width: 620px) {
  .catalog-grid { grid-template-columns: 1fr; gap: 14px; }
  .pcard-media { aspect-ratio: 4 / 3; }
  .pcard-body { padding: 12px 14px 14px; }
  .pcard-title { font-size: 15px; }
  .pcard-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard { animation: none; }
  .pcard,
  .pcard-img,
  .pcard-hint { transition: none; }
}
