/* Products Hero — ACF block */

.ortega-products-hero.is-text-entrance-pending .ortega-products-hero__headline {
	visibility: hidden;
}

.ortega-products-hero {
	--ortega-ph-blue: #0058a4;
	--ortega-ph-navy: #093272;
	--ortega-ph-yellow: #ffe400;
	--ortega-ph-white: #fff;
	--ortega-ph-card-width: clamp(280px, 32vw, 468px);
	--ortega-ph-card-height: calc(var(--ortega-ph-card-width) * 592 / 468);
	--ortega-ph-card-panel: calc(var(--ortega-ph-card-width) * 216 / 468);
	--ortega-ph-card-gap: clamp(16px, 2.5vw, 48px);
	--ortega-ph-card-overlap: calc(var(--ortega-ph-card-panel) * 0.9);
	--ortega-ph-content-padding: clamp(1rem, 4vw, 3rem);
	--ortega-ph-track-gutter: max(var(--ortega-ph-content-padding), calc((100vw - 1440px) / 2 + var(--ortega-ph-content-padding)));
	--ortega-ph-nav-overlap: 0px;
	isolation: isolate;
	overflow: hidden;
	position: relative;
}

.ortega-products-hero__pattern {
	background-color: var(--ortega-ph-blue);
	background-image: url("../images/recipes/bg-pattern-blue.svg");
	background-position: center top;
	background-repeat: no-repeat;
	background-size: cover;
	inset: 0;
	position: absolute;
	z-index: 0;
}

.ortega-products-hero__inner {
	box-sizing: border-box;
	display: grid;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	margin-inline: auto;
	max-width: min(1440px, 100%);
	padding:
		clamp(5rem, 9vw, 7.5rem)
		var(--ortega-ph-content-padding)
		clamp(2.5rem, 5vw, 4rem);
	position: relative;
	width: 100%;
	z-index: 2;
}

.ortega-products-hero__header {
	margin-inline: auto;
	max-width: 100%;
	text-align: center;
	width: 100%;
}

.ortega-products-hero__headline {
	color: var(--ortega-ph-white);
	font-family: var(--ortega-font-display);
	font-size: var(--ortega-type-headline-lg);
	font-weight: 700;
	line-height: var(--ortega-type-headline-lg-line-height);
	margin: 0;
	text-align: center;
	text-transform: uppercase;
}

.ortega-products-hero__headline :is(p, h1, h2, h3) {
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
	text-align: center;
}

.ortega-products-hero__headline :is(p, h1, h2, h3) + :is(p, h1, h2, h3) {
	margin-top: 0.04em;
}

.ortega-products-hero__headline :is(span, .ortega-products-hero__headline-accent) {
	color: var(--ortega-ph-white);
	display: inline;
	font-size: inherit;
	line-height: inherit;
}

.ortega-products-hero__carousel {
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
	position: relative;
	width: 100vw;
}

.ortega-products-hero__viewport {
	cursor: grab;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-behavior: auto;
	scroll-padding-inline: var(--ortega-ph-content-padding);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	width: 100%;
}

.ortega-products-hero__viewport.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.ortega-products-hero__viewport::-webkit-scrollbar {
	display: none;
}

.ortega-products-hero__track {
	display: flex;
	gap: var(--ortega-ph-card-gap);
	padding:
		0
		var(--ortega-ph-track-gutter)
		0.5rem;
	width: max-content;
}

@media (max-width: 781px) {
	.ortega-products-hero__inner {
		padding-top: calc(var(--ortega-ph-nav-overlap) + clamp(3rem, 10vw, 4.5rem));
	}

	.ortega-products-hero__headline {
		font-size: clamp(32px, 10.5vw, var(--ortega-type-headline-lg--mobile));
		white-space: nowrap;
	}

	.ortega-products-hero__headline :is(p, h1, h2, h3) {
		display: inline;
	}

	.ortega-products-hero__headline :is(p, h1, h2, h3) + :is(p, h1, h2, h3)::before {
		content: " ";
	}

	.ortega-products-hero__viewport {
		padding-inline-start: var(--ortega-ph-content-padding);
	}

	.ortega-products-hero__track {
		align-items: stretch;
		padding-inline: 0;
	}

	.ortega-products-hero__track::after {
		content: "";
		flex: 0 0 var(--ortega-ph-content-padding);
	}

	.ortega-products-hero__slide {
		display: flex;
		flex-direction: column;
	}

	.ortega-products-hero__card {
		flex: 1 1 auto;
		height: 100%;
		min-height: var(--ortega-ph-card-height);
	}
}

.ortega-products-hero__slide {
	flex: 0 0 var(--ortega-ph-card-width);
	max-width: var(--ortega-ph-card-width);
	scroll-snap-align: start;
}

.ortega-products-hero__card {
	color: inherit;
	display: block;
	height: var(--ortega-ph-card-height);
	position: relative;
	text-decoration: none;
	width: 100%;
}

.ortega-products-hero__card:focus-visible {
	outline: 2px solid var(--ortega-ph-white);
	outline-offset: 4px;
}

.ortega-products-hero__card-media {
	border-radius: 32px;
	display: block;
	height: 100%;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.ortega-products-hero__card-photo {
	display: block;
	height: calc(100% - var(--ortega-ph-card-panel));
	inset: 0 0 auto;
	overflow: hidden;
	position: absolute;
	width: 100%;
}

.ortega-products-hero__card-bg {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.ortega-products-hero__card-panel {
	background-color: var(--ortega-ph-yellow);
	border-bottom-left-radius: 32px;
	border-bottom-right-radius: 32px;
	bottom: 0;
	height: var(--ortega-ph-card-panel);
	left: 0;
	position: absolute;
	width: 100%;
	z-index: 1;
}

.ortega-products-hero__card-overlay {
	align-items: center;
	display: flex;
	height: 130%;
	justify-content: flex-end;
	left: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 2;
}

.ortega-products-hero__card-overlay-image {
	display: block;
	height: auto;
	margin-right: 0;
	max-height: 100%;
	max-width: 50%;
	object-fit: contain;
	object-position: right bottom;
	width: auto;
}

.ortega-products-hero__card-title {
	align-items: center;
	bottom: 0;
	box-sizing: border-box;
	color: var(--ortega-ph-navy);
	display: flex;
	font-family: var(--ortega-font-display);
	font-size: clamp(28px, 3.2vw, 48px);
	font-weight: 700;
	height: var(--ortega-ph-card-panel);
	left: clamp(1rem, 4vw, 2rem);
	letter-spacing: 0.02em;
	line-height: 0.94;
	margin: 0;
	max-width: calc(100% - 2 * clamp(1rem, 4vw, 2rem));
	padding-right: 50%;
	position: absolute;
	text-transform: uppercase;
	z-index: 4;
}

.ortega-products-hero__nav {
	align-items: center;
	background-color: rgb(255 255 255 / 14%);
	border: 0;
	border-radius: 50%;
	color: var(--ortega-ph-white);
	cursor: pointer;
	display: none;
	height: 48px;
	justify-content: center;
	padding: 0;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: background-color 0.2s ease, transform 0.2s ease;
	width: 48px;
	z-index: 3;
}

.ortega-products-hero__nav:hover,
.ortega-products-hero__nav:focus-visible {
	background-color: rgb(255 255 255 / 24%);
}

.ortega-products-hero__nav:focus-visible {
	outline: 2px solid var(--ortega-ph-white);
	outline-offset: 3px;
}

.ortega-products-hero__nav--prev {
	left: max(0.75rem, calc((100vw - 1440px) / 2 + 0.75rem));
}

.ortega-products-hero__nav--next {
	right: max(0.75rem, calc((100vw - 1440px) / 2 + 0.75rem));
}

.ortega-products-hero__edge {
	bottom: -1px;
	display: block;
	height: auto;
	left: 50%;
	pointer-events: none;
	position: absolute;
	transform: translateX(-50%);
	width: 110vw;
	z-index: 3;
}

.ortega-products-hero-placeholder {
	border: 1px dashed var(--ortega-ph-blue);
	color: var(--ortega-ph-blue);
	font-family: var(--ortega-font-body);
	padding: 1.5rem;
	text-align: center;
}

body.ortega-hero-nav-scroll .ortega-products-hero {
	--ortega-ph-nav-overlap: 112px;
}

@media (max-width: 781px) {
	body.ortega-hero-nav-scroll .ortega-products-hero {
		--ortega-ph-nav-overlap: 73px;
	}
}

@media (min-width: 782px) {
	.ortega-products-hero {
		--ortega-ph-header-gap: 90px;
		margin-bottom: calc(-1 * var(--ortega-ph-card-overlap));
		overflow: visible;
	}

	.ortega-products-hero__pattern {
		bottom: var(--ortega-ph-card-overlap);
	}

	.ortega-products-hero__inner {
		display: grid;
		gap: var(--ortega-ph-header-gap);
		grid-template-rows: auto auto;
		padding:
			calc(var(--ortega-ph-nav-overlap) + var(--ortega-ph-header-gap))
			var(--ortega-ph-content-padding)
			0;
	}

	.ortega-products-hero__headline {
		font-size: var(--ortega-type-headline-lg--desktop);
		line-height: var(--ortega-type-headline-lg-line-height--desktop);
	}

	.ortega-products-hero__headline :is(p, h1, h2, h3) {
		display: inline;
	}

	.ortega-products-hero__headline :is(p, h1, h2, h3) + :is(p, h1, h2, h3)::before {
		content: " ";
	}

	.ortega-products-hero__carousel {
		position: relative;
		z-index: 2;
	}

	.ortega-products-hero.is-scroll-driven .ortega-products-hero__viewport {
		cursor: default;
		overflow: hidden;
		scroll-snap-type: none;
	}

	/* Hide cards until GSAP sets entrance state (prevents load flash on desktop). */
	@media (min-width: 782px) and (min-height: 820px) {
		.ortega-products-hero.is-entrance-pending [data-products-hero-slide] {
			opacity: 0;
			visibility: hidden;
		}
	}

	.ortega-products-hero.is-scroll-driven.is-pinned {
		z-index: 90;
	}

	.ortega-products-hero.is-scroll-driven .ortega-products-hero__track {
		padding-inline-end: var(--ortega-ph-track-gutter);
		will-change: transform;
	}

	.ortega-products-hero.is-scroll-driven [data-products-hero-slide] {
		will-change: transform, opacity;
	}

	.ortega-products-hero.is-scroll-driven .ortega-products-hero__track::after {
		content: none;
		display: none;
	}

	/* Pin the rough edge to the blue/white split (pattern ends above card overlap). */
	.ortega-products-hero__edge {
		bottom: calc(var(--ortega-ph-card-overlap) - 1px);
		display: block;
		z-index: 1;
	}
}

/* Short desktop — scale cards and tighten vertical rhythm to fit the viewport. */
@media (min-width: 782px) and (max-height: 900px) {
	.ortega-products-hero {
		--ortega-ph-header-gap: clamp(1.5rem, 5vh, 90px);
		--ortega-ph-card-width: min(
			32vw,
			max(240px, calc((100vh - 400px) * 468 / 592))
		);
	}

	.ortega-products-hero__headline {
		font-size: clamp(48px, 9vh, var(--ortega-type-headline-lg--desktop));
		line-height: 1.05;
	}

	.ortega-products-hero__card-title {
		font-size: clamp(22px, 2.8vw, 40px);
	}
}

@media (min-width: 782px) and (max-height: 800px) {
	.ortega-products-hero {
		--ortega-ph-header-gap: clamp(1rem, 3.5vh, 2.5rem);
		--ortega-ph-card-width: min(
			30vw,
			max(220px, calc((100vh - 340px) * 468 / 592))
		);
	}

	.ortega-products-hero__headline {
		font-size: clamp(40px, 7.5vh, 72px);
		line-height: 1.05;
	}

	.ortega-products-hero__card-title {
		font-size: clamp(20px, 2.5vw, 32px);
	}
}

/* Short desktop fallback — drag carousel instead of scroll-driven pin. */
@media (min-width: 782px) and (max-height: 819px) {
	.ortega-products-hero__viewport {
		padding-inline-start: var(--ortega-ph-content-padding);
	}

	.ortega-products-hero__track {
		align-items: stretch;
		padding-inline: 0;
	}

	.ortega-products-hero__track::after {
		content: "";
		flex: 0 0 var(--ortega-ph-content-padding);
	}

	.ortega-products-hero__slide {
		display: flex;
		flex-direction: column;
	}

	.ortega-products-hero__card {
		flex: 1 1 auto;
		height: 100%;
		min-height: var(--ortega-ph-card-height);
	}
}

@media (min-width: 1200px) {
	.ortega-products-hero__card:hover .ortega-products-hero__card-overlay-image {
		transform: scale(1.02);
		transition: transform 0.25s ease;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ortega-products-hero.is-text-entrance-pending .ortega-products-hero__headline {
		visibility: visible;
	}

	.ortega-products-hero__viewport {
		scroll-behavior: auto;
	}

	.ortega-products-hero.is-scroll-driven .ortega-products-hero__viewport {
		overflow-x: auto;
	}

	.ortega-products-hero__card:hover .ortega-products-hero__card-overlay-image {
		transform: none;
	}
}
