/* Product Compare frontend styles — neutral, .pc- prefixed, theme-agnostic. */

.pc-catalog {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.25em;
	margin: 1em 0;
}

.pc-catalog-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.5em 0 1em;
}

.pc-filter-btn {
	background: #f0f0f0;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 0.4rem 0.9rem;
	cursor: pointer;
	font-size: 0.9rem;
	color: inherit;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pc-filter-btn:hover {
	background: #e6e6e6;
}

.pc-filter-btn.is-active {
	background: #1d4f91;
	color: #fff;
	border-color: #1d4f91;
}

.pc-card {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	padding: 0.75em;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	background: #fff;
}

.pc-card:hover {
	border-color: #999;
}

.pc-card-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f5f5f5;
}

.pc-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pc-card-thumb--placeholder {
	background: #f0f0f0;
}

.pc-card-name {
	font-weight: 600;
}

.pc-card-price {
	font-size: 0.8rem;
}

.pc-card-price--none,
.pc-card-updated,
.pc-catalog-empty {
	color: #666;
}

.pc-card-updated {
	font-size: 0.6rem;
}

.pc-catalog-empty {
	font-size: 0.85em;
}

.pc-compare {
	margin: 1.5em 0;
}

.pc-compare-basis,
.pc-compare-footer {
	color: #666;
	font-size: 0.85em;
}

.pc-compare-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.75em 0;
}

.pc-compare-table th,
.pc-compare-table td {
	padding: 0.5em 0.75em;
	border: 1px solid #ddd;
	text-align: right;
}

.pc-compare-table .pc-vendor-col {
	text-align: left;
	min-width: 10em;
}

.pc-compare-table .pc-vendor-col a {
	font-size: var(--wp--preset--font-size--medium, medium);
}

.pc-compare-table .pc-updated {
	display: block;
	color: #666;
	font-size: 0.8rem;
	font-weight: 400;
}

.pc-compare-table .pc-min {
	background: #e6f4ea;
	font-weight: 600;
}

.pc-compare-table .pc-min .pc-cell-unit {
	color: #1e5a3a;
}

.pc-compare-table .pc-cell-total {
	display: block;
	font-weight: 400;
	/* Pull the active theme's --medium preset so the total sits naturally
	 * in the page's type scale; fall back to the CSS keyword if the var
	 * isn't defined (WordPress themes ship this preset, but plain CSS doesn't). */
	font-size: var(--wp--preset--font-size--medium, medium);
}

.pc-compare-table .pc-cell-unit {
	display: block;
	font-size: 0.7rem;
	color: #888;
	font-weight: 400;
	margin-top: 2px;
	line-height: 1.3;
	white-space: nowrap;
}

.pc-compare-table .pc-cell-discount {
	display: inline-block;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 999px;
	background: #e6f4ea;
	font-weight: 600;
	font-size: 0.65rem;
	vertical-align: 1px;
	line-height: 1.5;
	/* Base: no fixed color — inherit the cell's text color. The green tone
	 * only belongs to the cheapest cell, gated by the .pc-min ancestor. */
	color: inherit;
}

.pc-compare-table .pc-min .pc-cell-discount {
	background: #c7e6cf;
	color: #1e5a3a;
}

.pc-compare-table .pc-unavailable {
	text-align: center;
	color: #666;
	font-style: italic;
}
