/**
 * ProductCast card styles.
 * Self-contained so cards look the same on every host theme.
 * Only the font family is inherited from the surrounding page.
 */

.pc-wrap {
	--pc-accent: #111827;
	--pc-btn-bg: #111827;
	--pc-btn-fg: #ffffff;
	--pc-radius: 12px;
	--pc-max: 100%;
	--pc-cols: 1;
	--pc-border: rgba(17, 24, 39, 0.12);
	--pc-muted: #6b7280;
	--pc-surface: #ffffff;
	--pc-text: #111827;

	box-sizing: border-box;
	max-width: var(--pc-max);
	margin: 1.5em 0;
	font-family: inherit;
	line-height: 1.45;
	color: var(--pc-text);
}

.pc-wrap *,
.pc-wrap *::before,
.pc-wrap *::after {
	box-sizing: border-box;
}

.pc-align-center { margin-left: auto; margin-right: auto; }
.pc-align-right  { margin-left: auto; margin-right: 0; }
.pc-align-left   { margin-left: 0; margin-right: auto; }

.pc-heading {
	margin: 0 0 0.6em;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pc-muted);
}

.pc-grid {
	display: grid;
	grid-template-columns: repeat(var(--pc-cols), minmax(0, 1fr));
	gap: 16px;
}

.pc-cols-1 { --pc-cols: 1; }
.pc-cols-2 { --pc-cols: 2; }
.pc-cols-3 { --pc-cols: 3; }
.pc-cols-4 { --pc-cols: 4; }

/* ---------- Card shell ---------- */

.pc-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--pc-surface);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.pc-card:hover {
	box-shadow: 0 6px 24px rgba(17, 24, 39, 0.1);
	transform: translateY(-2px);
}

.pc-media {
	position: relative;
	display: block;
	background: rgba(17, 24, 39, 0.04);
	text-decoration: none;
}

.pc-media img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0;
	border: 0;
	border-radius: 0;
}

.pc-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 8px;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #ffffff;
	background: var(--pc-accent);
	border-radius: 999px;
}

.pc-badge-oos {
	background: var(--pc-muted);
}

.pc-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}

.pc-title {
	margin: 0;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.3;
}

.pc-title a {
	color: inherit;
	text-decoration: none;
}

.pc-title a:hover {
	text-decoration: underline;
}

.pc-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	margin: 0;
	font-size: 0.95em;
}

.pc-prefix {
	font-size: 0.85em;
	color: var(--pc-muted);
}

.pc-now {
	font-weight: 700;
}

.pc-was {
	font-size: 0.85em;
	color: var(--pc-muted);
	text-decoration: line-through;
}

.pc-btn {
	display: inline-block;
	width: 100%;
	margin-top: auto;
	padding: 10px 16px;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.2;
	color: var(--pc-btn-fg);
	text-align: center;
	text-decoration: none;
	background: var(--pc-btn-bg);
	border: 0;
	border-radius: calc(var(--pc-radius) / 1.8);
	cursor: pointer;
	transition: filter 0.15s ease;
}

.pc-btn:hover,
.pc-btn:focus {
	color: var(--pc-btn-fg);
	text-decoration: none;
	filter: brightness(1.12);
}

.pc-btn:focus-visible {
	outline: 2px solid var(--pc-accent);
	outline-offset: 2px;
}

.pc-oos .pc-media img {
	opacity: 0.6;
}

/* ---------- Banner layout ---------- */

.pc-layout-banner .pc-card {
	flex-direction: row;
	align-items: stretch;
}

.pc-layout-banner .pc-media {
	flex: 0 0 auto;
	width: 160px;
}

.pc-layout-banner .pc-media img {
	height: 100%;
	aspect-ratio: auto;
}

.pc-layout-banner .pc-body {
	justify-content: center;
	padding: 16px 18px;
}

.pc-layout-banner .pc-btn {
	width: auto;
	margin-top: 4px;
	align-self: flex-start;
	padding: 9px 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.pc-cols-3 .pc-grid,
	.pc-cols-4 .pc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.pc-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.pc-layout-banner .pc-media {
		width: 112px;
	}

	.pc-layout-banner .pc-body {
		padding: 12px 14px;
	}

	.pc-layout-banner .pc-btn {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pc-card,
	.pc-btn {
		transition: none;
	}

	.pc-card:hover {
		transform: none;
	}
}

/* ---------- Combined card: several products inside one card ---------- */

/*
 * Items carry their own side padding and the grid gap is zero, so every
 * column ends up exactly the same width and the images match. The card's
 * own side padding is reduced by that amount to keep the outer edge even.
 */
.pc-style-combined .pc-combined {
	display: block;
	padding: 18px 6px;
}

.pc-style-combined .pc-combined:hover {
	transform: none;
	box-shadow: none;
}

.pc-style-combined .pc-heading {
	margin: 0 0 14px;
	padding: 0 12px;
}

.pc-style-combined .pc-items {
	display: grid;
	grid-template-columns: repeat(var(--pc-cols), minmax(0, 1fr));
	gap: 0;
}

.pc-style-combined .pc-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	padding: 0 12px;
}

.pc-style-combined .pc-media {
	overflow: hidden;
	border-radius: calc(var(--pc-radius) / 1.6);
}

.pc-style-combined .pc-title {
	font-size: 0.95em;
}

.pc-style-combined .pc-price {
	margin-bottom: 2px;
}

.pc-style-combined .pc-btn {
	margin-top: auto;
}

.pc-style-combined .pc-item.pc-oos .pc-media img {
	opacity: 0.6;
}

@media (min-width: 601px) {
	.pc-style-combined .pc-item + .pc-item {
		border-left: 1px solid var(--pc-border);
	}
}

@media (max-width: 600px) {
	.pc-style-combined .pc-items {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.pc-style-combined .pc-item + .pc-item {
		padding-top: 16px;
		border-top: 1px solid var(--pc-border);
	}
}
