/* Product cards: shared by every product list (home rows, listings, related, posts). */
/* ---------------------------------------------------------------- product cards */
.p-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.p-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease); }
.p-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -18px rgba(58, 42, 34, 0.55); }
.p-media { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease), opacity 300ms; }
.p-media img.alt { position: absolute; inset: 0; opacity: 0; }
.p-card:hover .p-media img { transform: scale(1.04); }
.p-card:hover .p-media img.alt { opacity: 1; }
.p-media .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.p-media .placeholder .icon { width: 40px; height: 40px; }
.p-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }
.p-tags .badge { height: 24px; border: 1.5px solid var(--espresso); font-weight: 800; letter-spacing: 0.02em; }
.badge-new { background: var(--mustard); color: var(--espresso); }
.badge-hot { background: var(--brick); color: #fff8ee; }
.badge-out { background: var(--espresso); color: #f3e8d8; }
.p-card.is-out .p-media img { filter: grayscale(0.6); opacity: 0.8; }
.p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.p-brand { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.p-name { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.p-price { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--brick); font-variant-numeric: tabular-nums; }
.p-price.ask { font-family: var(--font); font-size: 14px; color: var(--text-2); }
.p-stock { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.p-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-stock.in { color: var(--success); } .p-stock.low { color: var(--warning); } .p-stock.out { color: var(--text-3); }

@media (max-width: 1120px) {
  .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .p-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .p-grid, .p-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .p-body { padding: 10px 12px 12px; }
  .p-price { font-size: 16px; }
}

/* ---------------------------------------------------------------- group card (one card per model) */
.p-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.p-layout { flex: none; height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; color: var(--espresso); background: var(--surface-3);
  border: 1.5px solid var(--espresso); }
:root[data-theme="dark"] .p-layout { color: var(--text); border-color: var(--border-strong); }
.p-colors { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.p-thumbs { display: inline-flex; }
.p-thumbs img, .p-thumbs i { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--surface-3);
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); margin-left: -6px; }
.p-thumbs img:first-child, .p-thumbs i:first-child { margin-left: 0; }
.p-more { font-weight: 800; color: var(--text-3); }
.p-ncolors { margin-left: auto; }
.p-status { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.p-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.p-status.in { color: var(--success); } .p-status.out { color: var(--text-3); } .p-status.ask { color: var(--warning); }
@media (max-width: 640px) {
  .p-thumbs img, .p-thumbs i { width: 20px; height: 20px; }
  .p-layout { font-size: 10.5px; padding: 0 7px; }
}
