/**
 * Helios Labs Replica — single product (PDP).
 *
 * Depends on hl-card.css (related row uses the shared card) and hl-tokens.css.
 *
 * ⚠ WooCommerce ships `.woocommerce div.product div.summary{float:right;width:48%}`.
 * A float is inert inside grid but the PERCENTAGE is not — it squeezes the buy
 * column to roughly half its track. Our columns are explicit below and the Woo
 * rule is neutralised at the end of this file.
 */

/* ----------------------------------------------------------------- shell -- */
.hl-pdp {
	background: var(--hl-granite, #050504);
	padding-bottom: 96px;
}

.hl-pdp__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
	padding: 24px 0 0;
}

/* --------------------------------------------------------------- gallery -- */
.hl-pdp__figure {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: var(--hl-card, #0c0c0c);
	border: 1px solid var(--hl-hairline, #2a2723);
	overflow: hidden;
}

.hl-pdp__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.hl-pdp__thumbs {
	display: flex;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.hl-pdp__thumb {
	display: block;
	width: 72px;
	height: 72px;
	padding: 0;
	background: var(--hl-card, #0c0c0c);
	border: 1px solid var(--hl-hairline, #2a2723);
	cursor: pointer;
}

.hl-pdp__thumb.is-active,
.hl-pdp__thumb:hover {
	border-color: var(--hl-glacier, #fc5501);
}

.hl-pdp__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* ------------------------------------------------------------- buy panel -- */
.hl-pdp__flags {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.6rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.hl-pdp__specimen {
	padding: 3px 8px;
	border: 1px solid var(--hl-hairline, #2a2723);
	color: var(--hl-faint, #857f75);
}

.hl-pdp__stock {
	color: var(--hl-glacier, #fc5501);
}

.hl-pdp__h1 {
	margin: 6px 0 0;
	text-transform: uppercase;
	color: var(--hl-glacier, #fc5501);
}

.hl-pdp__sub {
	margin: 8px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-stone, #8c867c);
}

/* DOSE / PURITY / CERTIFICATE */
.hl-pdp__spec {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: max-content;
	gap: 32px;
	margin: 22px 0 0;
	padding: 16px 0;
	border-top: 1px solid var(--hl-hairline, #2a2723);
	border-bottom: 1px solid var(--hl-hairline, #2a2723);
}

.hl-pdp__spec dt {
	margin: 0 0 4px;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.58rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-pdp__spec dd {
	margin: 0;
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 1.15rem;
	line-height: 1;
	color: var(--hl-bone, #f7f2e8);
}

.hl-pdp__coa {
	color: var(--hl-glacier, #fc5501);
	text-decoration: none;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
}

/* ----------------------------------------------------------------- pills -- */
.hl-pdp__set {
	margin: 22px 0 0;
	padding: 0;
	border: 0;
}

.hl-pdp__legend {
	padding: 0;
	margin: 0 0 10px;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.58rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-pdp__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/*
 * ⚠ No inline `style=` on these — inline styles outrank the stylesheet and the
 * selected state could not override them. Same rule as the checkout network
 * radios, and for the same reason: the selection decides what the customer pays.
 */
.hl-pill {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 96px;
	padding: 10px 14px;
	background: var(--hl-card, #0c0c0c);
	border: 1px solid var(--hl-hairline, #2a2723);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hl-pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.hl-pill:hover {
	border-color: var(--hl-stone, #8c867c);
}

/* Two mechanisms on purpose: :has() for CSS-only, and .is-selected toggled by
   JS, because the tier row is re-rendered whenever WEIGHT changes. */
.hl-pill:has(input:checked),
.hl-pill.is-selected {
	border-color: var(--hl-glacier, #fc5501);
	background: rgba(252, 85, 1, 0.1);
}

.hl-pill:has(input:checked) .hl-pill__l,
.hl-pill.is-selected .hl-pill__l,
.hl-pill:has(input:checked) .hl-pill__p,
.hl-pill.is-selected .hl-pill__p {
	color: var(--hl-glacier, #fc5501);
}

.hl-pill input:focus-visible + .hl-pill__l {
	outline: 2px solid var(--hl-glacier, #fc5501);
	outline-offset: 3px;
}

.hl-pill__l {
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 1rem;
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--hl-bone, #f7f2e8);
}

.hl-pill__p {
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--hl-stone, #8c867c);
}

/* ----------------------------------------------------------------- price -- */
.hl-pdp__price {
	margin: 26px 0 0;
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 2.4rem;
	line-height: 1;
	color: var(--hl-bone, #f7f2e8);
}

.hl-pdp__permg {
	margin: 6px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.64rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-pdp__permg[hidden] {
	display: none;
}

/* --------------------------------------------------------------- actions -- */
.hl-pdp__actions {
	display: flex;
	gap: 10px;
	margin: 20px 0 0;
}

.hl-qty {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--hl-hairline, #2a2723);
}

.hl-qty__b {
	width: 42px;
	background: transparent;
	border: 0;
	color: var(--hl-bone, #f7f2e8);
	font-size: 1.1rem;
	cursor: pointer;
}

.hl-qty__b:hover {
	color: var(--hl-glacier, #fc5501);
}

.hl-qty__i {
	width: 56px;
	background: transparent;
	border: 0;
	border-left: 1px solid var(--hl-hairline, #2a2723);
	border-right: 1px solid var(--hl-hairline, #2a2723);
	text-align: center;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.85rem;
	color: var(--hl-bone, #f7f2e8);
	-moz-appearance: textfield;
	appearance: textfield;
}

.hl-qty__i::-webkit-outer-spin-button,
.hl-qty__i::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.hl-pdp__add {
	flex: 1 1 auto;
}

.hl-pdp__calc {
	display: inline-block;
	margin: 16px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.66rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-glacier, #fc5501);
	text-decoration: none;
}

/* ----------------------------------------------------------------- trust -- */
.hl-pdp__trust {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 30px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--hl-hairline, #2a2723);
	list-style: none;
}

.hl-pdp__trust li {
	display: flex;
	flex-direction: column;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.58rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-pdp__trust strong {
	color: var(--hl-bone, #f7f2e8);
	font-weight: 500;
}

/* ------------------------------------------------------------- sections -- */
.hl-pdp__desc,
.hl-analysis,
.hl-prep {
	margin: 72px 0 0;
	padding-top: 40px;
	border-top: 1px solid var(--hl-hairline, #2a2723);
}

.hl-pdp__desc p {
	max-width: 70ch;
	line-height: 1.625;
	color: var(--hl-stone, #8c867c);
}

.hl-analysis__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 14px;
	margin: 26px 0 0;
}

.hl-coa {
	padding: 20px;
	background: var(--hl-card, #0c0c0c);
	border: 1px solid var(--hl-hairline, #2a2723);
}

.hl-coa__lab {
	margin: 0;
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 1.05rem;
	text-transform: uppercase;
	color: var(--hl-bone, #f7f2e8);
}

.hl-coa__sub,
.hl-coa__sample,
.hl-coa__k,
.hl-coa__n {
	margin: 4px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.56rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-coa__rows {
	margin: 16px 0 0;
	padding: 14px 0;
	border-top: 1px solid var(--hl-hairline, #2a2723);
	border-bottom: 1px solid var(--hl-hairline, #2a2723);
}

.hl-coa__rows > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	line-height: 1.5;
}

.hl-coa__rows dt {
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.56rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-coa__rows dd {
	margin: 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.68rem;
	color: var(--hl-bone, #f7f2e8);
}

.hl-coa__figs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin: 16px 0 0;
}

.hl-coa__v {
	margin: 2px 0 0;
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 1.6rem;
	line-height: 1;
	color: var(--hl-bone, #f7f2e8);
}

.hl-coa__v--accent {
	color: var(--hl-glacier, #fc5501);
}

.hl-coa__verify {
	margin: 16px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--hl-hairline, #2a2723);
}

.hl-coa__key {
	margin: 2px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.95rem;
	letter-spacing: 0.12em;
	color: var(--hl-glacier, #fc5501);
	word-break: break-all;
}

.hl-coa__link {
	margin: 14px 0 0;
}

.hl-coa__link a {
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.62rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-glacier, #fc5501);
	text-decoration: none;
}

.hl-analysis__caveat {
	margin: 22px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.56rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

/* ------------------------------------------------- WooCommerce interop --
 * Woo's own single-product CSS assumes a floated two-column layout. Inside our
 * grid the floats are inert but the PERCENTAGES are not, so the buy column
 * would be squeezed to roughly half its track.
 * ---------------------------------------------------------------------- */
.hl-pdp div.summary,
.hl-pdp div.images {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

.hl-pdp .related.products ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hl-pdp .related.products ul.products::before,
.hl-pdp .related.products ul.products::after {
	content: none !important;
	display: none !important;
}

.hl-pdp .related.products ul.products > li {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1000px) {
	.hl-pdp__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.hl-pdp .related.products ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.hl-pdp__spec {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		gap: 14px;
	}

	.hl-pdp__actions {
		flex-wrap: wrap;
	}

	.hl-pdp__add {
		flex: 1 0 100%;
	}
}

@media (max-width: 420px) {
	.hl-pdp .related.products ul.products {
		grid-template-columns: minmax(0, 1fr);
	}
}
