/*
 * Shared product card components.
 * Extracted from shop.css. Page-specific archive differences remain in their
 * own stylesheets and load later in the existing cascade.
 */

/* Product grid */
.products-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.products-grid.hidden,
.products-list.hidden { display: none !important; }

.product-card {
  background: var(--white); border: 0.5px solid var(--gray-100);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gray-200); }
.pcard-link { display: block; text-decoration: none; color: inherit; }

.pcard-img {
  width: 100%; aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: var(--gray-50); overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pcard-img svg { width: 48px; height: 48px; stroke-width: 1.4; fill: none; stroke: var(--gray-200); stroke-linecap: round; }
.pcard-badges { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.badge-instant { background: rgba(13,13,13,0.08); color: var(--black); }
.badge-sale    { background: #fff0f0; color: #c0392b; }
.badge-new     { background: #f0faf4; color: #1a7a40; }
.badge-hot     { background: #fff8ee; color: #b85c00; }

.pcard-save-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(255,255,255,0.95) 60%, rgba(255,255,255,0));
  display: flex; justify-content: flex-end;
}
.pcard-save-badge {
  display: inline-block;
  background: #f0faf4;
  color: #1a7a40;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 0.5px solid rgba(26,122,64,0.2);
}

.pcard-body { padding: 14px 14px 12px; }
.pcard-cat { font-size: 11px; color: var(--gray-400); margin-bottom: 4px; }
.pcard-name { font-size: 14px; font-weight: 600; color: var(--black); line-height: 1.4; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-price { display: flex; flex-direction: column; gap: 3px; }
.pcard-price del {
  font-size: 11px; font-weight: 400;
  color: var(--gray-400); text-decoration: line-through !important;
  display: inline; background: none !important;
}
.pcard-price ins {
  font-size: 15px; font-weight: 700;
  color: var(--black) !important;
  text-decoration: none !important;
  background: none !important;
  display: block; line-height: 1.2;
}
.pcard-price ins .woocommerce-Price-amount,
.pcard-price del .woocommerce-Price-amount { font-size: inherit; font-weight: inherit; color: inherit !important; }
.pcard-price ins .woocommerce-Price-currencySymbol,
.pcard-price del .woocommerce-Price-currencySymbol { font-size: inherit; }
.pcard-price.is-on-sale ins { color: #1a7a40 !important; }
.pcard-buy {
  height: 32px; padding: 0 14px;
  background: var(--black); color: white; border: none;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  white-space: nowrap; transition: background .12s, transform .1s; font-family: inherit;
}
.pcard-buy:hover { background: var(--gray-800); }
.pcard-buy:active { transform: scale(0.96); }
.pcard-unavailable { font-size: 11px; color: var(--gray-400); }

/* Product list */
.products-list { display: flex; flex-direction: column; gap: 10px; }
.plist-item { background: var(--white); border: 0.5px solid var(--gray-100); border-radius: var(--radius-lg); transition: box-shadow .15s, border-color .15s; }
.plist-item:hover { box-shadow: var(--shadow-md); border-color: var(--gray-200); }
.plist-link { display: flex; align-items: center; gap: 16px; padding: 14px 16px; text-decoration: none; color: inherit; }

.plist-thumb {
  width: 68px; height: 68px; border-radius: var(--radius-md);
  border: 0.5px solid var(--gray-100); background: var(--gray-50);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.plist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plist-thumb svg { width: 28px; height: 28px; stroke-width: 1.5; fill: none; stroke: var(--gray-200); stroke-linecap: round; }
.plist-info { flex: 1; min-width: 0; }
.plist-cat { font-size: 11px; color: var(--gray-400); margin-bottom: 3px; }
.plist-name { font-size: 14px; font-weight: 600; color: var(--black); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.plist-tag { font-size: 10px; padding: 2px 8px; border-radius: 20px; background: var(--gray-50); color: var(--gray-600); }
.plist-tag-sale { background: #fff0f0; color: #c0392b; }
.plist-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.plist-price { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.plist-price del { font-size: 11px; font-weight: 400; color: var(--gray-400); text-decoration: line-through; }
.plist-price ins { font-size: 15px; font-weight: 700; color: var(--black); text-decoration: none; }
.plist-price.is-on-sale ins { color: #1a7a40; }
.plist-price .save-badge {
  display: inline-block;
  background: #f0faf4; color: #1a7a40;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
}
.plist-buy {
  height: 32px; padding: 0 16px;
  background: var(--black); color: white; border: none;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  white-space: nowrap; transition: background .12s; font-family: inherit;
}
.plist-buy:hover { background: var(--gray-800); }
.no-products { font-size: 14px; color: var(--gray-400); padding: 2rem 0; }

@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .pcard-body { padding: 10px 10px 9px; }
  .pcard-name { font-size: 12px; margin-bottom: 9px; }
  .pcard-buy { height: 28px; padding: 0 10px; font-size: 11px; }
  .plist-link { padding: 11px 12px; gap: 12px; }
  .plist-thumb { width: 54px; height: 54px; }
  .plist-name { font-size: 13px; }
  .plist-buy { height: 28px; padding: 0 12px; font-size: 11px; }
}
@media (max-width: 420px) {
  .products-grid { gap: 8px; }
}
