/**
 * Product pages (.hr-product) and product category pages (.hr-product-cat).
 *
 * The pages reuse the Hub layout (.hr-hub: inner width, section bands, breadcrumb, FAQ, steps,
 * CTA, reviewer from hub-page.css / ui.css / page-sections.css); this file adds the product parts:
 * gallery, key facts, specification groups, detail cards, MOQ table, number band, product cards,
 * comparison table and the sticky inquiry bar. Every colour comes from tokens.css (theme O).
 *
 * @package Hengrui_Child
 */

/* ---------- Dark button (WhatsApp) ---------- */
.hr-ui .hr-btn--dark,
.hr-ui .hr-btn--dark:focus {
	background: var(--hr-color-heading);
	border-color: var(--hr-color-heading);
	color: var(--hr-color-on-accent);
}

.hr-ui .hr-btn--dark:hover {
	background: var(--hr-color-secondary);
	border-color: var(--hr-color-secondary);
	color: var(--hr-color-on-accent);
}

/* ---------- Hero ---------- */
.hr-product__hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.hr-product__eyebrow {
	margin: 0 0 0.75rem;
	color: var(--hr-color-eyebrow);
	font-family: var(--hr-font-data-number);
	font-size: var(--hr-fs-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.hr-product__hero h1 {
	margin: 0 0 1rem;
}

.hr-product__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 1.5rem 0 0;
}

.hr-product__facts > div {
	padding: 14px 18px;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-top: 3px solid var(--hr-color-accent);
	border-radius: var(--hr-radius-lg);
	box-shadow: var(--hr-shadow-card);
}

.hr-product__facts dt {
	color: var(--hr-color-muted);
	font-size: var(--hr-fs-xs);
}

.hr-product__facts dd {
	margin: 0;
	color: var(--hr-color-heading);
	font-family: var(--hr-font-data-number);
	font-size: var(--hr-fs-stat);
	font-weight: 900;
	line-height: 1.3;
}

/* Gallery: one slide at a time with thumbnails; phones: a sideways strip of all photos. */
.hr-gallery__track {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-gallery__slide {
	display: none;
	margin: 0;
}

.hr-gallery__slide.is-active {
	display: block;
}

.hr-gallery__img,
.hr-gallery__thumb img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-radius: var(--hr-radius-lg);
}

.hr-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	margin-top: 12px;
}

.hr-ui .hr-gallery__thumb {
	display: block;
	padding: 0;
	background: none;
	border: 0;
	border-radius: var(--hr-radius-md);
	cursor: pointer;
}

.hr-gallery__thumb img {
	border-radius: var(--hr-radius-md);
}

.hr-gallery__thumb.is-active img {
	border: 2px solid var(--hr-color-accent);
}

.hr-gallery__thumb:focus-visible {
	outline: 2px solid var(--hr-color-accent);
	outline-offset: 2px;
}

/* Category hero: same left edge as the breadcrumb; the text keeps a readable width. */
.hr-hub .hr-product-cat__hero .hr-hub__hero-grid {
	max-width: var(--hr-content-max);
	margin-left: auto;
}

.hr-product-cat__hero .hr-hub__hero-text {
	max-width: 880px;
}

/* ---------- Specifications ---------- */
.hr-spec-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.hr-spec-group,
.hr-detail-card,
.hr-product__panel {
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-top: 3px solid var(--hr-color-accent);
	border-radius: var(--hr-radius-lg);
	box-shadow: var(--hr-shadow-card);
}

.hr-spec-group {
	overflow: hidden;
}

.hr-hub .hr-spec-group h3 {
	margin: 0;
	padding: 14px 20px 10px;
	font-size: var(--hr-fs-body);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.hr-spec-group dl {
	margin: 0;
}

.hr-spec-group dl > div {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
	gap: 16px;
	padding: 12px 20px;
	border-top: 1px solid var(--hr-color-bg-light);
}

.hr-spec-group dt {
	color: var(--hr-color-muted);
}

.hr-spec-group dd {
	margin: 0;
	color: var(--hr-color-heading);
}

/* ---------- Two-column blocks (included, customization) ---------- */
.hr-product__two-col {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

.hr-product__list {
	margin: 0 0 1rem 1.25rem;
	padding: 0;
	color: var(--hr-color-heading);
}

.hr-product__panel {
	margin: 0;
	padding: 16px;
}

.hr-product__panel-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: var(--hr-color-surface);
	border-radius: var(--hr-radius-md);
}

.hr-product__panel figcaption {
	margin-top: 12px;
	color: var(--hr-color-heading);
	font-weight: 700;
}

.hr-product__included .hr-product__panel-img {
	aspect-ratio: 16 / 10;
}

.hr-product__custom .hr-product__panel figcaption {
	color: var(--hr-color-text);
	font-weight: 400;
}

/* ---------- Detail cards ---------- */
.hr-detail-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-detail-card {
	margin: 0;
	padding: 14px;
}

.hr-detail-card__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	margin-bottom: 10px;
	background: var(--hr-color-surface);
	border-radius: var(--hr-radius-md);
}

.hr-hub .hr-detail-card h3 {
	margin-bottom: 6px;
}

.hr-hub .hr-detail-card p {
	margin: 0;
	font-size: var(--hr-fs-small);
	line-height: 1.55;
}

/* ---------- MOQ table ---------- */
.hr-moq {
	margin: 0;
	overflow: hidden;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-radius: var(--hr-radius-lg);
}

.hr-moq > div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 20px;
	border-top: 1px solid var(--hr-color-bg-light);
}

.hr-moq > div:first-child {
	border-top: 0;
}

.hr-moq dt {
	color: var(--hr-color-heading);
}

.hr-moq dd {
	margin: 0;
	color: var(--hr-color-accent);
	font-family: var(--hr-font-data-number);
	font-weight: 900;
	white-space: nowrap;
}

/* ---------- Number band ---------- */
.hr-product > .hr-product__band {
	--hr-band: var(--hr-band-data);
	padding: var(--hr-data-padding-y) 0;
}

.hr-band {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 24px;
	margin: 0;
	text-align: center;
}

.hr-band > div {
	display: flex;
	flex-direction: column-reverse;
}

.hr-band dd {
	margin: 0;
	color: var(--hr-color-stat);
	font-family: var(--hr-font-data-number);
	font-size: var(--hr-fs-data-number);
	font-weight: var(--hr-fw-data-number);
	line-height: 1.1;
}

.hr-band dt {
	margin-top: 6px;
	color: var(--hr-data-label);
	font-size: var(--hr-fs-small);
}

/* ---------- Product cards ---------- */
.hr-ui .hr-product-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.hr-product-cards .hr-card__img {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: var(--hr-color-surface);
}

.hr-product__twins-text {
	color: var(--hr-color-muted);
	font-size: var(--hr-fs-small);
}

.hr-product__related .hr-product__twins-text {
	margin: 24px 0 0;
}

.hr-product > .hr-product__twins {
	padding: 24px 0;
}

.hr-product > .hr-product__twins p {
	margin: 0;
}

/* ---------- Comparison table ---------- */
.hr-compare {
	overflow-x: auto;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-radius: var(--hr-radius-lg);
}

.hr-compare table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: var(--hr-fs-small);
}

.hr-compare :is(th, td) {
	padding: 12px 16px;
	border: 0;
	border-top: 1px solid var(--hr-color-bg-light);
	text-align: left;
	white-space: nowrap;
}

.hr-compare thead th {
	background: var(--hr-color-bg-light);
	color: var(--hr-color-heading);
	font-size: var(--hr-fs-xs);
}

.hr-compare tbody th {
	position: sticky;
	left: 0;
	background: var(--hr-color-surface);
}

/* ---------- Sticky inquiry bar ---------- */
.hr-product-bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 50;
	background: var(--hr-color-surface);
	border-top: 1px solid var(--hr-color-border);
	box-shadow: 0 -4px 16px rgba(15, 34, 54, 0.08);
}

.hr-product-bar[hidden] {
	display: none;
}

.hr-product-bar__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: var(--hr-content-max);
	margin: 0 auto;
	padding: 12px var(--hr-gutter);
}

.hr-product-bar__text {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
	min-width: 0;
	margin: 0;
}

.hr-product-bar__text strong {
	color: var(--hr-color-heading);
	font-size: var(--hr-fs-h3);
}

.hr-product-bar__text span {
	color: var(--hr-color-muted);
	font-size: var(--hr-fs-small);
}

.hr-product-bar .hr-btn {
	flex: 0 0 auto;
	padding: 10px 18px;
	white-space: nowrap;
}

/* Room for the bar under the footer (in the footer colour), and the floating chat / back-to-top
   buttons lifted above the bar while it shows. */
body.hr-has-product-bar .site-footer {
	padding-bottom: var(--hr-product-bar-h, 76px);
}

body.hr-product-bar-on :is(#ht-ctc-chat, #ast-scroll-top) {
	bottom: calc(var(--hr-product-bar-h, 76px) + 12px) !important;
}

/* ---------- Series page: version switch, version cards (docs/SERIES-PAGES.md) ---------- */
.hr-gallery[hidden] {
	display: none !important;
}

.hr-product__versions-line {
	margin: -0.25rem 0 1rem;
	color: var(--hr-color-muted);
	font-family: var(--hr-font-data-number);
	font-weight: 700;
}

.hr-versions-switch {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.hr-ui .hr-versions-switch__btn {
	min-height: 40px;
	padding: 8px 16px;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-radius: 999px;
	color: var(--hr-color-heading);
	font-family: var(--hr-font-data-number);
	font-size: var(--hr-fs-small);
	font-weight: 700;
	cursor: pointer;
}

.hr-ui .hr-versions-switch__btn:hover {
	border-color: var(--hr-color-accent);
	color: var(--hr-color-heading);
	background: var(--hr-color-surface);
}

.hr-ui .hr-versions-switch__btn.is-active {
	background: var(--hr-color-heading);
	border-color: var(--hr-color-heading);
	color: var(--hr-color-on-accent);
}

.hr-ui .hr-versions-switch__btn:focus-visible {
	outline: 2px solid var(--hr-color-accent);
	outline-offset: 2px;
}

.hr-versions,
.hr-optional {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-optional {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 820px;
}

.hr-versions__card,
.hr-optional__item {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 16px;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-top: 3px solid var(--hr-color-accent);
	border-radius: var(--hr-radius-lg);
	box-shadow: var(--hr-shadow-card);
	scroll-margin-top: 96px;
}

.hr-versions__card:target {
	border-color: var(--hr-color-accent);
}

.hr-versions__media,
.hr-optional__media {
	margin: 0 0 12px;
}

.hr-versions__img,
.hr-optional__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: var(--hr-color-surface);
	border-radius: var(--hr-radius-md);
}

.hr-optional__img {
	aspect-ratio: 4 / 3;
}

.hr-hub .hr-versions__card h3 {
	margin: 0 0 6px;
	font-family: var(--hr-font-data-number);
}

.hr-hub .hr-versions__card p {
	margin: 0 0 12px;
	font-size: var(--hr-fs-small);
	line-height: 1.55;
}

.hr-versions__link {
	margin-top: auto;
	color: var(--hr-color-accent);
	font-weight: 700;
	text-decoration: none;
}

.hr-versions__link:hover {
	text-decoration: underline;
}

.hr-hub .hr-optional__text {
	margin: 0;
	color: var(--hr-color-heading);
	font-weight: 700;
}

.hr-product__versions .hr-note,
.hr-product__specs .hr-note {
	margin-top: 16px;
}

.hr-card__note {
	margin: -4px 0 8px;
	color: var(--hr-color-muted);
	font-size: var(--hr-fs-xs);
	font-weight: 700;
	letter-spacing: 0.02em;
}

/* ---------- Tablet ---------- */
@media (max-width: 921px) {
	.hr-product__hero-grid,
	.hr-product__two-col {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.hr-versions {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hr-detail-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hr-ui .hr-product-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Phone ---------- */
@media (max-width: 767px) {
	.hr-spec-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hr-product__facts > div {
		padding: 12px 14px;
	}

	/* Gallery: every photo in a sideways strip; thumbnails are not needed. */
	.hr-gallery__track {
		display: flex;
		gap: 10px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		overscroll-behavior-x: contain;
	}

	.hr-gallery__slide,
	.hr-gallery__slide.is-active {
		display: block;
		flex: 0 0 88%;
		scroll-snap-align: start;
	}

	.hr-gallery__thumbs {
		display: none;
	}

	.hr-versions,
	.hr-optional {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.hr-versions__card {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		column-gap: 14px;
		align-items: start;
		padding: 12px;
	}

	.hr-versions__media {
		grid-row: span 3;
		margin: 0;
	}

	.hr-ui .hr-versions-switch__btn {
		min-height: 44px;
	}

	/* Detail cards: sideways row (status line from mobile.js). */
	.hr-detail-grid {
		display: flex;
		gap: var(--hr-m-gap, 12px);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		overscroll-behavior-x: contain;
		padding: 4px 2px 8px;
	}

	.hr-detail-card {
		flex: 0 0 80%;
		scroll-snap-align: start;
	}

	.hr-moq > div {
		padding: 12px 14px;
	}

	.hr-band {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 12px;
	}

	.hr-band dd {
		font-size: 1.625rem;
	}

	.hr-product-bar__inner {
		gap: 8px;
		padding: 10px 12px;
	}

	.hr-product-bar__text span {
		display: none;
	}

	.hr-product-bar .hr-btn {
		padding: 10px 12px;
		font-size: var(--hr-fs-small);
	}

	body {
		--hr-product-bar-h: 68px;
	}
}

/* Plug options (docs/PLUG-OPTIONS.md): 5 plugs, one row of 5 on desktop, 3 + 2 on tablets, 2 + 2 + 1 on phones. */
.hr-plugs {
	--hr-plugs-cols: 5;
	--hr-plugs-gap: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--hr-plugs-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 921px) {
	.hr-plugs {
		--hr-plugs-cols: 3;
		--hr-plugs-gap: 14px;
	}
}

.hr-plugs__item {
	/* Equal widths; a short last row stays centered (3 + 2 on tablets, 2 + 2 + 1 on phones). */
	flex: 0 0 calc((100% - (var(--hr-plugs-cols) - 1) * var(--hr-plugs-gap)) / var(--hr-plugs-cols));
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 14px;
	text-align: center;
	background: var(--hr-color-surface);
	border: 1px solid var(--hr-color-border);
	border-radius: var(--hr-radius-lg);
	box-shadow: var(--hr-shadow-card);
}

.hr-plugs__media {
	margin: 0 0 10px;
}

.hr-plugs__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: var(--hr-color-surface);
	border-radius: var(--hr-radius-md);
}

.hr-hub .hr-plugs__name {
	margin: 0;
	color: var(--hr-color-heading);
	font-weight: 700;
	line-height: 1.35;
}

.hr-hub .hr-plugs__line {
	margin: 4px 0 0;
	color: var(--hr-color-muted);
	font-size: var(--hr-fs-small);
	line-height: 1.4;
}

.hr-hub .hr-plugs__note {
	margin: 0 0 20px;
	color: var(--hr-color-heading);
}

@media (max-width: 767px) {
	.hr-plugs {
		--hr-plugs-cols: 2;
		--hr-plugs-gap: 12px;
	}

	.hr-plugs__item {
		padding: 10px;
	}

	.hr-hub .hr-plugs__name {
		font-size: var(--hr-fs-small);
	}

	.hr-hub .hr-plugs__line {
		font-size: var(--hr-fs-xs);
	}
}
