/**
 * Signal Pack Global Components — Product Card System
 * Uses existing brand CSS variables with safe fallbacks (same pattern
 * as the other components in this plugin). Depends on buttons.css
 * being loaded too (cards use .spgc-btn-* classes for their actions).
 */

.spgc-product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
}
@media (max-width: 1080px) { .spgc-product-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .spgc-product-grid { grid-template-columns: 1fr; } }

.spgc-pcard {
	background: var(--paper, #ffffff);
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--line, rgba(23, 22, 46, 0.10));
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease;
}
.spgc-pcard:hover { box-shadow: 0 16px 34px rgba(23, 22, 46, 0.10); }

.spgc-pcard .spgc-pimg {
	height: 180px;
	background: var(--grey-bg, #f6f6f9);
	position: relative;
	overflow: hidden;
}
.spgc-pcard .spgc-pimg img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: transform 0.3s ease;
}
.spgc-pcard:hover .spgc-pimg img { transform: scale(1.04); }

.spgc-tag {
	position: absolute; top: 10px; left: 10px;
	font-weight: 700; font-size: 10px; text-transform: uppercase;
	padding: 4px 9px; border-radius: 4px;
}
.spgc-tag-customizable { background: var(--yellow, #F5C518); color: var(--ink, #17162e); }
.spgc-tag-ready-stock { background: var(--navy, #2C2A78); color: #fff; }
.spgc-tag-b2b { background: var(--ink, #17162e); color: #fff; }
.spgc-tag-b2c { background: var(--paper, #ffffff); color: var(--navy, #2C2A78); border: 1px solid var(--navy, #2C2A78); }
.spgc-tag-out-of-stock { background: #a8a6b8; color: #fff; }

.spgc-pcard .spgc-pbody {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}
.spgc-pcategory {
	font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
	color: var(--grey-text, #55536b); margin-bottom: 4px;
}
.spgc-pcard h4 { font-size: 14.5px; margin: 0 0 6px; }
.spgc-pcard h4 a { color: var(--ink, #17162e); text-decoration: none; }
.spgc-pcard h4 a:hover { color: var(--red, #E31E2A); }

.spgc-oos-label { font-size: 12px; font-weight: 700; color: #c8151f; margin: 0 0 8px; }

.spgc-price { font-weight: 800; font-size: 16px; color: var(--navy, #2C2A78); margin: 0 0 2px; }
.spgc-price-request { font-weight: 700; font-size: 14px; color: var(--navy, #2C2A78); margin: 0 0 2px; }
.spgc-moq { font-size: 11.5px; color: var(--grey-text, #55536b); margin: 0 0 14px; }

.spgc-pactions { margin-top: auto; }
.spgc-pactions .spgc-row2 { display: flex; gap: 8px; }
.spgc-pactions .spgc-row2 .spgc-btn { flex: 1; padding: 0 8px; font-size: 10.5px; }
.spgc-pactions .spgc-btn-full-row { width: 100%; }

/* Out-of-stock state: dim the image, disable actions */
.spgc-pcard.spgc-is-out-of-stock .spgc-pimg::after {
	content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.55);
}
.spgc-pcard.spgc-is-out-of-stock .spgc-pactions .spgc-btn { pointer-events: none; opacity: 0.5; }

/* Loading skeleton state (toggle via "spgc-is-loading" class from your own AJAX code) */
.spgc-pcard.spgc-is-loading .spgc-pimg {
	background: linear-gradient(90deg, var(--grey-bg, #f6f6f9) 25%, var(--grey-alt, #eef0f5) 37%, var(--grey-bg, #f6f6f9) 63%);
	background-size: 400% 100%;
	animation: spgc-pcard-skeleton 1.4s ease infinite;
}
.spgc-pcard.spgc-is-loading .spgc-pbody * { visibility: hidden; }
@keyframes spgc-pcard-skeleton {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}
