/* Pully Products: front end. Uses the theme's colour variables, so dark mode and brand colours follow. */

/* ---------- Cards ---------- */
.pp-badges { position: absolute; z-index: 2; inset-block-start: 10px; inset-inline-start: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 20px); pointer-events: none; }
.pp-badge { display: inline-block; padding: .2em .65em; border-radius: 999px; background: var(--pully-primary); color: var(--pully-on-primary, #fff); font-size: .74rem; font-weight: 700; line-height: 1.4; letter-spacing: .01em; }
.pp-badge--sale { background: var(--pully-danger, #c62828); color: #fff; }
.pp-badge--new { background: var(--pully-ok, #1a7f37); color: #fff; }
.pp-badge--hot { background: var(--pully-accent, #e8590c); color: var(--pully-on-accent, #fff); }
.pp-badge--best { background: var(--pully-secondary, #1b2a41); color: #fff; }
.pp-badge--out { background: var(--pully-muted, #667085); color: #fff; }
.pp-card-price { margin: .1em 0 .2em; font-weight: 700; }
.pp-price del { color: var(--pully-muted); font-weight: 400; }
.pp-price ins { text-decoration: none; color: var(--pully-danger, #c62828); }
.pp-price-unit { color: var(--pully-muted); font-size: .8em; font-weight: 400; }
.pp-price--quote { font-weight: 600; color: var(--pully-link); }
.pp-products.cols-1 { grid-template-columns: minmax(0, 1fr); }
.pp-products.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pp-products.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- Product page ---------- */
.pp-h { margin: 0 0 .6em; font-size: 1.25rem; }
.pp-tiers { width: 100%; max-width: 420px; margin: 0 0 1.4em; border-collapse: collapse; font-size: .95rem; }
.pp-tiers caption { caption-side: top; text-align: start; padding-bottom: .4em; font-weight: 700; }
.pp-tiers :is(th, td) { padding: .5em .8em; border-bottom: 1px solid var(--pully-border); text-align: start; }
.pp-tiers thead th { color: var(--pully-muted); font-weight: 600; font-size: .85rem; }
.pp-ext { margin: 0 0 1.4em; }
.pp-specs caption { caption-side: top; text-align: start; padding: .4em .9em; font-weight: 700; color: var(--pully-text); }
.pp-spec-note { font-weight: 600; color: var(--pully-text); background: var(--pully-surface); }
.specs th.pp-spec-note { width: auto; }
/* A specification group with several columns scrolls sideways on a narrow screen instead of squeezing. */
.pp-spec-scroll { overflow-x: auto; max-width: 100%; margin: 0 0 2em; }
.pp-spec-scroll:focus-visible { outline: 2px solid var(--pully-link); outline-offset: 2px; }
.pp-spec-scroll > .pp-spec-table.specs { width: 100%; max-width: none; margin: 0; }
.pp-spec-table :is(th, td) { width: auto; }
.pp-spec-table thead th { background: var(--pully-surface); font-size: .82rem; font-weight: 700; color: var(--pully-muted); white-space: nowrap; }
.pp-spec-table tbody th { color: var(--pully-text); }
.pp-packing { margin-bottom: 44px; }
.pp-linked { margin-bottom: 44px; }

/* ---------- Options (variations) and sets (grouped) ---------- */
.pp-vars { margin: 0 0 2em; }
.pp-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 12px; }
.pp-filter { display: inline-flex; flex-direction: column; gap: 3px; font-size: .82rem; font-weight: 600; color: var(--pully-muted); }
.pp-filter select { min-width: 140px; }
.pp-vars-wrap { overflow-x: auto; border: 1px solid var(--pully-border); border-radius: var(--pully-radius); }
.pp-vartable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.pp-vartable :is(th, td) { padding: .65em .85em; border-bottom: 1px solid var(--pully-border); text-align: start; vertical-align: middle; }
.pp-vartable thead th { background: var(--pully-surface); font-size: .82rem; font-weight: 700; color: var(--pully-muted); white-space: nowrap; }
.pp-vartable tbody tr:last-child td { border-bottom: 0; }
.pp-vartable tr[hidden] { display: none; }
.pp-vartable tr.is-picked { background: color-mix(in srgb, var(--pully-primary) 9%, var(--pully-bg)); box-shadow: inset 3px 0 0 var(--pully-primary); }
.pp-vartable .pp-c-img img { display: block; width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.pp-vartable .pp-c-price { white-space: nowrap; font-weight: 600; }
.pp-vartable .pp-c-price del { color: var(--pully-muted); font-weight: 400; }
.pp-vartable .pp-c-price ins { text-decoration: none; color: var(--pully-danger, #c62828); }
.pp-vartable .pp-c-act { text-align: end; white-space: nowrap; }
.pp-vartable .pp-any { color: var(--pully-muted); }
.pp-vartable small { display: block; color: var(--pully-muted); }
.pp-vartable .pully-btn--sm { padding: .45em .9em; font-size: .85rem; }
.pp-none { margin: 10px 0 0; color: var(--pully-muted); }
.pp-none[hidden] { display: none; }

/* ---------- Archive filters ---------- */
.pp-pricefilter { display: inline-flex; gap: 6px; align-items: center; }
.pp-pricefilter input { width: 7.5em; }
.pp-checkfilter { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; cursor: pointer; }

@media (max-width: 782px) {
	.pp-products.cols-5, .pp-products.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	/* Option tables become stacked cards on phones. */
	.pp-vars-wrap { border: 0; overflow: visible; }
	.pp-vartable, .pp-vartable tbody, .pp-vartable tr, .pp-vartable td { display: block; width: 100%; }
	.pp-vartable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.pp-vartable tr { margin: 0 0 12px; border: 1px solid var(--pully-border); border-radius: var(--pully-radius); overflow: hidden; }
	.pp-vartable tr[hidden] { display: none; }
	.pp-vartable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: .5em .85em; text-align: end; }
	.pp-vartable td[data-label]::before { content: attr(data-label); flex: 0 0 auto; font-weight: 600; font-size: .82rem; color: var(--pully-muted); text-align: start; }
	.pp-vartable td:last-child { border-bottom: 0; }
	.pp-vartable .pp-c-img { justify-content: flex-start; }
	.pp-vartable .pp-c-act .pully-btn { width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
	.pp-products.cols-5, .pp-products.cols-6, .pp-products.cols-4, .pp-products.cols-3, .pp-products.cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media print {
	.pp-vartable .pp-c-act, .pp-filters, .pp-badges { display: none; }
}
