/*
 * PNP COA Library — gold on near-black, matching the vial labels and the
 * storefront (Astra, #000 page, #fff text, #BB965F accent).
 *
 * Every colour is declared as a token on .pnp-coa so the component keeps its
 * own contrast even if the theme palette moves underneath it.
 */

.pnp-coa {
	--coa-gold: #bb965f;
	--coa-gold-dim: #8a6a2f;
	--coa-gold-lift: #d8bc92;
	--coa-ink: #f4f1ec;
	--coa-ink-soft: #a8a29a;
	--coa-surface: #0d0d0d;
	--coa-surface-lift: #151515;
	--coa-line: #2a2620;
	--coa-radius: 4px;

	max-width: 1180px;
	margin: 0 auto;
	padding: 3.5rem 1.25rem;
	color: var(--coa-ink);
	font-size: 16px;
	line-height: 1.6;
}

.pnp-coa *,
.pnp-coa *::before,
.pnp-coa *::after { box-sizing: border-box; }

/* ── intro ─────────────────────────────────────────────────────────────── */

.pnp-coa__intro { max-width: 62ch; margin-bottom: 2.5rem; }
.pnp-coa__intro--tight { margin-bottom: 1.75rem; }

.pnp-coa__eyebrow {
	margin: 0 0 .6rem;
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--coa-gold);
}

.pnp-coa__title {
	margin: 0 0 .85rem;
	font-size: clamp(1.85rem, 4vw, 2.6rem);
	line-height: 1.15;
	font-weight: 600;
	color: var(--coa-ink);
}
.pnp-coa__title--sm { font-size: clamp(1.4rem, 3vw, 1.85rem); }

.pnp-coa__lede { margin: 0 0 .85rem; color: var(--coa-ink-soft); }

/* heading="off": the theme's page title carries the name, so the lede becomes
   the component's opening line and takes the extra weight. */
.pnp-coa__intro--lede .pnp-coa__lede { font-size: 1.05rem; color: var(--coa-ink); }

.pnp-coa__lab { margin: 0; font-size: .92rem; color: var(--coa-ink-soft); }
.pnp-coa__lab strong { color: var(--coa-ink); font-weight: 600; }

/* ── search bar ────────────────────────────────────────────────────────── */

.pnp-coa__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 1.25rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--coa-line);
}

.pnp-coa__search { flex: 1 1 320px; max-width: 460px; }

.pnp-coa__search input {
	width: 100%;
	padding: .7rem .95rem;
	background: var(--coa-surface);
	border: 1px solid var(--coa-line);
	border-radius: var(--coa-radius);
	color: var(--coa-ink);
	font: inherit;
	font-size: .95rem;
}
.pnp-coa__search input::placeholder { color: #6f6a63; }
.pnp-coa__search input:focus-visible {
	outline: 2px solid var(--coa-gold);
	outline-offset: 1px;
	border-color: var(--coa-gold);
}

.pnp-coa__count {
	margin: 0;
	font-size: .82rem;
	letter-spacing: .04em;
	color: var(--coa-ink-soft);
	white-space: nowrap;
}

/* ── card grid ─────────────────────────────────────────────────────────── */

.pnp-coa__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: 1rem;
}
.pnp-coa__grid--product {
	grid-template-columns: repeat(auto-fill, minmax(255px, 320px));
}

.pnp-coa-card {
	display: flex;
	flex-direction: column;
	padding: 1.35rem 1.35rem 1.2rem;
	background: var(--coa-surface);
	border: 1px solid var(--coa-line);
	border-radius: var(--coa-radius);
	transition: border-color .18s ease, background .18s ease;
}
.pnp-coa-card:hover {
	border-color: var(--coa-gold-dim);
	background: var(--coa-surface-lift);
}
.pnp-coa-card[hidden] { display: none; }

.pnp-coa-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: .6rem;
	padding-bottom: .9rem;
	border-bottom: 1px solid var(--coa-line);
}

.pnp-coa-card__name {
	margin: 0;
	font-size: 1.06rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--coa-ink);
}

.pnp-coa-card__strength {
	flex: none;
	font-size: .78rem;
	letter-spacing: .05em;
	color: var(--coa-gold);
	font-variant-numeric: tabular-nums;
}

/* stats */

.pnp-coa-card__stats {
	display: flex;
	gap: 1.5rem;
	padding: 1rem 0 .95rem;
}

.pnp-coa-stat { display: flex; flex-direction: column; gap: .15rem; }

.pnp-coa-stat__val {
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1.1;
	color: var(--coa-gold-lift);
	font-variant-numeric: tabular-nums;
}

.pnp-coa-stat__key {
	font-size: .66rem;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--coa-ink-soft);
}

/* meta list */

.pnp-coa-card__meta {
	margin: 0 0 1.15rem;
	padding-top: .9rem;
	border-top: 1px solid var(--coa-line);
	font-size: .8rem;
}
.pnp-coa-card__meta > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .16rem 0;
}
.pnp-coa-card__meta dt { color: var(--coa-ink-soft); }
.pnp-coa-card__meta dd {
	margin: 0;
	text-align: right;
	color: var(--coa-ink);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

/* button */

.pnp-coa-btn {
	margin-top: auto;
	width: 100%;
	padding: .68rem 1rem;
	background: transparent;
	border: 1px solid var(--coa-gold);
	border-radius: var(--coa-radius);
	color: var(--coa-gold);
	font: inherit;
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
}
.pnp-coa-btn:hover,
.pnp-coa-btn:focus-visible {
	background: var(--coa-gold);
	color: #0b0b0b;
}
.pnp-coa-btn:focus-visible { outline: 2px solid var(--coa-gold-lift); outline-offset: 2px; }

/* ── empty + footnote ──────────────────────────────────────────────────── */

.pnp-coa__empty {
	padding: 2.5rem 0;
	text-align: center;
	color: var(--coa-ink-soft);
}

.pnp-coa__note {
	margin-top: 2.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--coa-line);
	max-width: 70ch;
	font-size: .82rem;
	line-height: 1.65;
	color: var(--coa-ink-soft);
}
.pnp-coa__note p { margin: 0 0 .7rem; }
.pnp-coa__note p:last-child { margin-bottom: 0; }

.pnp-coa__all { margin: 1.5rem 0 0; font-size: .88rem; }
.pnp-coa__all a { color: var(--coa-gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── product-summary badge ─────────────────────────────────────────────── */

.pnp-coa-badge {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: .9rem 0;
	font-size: .84rem;
	letter-spacing: .03em;
	color: #a8a29a;
}
.pnp-coa-badge__dot {
	width: 7px; height: 7px;
	flex: none;
	border-radius: 50%;
	background: #bb965f;
	box-shadow: 0 0 0 3px rgba(187, 150, 95, .18);
}
.pnp-coa-badge a { color: #bb965f; text-decoration: underline; text-underline-offset: 3px; }

/* ── modal ─────────────────────────────────────────────────────────────── */

.pnp-coa-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 2rem 1rem;
	background: rgba(0, 0, 0, .82);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.pnp-coa-modal[hidden] { display: none; }

.pnp-coa-modal__box {
	position: relative;
	width: 100%;
	max-width: 860px;
	background: #0d0d0d;
	border: 1px solid #2a2620;
	border-radius: 4px;
	color: #f4f1ec;
	font-size: 16px;
	line-height: 1.6;
}

.pnp-coa-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.4rem 1.5rem 1.15rem;
	border-bottom: 1px solid #2a2620;
}

.pnp-coa-modal__title { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.pnp-coa-modal__sub { margin: .3rem 0 0; font-size: .82rem; color: #a8a29a; }

.pnp-coa-modal__close {
	flex: none;
	width: 34px; height: 34px;
	display: grid;
	place-items: center;
	background: transparent;
	border: 1px solid #2a2620;
	border-radius: 4px;
	color: #a8a29a;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}
.pnp-coa-modal__close:hover { color: #f4f1ec; border-color: #8a6a2f; }
.pnp-coa-modal__close:focus-visible { outline: 2px solid #bb965f; outline-offset: 2px; }

.pnp-coa-modal__body { padding: 1.4rem 1.5rem 1.6rem; }

/* results table */

.pnp-coa-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.35rem;
	font-size: .88rem;
}
.pnp-coa-table th,
.pnp-coa-table td {
	padding: .55rem .6rem;
	text-align: left;
	border-bottom: 1px solid #201d19;
}
.pnp-coa-table th {
	font-size: .68rem;
	letter-spacing: .11em;
	text-transform: uppercase;
	font-weight: 600;
	color: #a8a29a;
}
.pnp-coa-table td { font-variant-numeric: tabular-nums; }
.pnp-coa-table td:first-child { color: #f4f1ec; }
.pnp-coa-table .is-num { text-align: right; }

.pnp-coa-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: .85rem 1.25rem;
	margin: 0 0 1.4rem;
	padding: 1rem 1.1rem;
	background: #111;
	border: 1px solid #201d19;
	border-radius: 4px;
	font-size: .82rem;
}
.pnp-coa-facts dt {
	font-size: .66rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #a8a29a;
	margin-bottom: .2rem;
}
.pnp-coa-facts dd { margin: 0; color: #f4f1ec; overflow-wrap: anywhere; }

/* embedded report */

.pnp-coa-viewer {
	width: 100%;
	height: 640px;
	margin-bottom: 1.1rem;
	background: #fff;
	border: 1px solid #201d19;
	border-radius: 4px;
}

.pnp-coa-modal__actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.pnp-coa-modal__actions .pnp-coa-btn { width: auto; flex: 1 1 auto; min-width: 180px; text-decoration: none; }
.pnp-coa-modal__actions a.pnp-coa-btn { display: inline-block; }

.pnp-coa-modal__fine {
	margin: 1.1rem 0 0;
	font-size: .76rem;
	line-height: 1.6;
	color: #79736b;
}

@media (max-width: 640px) {
	.pnp-coa { padding: 2.25rem 1rem; }
	.pnp-coa-viewer { height: 420px; }
	.pnp-coa-modal { padding: 1rem .6rem; }
	.pnp-coa-modal__head,
	.pnp-coa-modal__body { padding-left: 1.1rem; padding-right: 1.1rem; }
}

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

/* The theme normally supplies this, but the component must not depend on it —
   without it the visually-hidden search label prints on the page. */
.pnp-coa .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* A value the certificate does not state. Muted and italic so it reads as an absence
   rather than as a measurement — these cards sort last in the library. */
.pnp-coa-stat.is-unstated .pnp-coa-stat__val {
	color: #8a8580;
	font-style: italic;
	font-size: .82em;
}
