/**
 * Category hero banner (inc/category-hero.php). Desktop: the transparent header lies over the photo;
 * breadcrumbs bottom-left, the H1 from the middle. Mobile: white header above, «← parent» + title.
 */

.pcm-cat-hero {
	position: relative;
	height: clamp(400px, 30vw, 560px);
	overflow: hidden;
	background: #1c1c1c;
	color: #fff;
}

.pcm-cat-hero__media,
.pcm-cat-hero__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

/* soft shading: white header icons on top and white text at the bottom stay readable on light photos */
.pcm-cat-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0, rgba(0, 0, 0, 0) 170px),
		linear-gradient(to top, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 55%);
	pointer-events: none;
}

.pcm-cat-hero__inner {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: end;
	gap: 24px;
	max-width: 1760px;
	margin: 0 auto;
	padding: 0 64px 44px;
}

body.pcm-has-cat-hero .pcm-cat-hero__crumbs {
	margin: 0;
	padding: 0 0 10px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	line-height: 1.4;
}

body.pcm-has-cat-hero .pcm-cat-hero__crumbs a {
	color: #fff;
	text-decoration: none;
}

body.pcm-has-cat-hero .pcm-cat-hero__crumbs a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

body.pcm-has-cat-hero .pcm-cat-hero__title {
	margin: 0;
	color: #fff;
	font-size: clamp(40px, 4.2vw, 72px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.pcm-cat-hero__back {
	display: none;
}

/* the catalog content starts closer to the banner */
body.pcm-has-cat-hero #primary {
	margin-top: 40px;
	padding-top: 0;
}

body.pcm-has-cat-hero .ast-woocommerce-container {
	padding-top: 0 !important; /* Astra's top padding was for the breadcrumbs/title that now sit in the banner */
}

@media (max-width: 1024px) {
	.pcm-cat-hero__inner {
		padding: 0 28px 32px;
	}
}

@media (max-width: 767px) {
	.pcm-cat-hero {
		height: clamp(200px, 56vw, 320px);
	}

	.pcm-cat-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		padding: 0 16px 18px;
	}

	body.pcm-has-cat-hero .pcm-cat-hero__crumbs {
		display: none;
	}

	body.pcm-has-cat-hero .pcm-cat-hero__back {
		position: absolute;
		top: 16px;
		left: 16px;
		z-index: 1;
		display: inline-flex;
		align-items: center;
		gap: 8px;
		color: #fff;
		font-size: 13px;
		font-weight: 600;
		letter-spacing: 0.08em;
		text-decoration: none;
		text-transform: uppercase;
	}

	body.pcm-has-cat-hero .pcm-cat-hero__title {
		font-size: clamp(28px, 9vw, 40px);
	}

	body.pcm-has-cat-hero #primary {
		margin-top: 20px;
	}
}

/* Распродажа (2026-10-23): на фото главное — коробка с ручкой внизу кадра. */
body.term-rasprodazha .pcm-cat-hero__media img {
	object-position: 50% 85%;
}

/* Ежедневники (2026-10-29): фото «Перьевых ручек», кадр снизу — виден ежедневник. */
body.term-ezhednevniki .pcm-cat-hero__media img {
	object-position: 50% 100%;
}
