.pxg {
	--pxg-border: rgba(127, 127, 127, .25);
	--pxg-muted: rgba(127, 127, 127, .9);
	--pxg-accent: #0a7d3b;
	--pxg-stripe: rgba(127, 127, 127, .06);
	font-size: .95rem;
}

.pxg-affiliate {
	margin: 0 0 1rem;
	padding: .5rem .75rem;
	border-left: 3px solid var(--pxg-accent);
	background: var(--pxg-stripe);
	font-size: .85rem;
}

.pxg .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Facettes ---------- */

.pxg-facets {
	margin-bottom: .75rem;
}

.pxg-facets > summary {
	display: none;
}

.pxg-filters {
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

.pxg-facet {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	align-items: stretch;
}

.pxg-filters fieldset {
	border: 1px solid var(--pxg-border);
	border-radius: 6px;
	padding: .4rem .75rem .6rem;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem .9rem;
	align-items: center;
}

.pxg-filters legend {
	font-weight: 600;
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 0 .3rem;
}

.pxg-filters label {
	white-space: nowrap;
	cursor: pointer;
}

/* Famille de types : la légende est elle-même une case qui coche toute la famille. */
.pxg-group legend label {
	text-transform: uppercase;
}

.pxg-group > label {
	font-size: .9em;
}

/* Bascule To / Go */
.pxg-segmented {
	gap: 0 !important;
}

.pxg-segmented label {
	position: relative;
}

.pxg-segmented input {
	position: absolute;
	opacity: 0;
}

.pxg-segmented span {
	display: inline-block;
	padding: .15rem .8rem;
	border: 1px solid var(--pxg-border);
	font-weight: 600;
}

.pxg-segmented label:first-of-type span {
	border-radius: 4px 0 0 4px;
}

.pxg-segmented label:last-of-type span {
	border-radius: 0 4px 4px 0;
	border-left: 0;
}

.pxg-segmented input:checked + span {
	background: var(--pxg-accent);
	border-color: var(--pxg-accent);
	color: #fff;
}

.pxg-segmented input:focus-visible + span {
	outline: 2px solid var(--pxg-accent);
	outline-offset: 2px;
}

.pxg-capacity input[type="number"] {
	width: 5.5em;
}

.pxg-search input {
	min-width: 12rem;
}

.pxg-reset {
	align-self: center;
	background: none;
	border: 0;
	padding: .3rem 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font-size: .9em;
}

.pxg-count {
	margin: 0 0 .4rem;
	font-size: .9em;
	color: var(--pxg-muted);
}

.pxg-count strong {
	color: var(--pxg-accent);
}

.pxg-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pxg-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.pxg-table th,
.pxg-table td {
	padding: .45rem .6rem;
	border-bottom: 1px solid var(--pxg-border);
	text-align: left;
	vertical-align: top;
}

.pxg-table tbody tr:nth-child(even) {
	background: var(--pxg-stripe);
}

.pxg-table th {
	white-space: nowrap;
	font-size: .85rem;
}

.pxg-table th button {
	all: unset;
	cursor: pointer;
	text-decoration: underline dotted;
}

.pxg-table th[aria-sort="ascending"] button::after { content: " ▲"; }
.pxg-table th[aria-sort="descending"] button::after { content: " ▼"; }

.pxg-unit {
	font-weight: 700;
	color: var(--pxg-accent);
	white-space: nowrap;
}

.pxg-per,
.pxg-merchant,
.pxg-na {
	color: var(--pxg-muted);
	font-weight: 400;
	font-size: .85em;
}

.pxg-merchant {
	display: block;
}

.pxg-product {
	min-width: 14rem;
}

.pxg-nowrap {
	white-space: nowrap;
}

.pxg-sub {
	display: block;
	color: var(--pxg-muted);
	font-size: .85em;
}

.pxg-btn {
	display: inline-block;
	padding: .3rem .7rem;
	border-radius: 4px;
	background: #ffd814;
	color: #0f1111 !important;
	font-size: .85em;
	font-weight: 600;
	text-decoration: none !important;
	white-space: nowrap;
}

.pxg-btn:hover,
.pxg-btn:focus-visible {
	background: #f7ca00;
}

/* Mobile : une carte par produit, les en-têtes triables deviennent une barre de tri. */
@media (max-width: 700px) {
	/* Filtres repliés derrière un bouton. */
	.pxg-facets > summary {
		display: inline-block;
		padding: .35rem .9rem;
		border: 1px solid var(--pxg-border);
		border-radius: 4px;
		font-weight: 600;
		cursor: pointer;
		list-style: none;
	}

	.pxg-facets > summary::-webkit-details-marker {
		display: none;
	}

	.pxg-facets > summary::before {
		content: "▸ ";
	}

	.pxg-facets[open] > summary {
		margin-bottom: .75rem;
	}

	.pxg-facets[open] > summary::before {
		content: "▾ ";
	}

	.pxg-filters fieldset,
	.pxg-search input {
		width: 100%;
		min-width: 0;
	}

	.pxg-table,
	.pxg-table tbody {
		display: block;
	}

	.pxg-table thead tr {
		display: flex;
		flex-wrap: wrap;
		gap: .25rem 1rem;
		padding-bottom: .4rem;
		border-bottom: 1px solid var(--pxg-border);
	}

	.pxg-table thead th {
		border: 0;
		padding: 0;
	}

	.pxg-table thead th:not([data-sort]) {
		display: none;
	}

	.pxg-table thead tr::before {
		content: "Trier :";
		font-size: .85rem;
	}

	.pxg-table tbody tr {
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			"product product product"
			"cap     cond    unit"
			"type    type    price";
		gap: .2rem .75rem;
		padding: .7rem .2rem;
		border-bottom: 1px solid var(--pxg-border);
	}

	.pxg-table tbody tr[hidden] {
		display: none;
	}

	.pxg-table tbody td {
		display: block;
		padding: 0;
		border: 0;
	}

	.pxg-product { grid-area: product; min-width: 0; font-weight: 600; }
	.pxg-product .pxg-merchant { display: none; }
	.pxg-unit { grid-area: unit; text-align: right; }
	.pxg-price { grid-area: price; text-align: right; align-self: center; }
	.pxg-type { grid-area: type; font-size: .85em; }
	.pxg-cap { grid-area: cap; font-weight: 600; }
	.pxg-cond { grid-area: cond; font-size: .85em; align-self: center; }
	.pxg-warranty { display: none !important; }
}

.pxg-disclaimer {
	font-size: .8rem;
	color: var(--pxg-muted);
	margin-top: .75rem;
}

@media (prefers-color-scheme: dark) {
	.pxg { --pxg-accent: #4cc27a; }
}
