/*
 * GH Hardware commerce overrides.
 *
 * Partdo remains the structural and behavioural baseline. This file contains
 * only GH-owned components and explicitly approved compatibility rules.
 */

/* 1. Native commerce compatibility fixes */

/*
 * No active rules. Native Partdo product grids, cards, controls and hover
 * behaviour are intentionally restored pending a locked GH card specification.
 */

/* 2. GH category archive components */

.gh-category-archive {
	color: var(--gh-color-ink);
}

.gh-category-archive .gh-commerce-breadcrumb {
	color: var(--gh-color-ink-soft);
	font-size: 13px;
	margin-bottom: var(--gh-space-3);
}

.gh-category-archive .gh-commerce-breadcrumb a {
	color: var(--gh-color-ink-soft);
	text-decoration: none;
}

.gh-category-archive .gh-button {
	align-items: center;
	background: var(--gh-color-primary);
	border: 1px solid var(--gh-color-primary);
	border-radius: var(--gh-radius-md);
	color: var(--gh-color-white);
	display: inline-flex;
	font-weight: 700;
	gap: var(--gh-space-2);
	justify-content: center;
	line-height: 1.2;
	min-height: 40px;
	padding: 0 var(--gh-space-4);
	text-decoration: none;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.gh-category-archive .gh-button:hover,
.gh-category-archive .gh-button:focus-visible {
	background: var(--gh-color-primary-dark);
	border-color: var(--gh-color-primary-dark);
	color: var(--gh-color-white);
}

.gh-category-archive .gh-button--secondary {
	background: var(--gh-color-ink);
	border-color: var(--gh-color-ink);
}

.gh-category-hero {
	align-items: stretch;
	background: var(--gh-color-surface);
	border: 1px solid var(--gh-color-line);
	border-radius: var(--gh-category-card-radius);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
	margin-bottom: var(--gh-space-3);
	overflow: hidden;
}

.gh-category-hero__content {
	align-content: center;
	display: grid;
	gap: var(--gh-space-2);
	min-height: 168px;
	padding: var(--gh-space-5);
}

.gh-category-hero__eyebrow {
	color: var(--gh-color-primary-dark);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	margin: 0;
	text-transform: uppercase;
}

.gh-commerce-archive__title {
	color: var(--gh-color-ink);
	font-size: clamp(36px, 3vw, 44px);
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.08;
	margin: 0;
}

.gh-category-hero__description {
	color: var(--gh-color-ink-soft);
	font-size: 15px;
	line-height: 1.5;
	max-width: 680px;
}

.gh-category-hero__description p {
	margin: 0;
}

.gh-category-hero__media {
	background: var(--gh-color-surface-muted);
	display: flex;
	height: 168px;
	margin: 0;
	min-height: 168px;
	overflow: hidden;
}

.gh-category-hero__media img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.gh-category-stats {
	display: grid;
	gap: var(--gh-space-2);
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-bottom: var(--gh-space-4);
}

.gh-category-stats__item {
	background: var(--gh-color-surface-muted);
	border: 1px solid var(--gh-color-line);
	border-radius: var(--gh-category-card-radius);
	padding: var(--gh-space-3) var(--gh-space-4);
}

.gh-category-stats__item strong,
.gh-category-stats__item span {
	display: block;
}

.gh-category-stats__item strong {
	color: var(--gh-color-ink);
	font-size: 24px;
	line-height: 1;
}

.gh-category-stats__item span {
	color: var(--gh-color-ink-soft);
	font-size: 11px;
	font-weight: 800;
	margin-top: var(--gh-space-1);
	text-transform: uppercase;
}

.gh-section-heading {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: var(--gh-space-3);
}

.gh-section-heading h2 {
	color: var(--gh-color-ink);
	font-size: 20px;
	font-weight: 800;
	margin: 0;
}

.gh-child-category-nav,
.gh-related-categories,
.gh-category-support-strip {
	margin-bottom: var(--gh-space-5);
}

.gh-child-category-nav__grid {
	display: grid;
	gap: var(--gh-space-3);
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gh-related-categories__item {
	background: var(--gh-color-surface);
	border: 1px solid var(--gh-color-line);
	border-radius: var(--gh-category-card-radius);
	color: var(--gh-color-ink);
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gh-related-categories__item:hover,
.gh-related-categories__item:focus-visible {
	border-color: var(--gh-color-primary);
	box-shadow: 0 8px 20px rgba(31, 42, 47, 0.06);
	transform: translateY(-1px);
}

.gh-related-categories__item small {
	color: var(--gh-color-ink-soft);
	font-size: 13px;
}

.gh-related-categories__list {
	display: grid;
	gap: var(--gh-space-3);
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gh-related-categories__item {
	display: flex;
	flex-direction: column;
	gap: var(--gh-space-1);
	min-height: 72px;
	padding: var(--gh-space-3) var(--gh-space-4);
}

.gh-related-categories__item span {
	font-weight: 800;
}

.gh-category-support-strip {
	align-items: center;
	background: var(--gh-color-ink);
	border-radius: var(--gh-category-card-radius);
	color: var(--gh-color-white);
	display: grid;
	gap: var(--gh-space-4);
	grid-template-columns: minmax(0, 1fr) auto;
	padding: var(--gh-space-4);
}

.gh-category-support-strip h2,
.gh-category-support-strip p {
	margin: 0;
}

.gh-category-support-strip h2 {
	color: var(--gh-color-white);
	font-size: 20px;
	font-weight: 800;
}

.gh-category-support-strip p {
	color: rgba(255, 255, 255, 0.76);
	margin-top: var(--gh-space-1);
}

.gh-category-support-strip__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gh-space-3);
	justify-content: flex-end;
}

/* 3. Product-card approved overrides */

/* GH-C002 is isolated in assets/css/gh-product-card.css. */

/* 4. Product modules: related/recently viewed */

/*
 * No visual overrides. These modules inherit the native Partdo card system.
 */

/* 5. Toolbar, filters and pagination */

/*
 * No visual overrides. Partdo owns the archive controls.
 */

/* 6. Single-product approved overrides */

body.single-product .gh-product-pdf-embeds {
	display: grid;
	gap: var(--gh-space-5);
	margin: var(--gh-space-5) 0;
}

/* 7. Responsive adjustments */

@media (max-width: 960px) {
	.gh-category-hero,
	.gh-category-support-strip {
		grid-template-columns: 1fr;
	}

	.gh-category-hero__media {
		height: 160px;
		min-height: 160px;
	}

	.gh-child-category-nav__grid {
		display: flex;
		gap: var(--gh-space-2);
		margin-left: -15px;
		margin-right: -15px;
		overflow-x: auto;
		padding: 0 15px var(--gh-space-2);
		scroll-snap-type: x proximity;
	}

	.gh-child-category-nav__grid .gh-child-category-card {
		flex: 0 0 148px;
		scroll-snap-align: start;
	}

	.gh-related-categories__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gh-category-support-strip__actions {
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.gh-category-archive .gh-commerce-breadcrumb {
		margin-bottom: var(--gh-space-2);
	}

	.gh-category-hero__content {
		min-height: 0;
		padding: var(--gh-space-4);
	}

	.gh-commerce-archive__title {
		font-size: clamp(30px, 9vw, 36px);
	}

	.gh-category-hero__media {
		height: 132px;
		min-height: 132px;
	}

	.gh-category-stats {
		margin-bottom: var(--gh-space-3);
	}

	.gh-category-stats__item {
		padding: var(--gh-space-2);
	}

	.gh-category-stats__item strong {
		font-size: 20px;
	}

	.gh-category-stats__item span {
		font-size: 9px;
	}

	.gh-child-category-nav,
	.gh-related-categories,
	.gh-category-support-strip {
		margin-bottom: var(--gh-space-4);
	}

	.gh-related-categories__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gh-category-support-strip {
		padding-bottom: calc(var(--gh-space-4) + 56px);
	}

	.gh-category-support-strip__actions,
	.gh-category-support-strip__actions .gh-button {
		width: 100%;
	}
}
