/**
 * Product category pages (page-templates/product-category.php), styled after the PDF catalog.
 * Markup is generated from legacy page content by inc/class-product-page.php.
 */

.product-page {
	padding-bottom: 40px;
}

/* ==========================================================================
   Hero (title + category image, like a catalog tile)
   ========================================================================== */

.product-hero {
	background:
		radial-gradient(120% 140% at 100% 0%, rgba(71, 157, 220, 0.12) 0%, rgba(71, 157, 220, 0) 55%),
		var(--c-surface);
	border-bottom: 1px solid var(--c-border);
}

.product-hero__inner {
	display: grid;
	align-items: center;
	gap: 24px;
	padding-block: 36px;
}

@media (min-width: 768px) {
	.product-hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
		gap: 48px;
		padding-block: 48px;
	}
}

.product-hero__title {
	margin: 0;
	font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
	letter-spacing: -0.02em;
}

.product-hero__media {
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: var(--shadow);
	aspect-ratio: 4 / 3;
}

.product-hero__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ==========================================================================
   Intro (content before the first table)
   ========================================================================== */

.product-intro {
	font-size: 1.0625rem;
}

/* The category image is already shown in the hero. */
.product-page:has(.product-hero__media) .product-intro img.alignright:first-of-type {
	display: none;
}

.product-intro > p:first-child > a:only-child {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid var(--c-border);
	border-radius: 999px;
	color: var(--c-brand-dark);
	font-family: var(--ff-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.product-intro > p:first-child > a:only-child:hover {
	border-color: var(--c-brand);
	background: rgba(71, 157, 220, 0.08);
}

/* ==========================================================================
   Series + product rows (PDF catalog style)
   ========================================================================== */

.product-series-list {
	margin-top: 48px;
}

.product-series + .product-series,
.product-notes + .product-series {
	margin-top: 48px;
}

.product-series__title {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 8px;
	color: var(--c-heading);
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.product-series__title::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--c-border);
}

.product-row {
	display: grid;
	gap: 16px 28px;
	padding: 26px 0;
	border-bottom: 1px solid var(--c-border);
}

@media (min-width: 768px) {
	.product-row {
		grid-template-columns: 220px minmax(0, 1fr) minmax(170px, 210px);
		align-items: start;
	}
}

.product-row__drawing {
	display: grid;
	place-items: center;
	min-height: 120px;
	padding: 16px;
	border-radius: 8px;
	background: var(--c-surface);
}

.product-row__drawing img {
	max-width: 100%;
	height: auto;
	border-radius: 0 !important;
	mix-blend-mode: multiply;
}

.product-row__name {
	margin: 0 0 12px;
	font-size: 1.125rem;
	line-height: 1.35;
}

.product-row__main > p {
	margin: 0 0 8px;
	color: var(--c-text-muted);
	font-size: 0.9375rem;
}

.product-row__specs {
	display: grid;
	gap: 6px;
	margin: 0 0 14px;
}

.product-row__spec {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.product-row__spec dt {
	min-width: 72px;
	color: var(--c-text-muted);
}

.product-row__spec dt::first-letter {
	text-transform: uppercase;
}

.product-row__spec dd {
	margin: 0;
	color: var(--c-heading);
	font-weight: 700;
}

.product-row__finishes {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 22px;
	margin-top: 4px;
}

.product-row__codes {
	padding: 14px 16px;
	border-radius: 8px;
	background: var(--c-surface);
}

.product-row__codes-label {
	display: block;
	margin-bottom: 8px;
	color: var(--c-text-muted);
	font-family: var(--ff-heading);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.product-row__codes ul {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.product-row__codes code {
	color: var(--c-heading);
	font-family: var(--ff-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
}

/* Notes under a series ("Inne długości na zamówienie", material grade) */
.product-notes {
	margin-top: 14px;
	color: var(--c-text-muted);
	font-size: 0.875rem;
	line-height: 1.6;
}

.product-notes p {
	margin: 0;
}

/* ==========================================================================
   More (SEO text after the tables)
   ========================================================================== */

.product-more {
	max-width: 78ch;
	margin-top: 64px;
	padding-top: 8px;
}

.product-more h2 {
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
}

.product-more > h2:first-child {
	margin-top: 0;
}

.product-page__layout {
	padding-top: 48px;
}

@media (min-width: 992px) {
	.product-page .sidebar {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-h) + 24px);
		align-self: start;
	}
}
