/**
 * Front-end styles for Certificate of Analysis by WPRobo.
 *
 * @package WPRobo\COA
 */

.wprobo-coa-section {
	--wprobo-coa-primary: #042157;
	--wprobo-coa-accent: #d97b4a;
	--wprobo-coa-pass: #16a34a;
	--wprobo-coa-fail: #dc2626;
	--wprobo-coa-border: #e5e7eb;
	--wprobo-coa-muted: #6b7280;
	margin: 1.5em 0;
	padding: 1.25em 1.5em;
	border: 1px solid var(--wprobo-coa-border);
	border-radius: 10px;
	background: #fff;
}

.wprobo-coa-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 0.75em;
}

.wprobo-coa-section__title {
	margin: 0;
	color: var(--wprobo-coa-primary);
	font-size: 1.15em;
}

.wprobo-coa-section__batch {
	color: var(--wprobo-coa-muted);
	font-size: 0.9em;
}

.wprobo-coa-section__headline {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 0.75em 1em;
	margin-bottom: 1em;
	border-left: 4px solid var(--wprobo-coa-accent);
	background: #f7f8fb;
	border-radius: 0 6px 6px 0;
}

.wprobo-coa-section__headline-label {
	color: var(--wprobo-coa-muted);
}

.wprobo-coa-section__headline-value {
	color: var(--wprobo-coa-primary);
	font-size: 1.5em;
	font-weight: 700;
}

.wprobo-coa-section__meta {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
	color: var(--wprobo-coa-muted);
	font-size: 0.9em;
}

.wprobo-coa-section__meta li {
	display: inline-block;
	margin: 0 1.25em 0 0;
}

.wprobo-coa-section__results {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1em;
}

.wprobo-coa-section__results th,
.wprobo-coa-section__results td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--wprobo-coa-border);
}

.wprobo-coa-section__results th {
	color: var(--wprobo-coa-muted);
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.wprobo-coa-pill {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 600;
	background: #eef1f6;
	color: var(--wprobo-coa-muted);
}

.wprobo-coa-pill--pass {
	background: #e6f6ea;
	color: var(--wprobo-coa-pass);
}

.wprobo-coa-pill--fail {
	background: #fdeaea;
	color: var(--wprobo-coa-fail);
}

.wprobo-coa-section__docs h4 {
	margin: 0 0 0.5em;
	color: var(--wprobo-coa-primary);
}

.wprobo-coa-section__docs ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wprobo-coa-section__docs li {
	margin-bottom: 6px;
}

.wprobo-coa-doc-link {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--wprobo-coa-border);
	border-radius: 6px;
	text-decoration: none;
	color: var(--wprobo-coa-primary);
}

.wprobo-coa-doc-link:hover {
	border-color: var(--wprobo-coa-accent);
	color: var(--wprobo-coa-accent);
}

.wprobo-coa-verify-link {
	font-weight: 600;
	color: var(--wprobo-coa-accent);
}

.wprobo-coa-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0.75em 0;
	padding: 6px 12px;
	border: 1px solid #cfe8d6;
	border-radius: 999px;
	background: #f0faf3;
	color: #146c33;
	font-size: 0.9em;
	font-weight: 600;
}

.wprobo-coa-badge__mark {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wprobo-coa-pass, #16a34a);
	position: relative;
	flex: 0 0 auto;
}

.wprobo-coa-badge__mark::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.wprobo-coa-verify {
	max-width: 720px;
	margin: 2em auto;
	padding: 0 1em;
}

.wprobo-coa-verify__title {
	margin-bottom: 0.25em;
}

.wprobo-coa-verify__intro {
	color: #6b7280;
	margin-bottom: 1.25em;
}

.wprobo-coa-verify__form {
	display: flex;
	gap: 8px;
	margin-bottom: 1.5em;
	flex-wrap: wrap;
}

.wprobo-coa-verify__form input[type="text"] {
	flex: 1 1 16em;
	padding: 8px 12px;
}

.wprobo-coa-verify__status {
	font-weight: 600;
	color: #16a34a;
}

.wprobo-coa-verify__result--missing p {
	color: #dc2626;
	font-weight: 600;
}

.wprobo-coa-qr svg {
	width: 160px;
	height: 160px;
}

.wprobo-coa-disclaimer {
	margin: 1em 0;
	padding: 0.85em 1.1em;
	border-left: 4px solid var(--wprobo-coa-warn, #d97706);
	background: #fff8ef;
	color: #6b4a16;
	font-size: 0.9em;
	border-radius: 0 6px 6px 0;
}

.wprobo-coa-age-locked {
	overflow: hidden;
}

.wprobo-coa-age-gate {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(4, 33, 87, 0.92);
}

.wprobo-coa-age-gate__box {
	max-width: 460px;
	width: 100%;
	background: #fff;
	border-radius: 10px;
	padding: 2em;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.wprobo-coa-age-gate__heading {
	margin-top: 0;
	color: #042157;
}

.wprobo-coa-age-gate__actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 1.25em;
}

.wprobo-coa-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 8px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 0.95em;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.wprobo-coa-btn--primary {
	background: var(--wprobo-coa-accent, #d97b4a);
	color: #fff;
}

.wprobo-coa-btn--primary:hover,
.wprobo-coa-btn--primary:focus {
	filter: brightness(0.94);
	color: #fff;
}

.wprobo-coa-btn--ghost {
	background: transparent;
	color: var(--wprobo-coa-primary, #042157);
	border-color: var(--wprobo-coa-border, #e5e7eb);
}

.wprobo-coa-btn--ghost:hover,
.wprobo-coa-btn--ghost:focus {
	border-color: var(--wprobo-coa-primary, #042157);
}

/* v2: recall banner, print link, serial, integrity badge. */
.wprobo-coa-recall-banner {
	margin: 0 0 1.25em;
	padding: 0.85em 1.1em;
	border: 1px solid #f5c2c0;
	border-left: 4px solid #dc2626;
	background: #fdecea;
	color: #7f1d1d;
	border-radius: 4px;
	font-size: 0.95em;
}

.wprobo-coa-recall-banner__link {
	white-space: nowrap;
	font-weight: 600;
}

.wprobo-coa-section__print {
	margin-top: 0.5em;
}

.wprobo-coa-print-link {
	display: inline-block;
}

.wprobo-coa-section__serial {
	margin-top: 0.75em;
	font-size: 0.8em;
	color: var(--wprobo-coa-muted);
}

.wprobo-coa-verified {
	color: var(--wprobo-coa-pass);
	font-weight: 600;
}

.wprobo-coa-section--compact {
	padding: 1em 1.25em;
}

.wprobo-coa-section--compact .wprobo-coa-section__links a {
	margin-right: 1em;
}

/* v2 round 2: expired notice + per-variation grouping. */
.wprobo-coa-section__expired {
	margin: 0 0 1em;
	padding: 0.6em 0.9em;
	border-left: 4px solid #d97706;
	background: #fff4e5;
	color: #8a5300;
	border-radius: 3px;
	font-weight: 600;
}

.wprobo-coa-variation-group__title {
	margin: 1.25em 0 0.35em;
	font-weight: 600;
	color: var(--wprobo-coa-primary);
	border-bottom: 1px solid var(--wprobo-coa-border);
	padding-bottom: 0.25em;
}

/* v2 round 3: per-variation prompt + modal. */
.wprobo-coa-variation-notice {
	margin: 0.5em 0;
}

.wprobo-coa-variation-notice__link {
	font-weight: 600;
}

.wprobo-coa-variation-notice__missing {
	color: var(--wprobo-coa-muted);
	font-style: italic;
}

.wprobo-coa-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wprobo-coa-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.wprobo-coa-modal__dialog {
	position: relative;
	background: #fff;
	max-width: 640px;
	width: calc(100% - 32px);
	max-height: 85vh;
	overflow: auto;
	border-radius: 8px;
	padding: 24px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.wprobo-coa-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--wprobo-coa-muted);
}

body.wprobo-coa-modal-open {
	overflow: hidden;
}
