/**
 * HEXING product pages.
 *
 * Loaded on the product archive, single products and the quote page, always
 * alongside hexing-home.css, which supplies the design tokens, the chrome and
 * the base button/form styles. Only the catalogue-specific pieces live here.
 *
 * @package hexing
 */

/* ------------------------------------------------------------- page head */

.hx-pagehead {
	background: linear-gradient(180deg, var(--hx-blue-50), var(--hx-bg));
	padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 60px);
	border-bottom: 1px solid var(--hx-line);
}

.hx-pagehead__title {
	font-size: clamp(30px, 4.2vw, 50px);
	color: var(--hx-navy);
	margin-bottom: 16px;
}

.hx-body .hx-pagehead__lead {
	max-width: 62ch;
	font-size: 17px;
	color: var(--hx-muted);
	margin-bottom: 28px;
}

.hx-pagehead .hx-convert {
	margin-top: 0;
}

/* -------------------------------------------------------------- breadcrumbs */

.hx-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 20px 0 0;
	font-size: 14px;
	color: var(--hx-muted);
}

.hx-crumbs a {
	color: var(--hx-blue);
}

.hx-crumbs a:hover {
	text-decoration: underline;
}

/* ---------------------------------------------------------- product media */

.hx-pcard__media {
	position: relative;
}

.hx-pcard__video,
.hx-phero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	background: #0d1725;
}

.is-playing .hx-pcard__video,
.is-playing .hx-phero__video {
	opacity: 1;
}

.hx-phero__media {
	position: relative;
}

@media (prefers-reduced-motion: reduce) {
	.hx-pcard__video,
	.hx-phero__video {
		display: none;
	}
}

/* ------------------------------------------------------------- conversion */

.hx-convert {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.hx-convert--box {
	flex-direction: column;
}

.hx-convert--box .hx-btn {
	width: 100%;
}

/*
 * An outline button for light backgrounds. Deliberately not .hx-btn--ghost,
 * which is white-on-dark and only works inside the closing section.
 */
.hx-body .hx-btn--line {
	border-color: var(--hx-line);
	background: #fff;
	color: var(--hx-navy);
}

.hx-body .hx-btn--line:hover {
	border-color: var(--hx-blue);
	color: var(--hx-blue);
	box-shadow: 0 8px 20px rgba(44, 85, 58, 0.08);
}

.hx-body .hx-btn--wa {
	border-color: #25d366;
	color: #075e54;
}

.hx-body .hx-btn--wa:hover {
	background: #075e54;
	border-color: #075e54;
	color: #fff;
}

/* ------------------------------------------------------------- card grid */

.hx-pgrid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: clamp(20px, 3vw, 32px);
	grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

.hx-pcard {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--hx-line);
	border-radius: var(--hx-radius);
	overflow: hidden;
	box-shadow: var(--hx-shadow);
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.hx-pcard:hover,
.hx-pcard:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--hx-shadow-lg);
	border-color: var(--hx-blue-400);
}

.hx-pcard__media {
	display: block;
	/* 16:9 so the hover clip is never cropped while it plays. */
	aspect-ratio: 16 / 9;
	background: var(--hx-blue-50);
	overflow: hidden;
}

.hx-pcard__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/*
 * Icon-led cards. The catalogue ships without photography: every image on the
 * Alibaba storefront has marketing copy baked into the pixels and the sixteen
 * listings reuse six of them, so an icon reads better than a repeated banner.
 * A featured image still wins when one is set.
 */
.hx-pcard__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--hx-blue-50), #dce8f7);
	color: var(--hx-blue);
	transition: background 0.25s, color 0.25s;
}

.hx-pcard:hover .hx-pcard__icon,
.hx-pcard:focus-within .hx-pcard__icon {
	background: linear-gradient(135deg, var(--hx-blue), #1d3f80);
	color: #fff;
}

.hx-icon--card {
	width: 64px;
	height: 64px;
	stroke-width: 1.25;
}

.hx-pcard__body {
	padding: 22px 22px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.hx-pcard__title {
	font-size: 20px;
	color: var(--hx-navy);
	margin-bottom: 8px;
}

.hx-pcard__title a:hover {
	color: var(--hx-blue);
}

.hx-body .hx-pcard__text {
	color: var(--hx-muted);
	font-size: 15px;
	margin-bottom: 12px;
}

.hx-pcard__list {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: grid;
	gap: 6px;
	font-size: 14px;
	color: var(--hx-ink);
}

.hx-pcard__list li {
	position: relative;
	padding-left: 20px;
}

.hx-pcard__list li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--hx-blue);
	font-weight: 700;
}

.hx-pcard__foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--hx-line);
}

.hx-pcard__more {
	font-size: 14px;
	font-weight: 700;
	color: var(--hx-blue);
}

.hx-pcard__more::after {
	content: " →";
}

.hx-pcard__quote {
	font-size: 13px;
	font-weight: 700;
	color: var(--hx-navy);
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	padding: 7px 14px;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.hx-pcard__quote:hover {
	background: var(--hx-blue);
	border-color: var(--hx-blue);
	color: #fff;
}

/* --------------------------------------------------------------- single */

.hx-phero {
	padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 5vw, 56px);
}

.hx-phero__inner {
	display: grid;
	gap: clamp(24px, 4vw, 48px);
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	align-items: center;
}

.hx-phero__title {
	font-size: clamp(30px, 4vw, 46px);
	color: var(--hx-navy);
	margin-bottom: 14px;
}

.hx-body .hx-phero__lead {
	font-size: 18px;
	color: var(--hx-muted);
	max-width: 46ch;
}

.hx-phero__media {
	margin: 0;
	border-radius: var(--hx-radius);
	overflow: hidden;
	box-shadow: var(--hx-shadow);
	aspect-ratio: 16 / 9;
	background: var(--hx-blue-50);
}

.hx-phero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hx-phero__media--icon {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eaf1fb, #cfdff4);
	box-shadow: none;
	border: 1px solid var(--hx-line);
}

.hx-phero__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 148px;
	height: 148px;
	border-radius: 50%;
	background: #fff;
	color: var(--hx-blue);
	box-shadow: 0 12px 32px rgba(44, 85, 164, 0.16);
}

.hx-icon--hero {
	width: 78px;
	height: 78px;
	stroke-width: 1.15;
}

.hx-single {
	display: grid;
	gap: clamp(28px, 4vw, 56px);
	grid-template-columns: minmax(0, 1fr) 360px;
	align-items: start;
}

.hx-h3 {
	font-size: 24px;
	color: var(--hx-navy);
	margin: 40px 0 16px;
}

.hx-single__main > .hx-h3:first-child {
	margin-top: 0;
}

.hx-prose {
	font-size: 16px;
	color: var(--hx-ink);
}

.hx-prose p {
	margin-bottom: 1em;
}

.hx-prose ul,
.hx-prose ol {
	margin: 0 0 1em;
	padding-left: 1.2em;
}

.hx-prose li {
	margin-bottom: 0.4em;
}

.hx-prose h2,
.hx-prose h3 {
	color: var(--hx-navy);
	margin-top: 1.4em;
}

.hx-prose a {
	color: var(--hx-blue);
	text-decoration: underline;
}

.hx-checklist--grid {
	grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.hx-facts {
	margin: 0;
	border: 1px solid var(--hx-line);
	border-radius: var(--hx-radius-sm);
	overflow: hidden;
}

.hx-facts__row {
	display: grid;
	grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
	gap: 16px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--hx-line);
	font-size: 15px;
}

.hx-facts__row:last-child {
	border-bottom: 0;
}

.hx-facts__row:nth-child(odd) {
	background: var(--hx-bg);
}

.hx-facts dt {
	font-weight: 700;
	color: var(--hx-navy);
	margin: 0;
}

.hx-facts dd {
	margin: 0;
	color: var(--hx-ink);
}

/* -------------------------------------------------------------- quote box */

.hx-quotebox {
	background: #fff;
	border: 1px solid var(--hx-line);
	border-radius: var(--hx-radius);
	padding: 26px;
	box-shadow: var(--hx-shadow);
}

.hx-single__side .hx-quotebox {
	position: sticky;
	top: 24px;
}

.hx-quotebox__title {
	font-size: 21px;
	color: var(--hx-navy);
	margin-bottom: 10px;
}

.hx-body .hx-quotebox__text {
	font-size: 15px;
	color: var(--hx-muted);
	margin-bottom: 16px;
}

.hx-quotebox__points {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
	display: grid;
	gap: 8px;
	font-size: 14px;
}

.hx-quotebox__points li {
	position: relative;
	padding-left: 22px;
	color: var(--hx-ink);
}

.hx-quotebox__points li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--hx-blue);
	font-weight: 700;
}

.hx-quotebox__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 16px;
}

.hx-quotebox__links li {
	display: grid;
	gap: 2px;
}

.hx-quotebox__links a {
	font-weight: 700;
	color: var(--hx-blue);
	word-break: break-word;
}

.hx-quotebox__links a:hover {
	text-decoration: underline;
}

.hx-quotebox__links span {
	font-size: 13px;
	color: var(--hx-muted);
}

/* ------------------------------------------------------------------- note */

.hx-notice {
	border-radius: var(--hx-radius-sm);
	padding: 16px 18px;
	margin-bottom: 24px;
	font-size: 15px;
	border: 1px solid;
}

.hx-notice strong {
	display: block;
	margin-bottom: 4px;
}

.hx-notice--ok {
	background: #edf9f1;
	border-color: #b7e3c6;
	color: #14532d;
}

.hx-notice--bad {
	background: #fdeeee;
	border-color: #f3c0c0;
	color: #7f1d1d;
}

.hx-body .hx-empty {
	color: var(--hx-muted);
	margin-bottom: 20px;
}

/* ------------------------------------------------------------------- form */

.hx-quote {
	display: grid;
	gap: clamp(28px, 4vw, 56px);
	grid-template-columns: minmax(0, 1fr) 360px;
	align-items: start;
}

.hx-form {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hx-body .hx-form__row {
	margin: 0;
	display: grid;
	gap: 6px;
}

.hx-form__row--wide,
.hx-body .hx-form__submit,
.hx-body .hx-form__note,
.hx-body .hx-form__hp {
	grid-column: 1 / -1;
}

.hx-form label {
	font-size: 14px;
	font-weight: 700;
	color: var(--hx-navy);
}

.hx-form__req {
	color: var(--hx-red);
	margin-left: 2px;
}

.hx-form input,
.hx-form select,
.hx-form textarea {
	width: 100%;
	font: inherit;
	font-size: 15px;
	color: var(--hx-ink);
	background: #fff;
	border: 1px solid var(--hx-line);
	border-radius: var(--hx-radius-sm);
	padding: 11px 13px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.hx-form input:focus,
.hx-form select:focus,
.hx-form textarea:focus {
	outline: none;
	border-color: var(--hx-blue);
	box-shadow: 0 0 0 3px rgba(44, 85, 164, 0.16);
}

.hx-form textarea {
	resize: vertical;
	min-height: 120px;
}

.hx-body .hx-form__submit {
	margin: 4px 0 0;
}

.hx-body .hx-form__note {
	margin: 0;
	font-size: 13px;
	color: var(--hx-muted);
}

/* Off-screen but focusable-free: bots fill it, people never see it. */
.hx-body .hx-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ----------------------------------------------------------- CTA strip */

.hx-strip {
	background: var(--hx-navy);
	color: #fff;
	padding: clamp(40px, 5vw, 64px) 0;
}

.hx-strip__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.hx-strip__title {
	font-size: clamp(22px, 2.6vw, 30px);
	color: #fff;
	margin-bottom: 8px;
}

.hx-body .hx-strip__text {
	color: rgba(255, 255, 255, 0.78);
	margin: 0;
	max-width: 56ch;
}

.hx-strip .hx-convert {
	margin-top: 0;
}

.hx-strip .hx-btn--line {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
}

.hx-strip .hx-btn--line:hover {
	background: #fff;
	border-color: #fff;
	color: var(--hx-navy);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
	.hx-single,
	.hx-quote {
		grid-template-columns: minmax(0, 1fr);
	}

	.hx-single__side .hx-quotebox {
		position: static;
	}

	.hx-phero__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.hx-phero__media {
		order: -1;
	}
}

@media (max-width: 720px) {
	.hx-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.hx-facts__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}

	.hx-quotebox {
		padding: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hx-pcard,
	.hx-pcard__quote,
	.hx-form input,
	.hx-form select,
	.hx-form textarea {
		transition: none;
	}

	.hx-pcard:hover {
		transform: none;
	}
}
