/* ==========================================================================
   N14 Product gallery
   ========================================================================== */
.n14-pgallery {
	position: relative;
	--n14-badge-bg: var(--wp--preset--color--ink);
	--n14-badge-fg: var(--wp--preset--color--surface);
}
.n14-pgallery__track {
	position: relative;
	margin: 0;
}
.n14-pgallery__item {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--blush);
}
.n14-pgallery__zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}
.n14-pgallery__item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

/* Offer label: follows the page while the photos scroll */
.n14-pgallery__badge-rail {
	position: sticky;
	top: calc(var(--n14-header-h, 0px) + 16px);
	z-index: 5;
	height: 0;
}
.n14-sale-badge {
	white-space: nowrap;
	position: absolute;
	top: 16px;
	left: 16px;
	margin: 0;
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.125rem;
	padding: 0.625rem 0.875rem 0.5rem;
	background: var(--n14-badge-bg);
	color: var(--n14-badge-fg);
	line-height: 1;
	box-shadow: 0 10px 24px -12px rgba(28, 24, 24, 0.5);
}
.n14-sale-badge__label {
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}
.n14-sale-badge__value {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

/* Desktop: large photos one under the other */
@media (min-width: 1024px) {
	.n14-pgallery__track {
		display: grid;
		gap: var(--n14-gallery-gap, 12px);
	}
	.n14-pgallery__thumbs {
		display: none;
	}
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item {
		opacity: 0;
		transform: translateY(32px);
		transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
	}
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item img {
		transform: scale(1.04);
		transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1);
	}
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item.is-visible,
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item.is-visible img {
		opacity: 1;
		transform: none;
	}
}

/* Tablet + smartphone: swipe gallery with small thumbnails */
@media (max-width: 1023.98px) {
	.n14-pgallery__badge-rail {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
	}
	.n14-pgallery__track {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.n14-pgallery__track::-webkit-scrollbar {
		display: none;
	}
	.n14-pgallery__item {
		flex: 0 0 100%;
		scroll-snap-align: start;
		background: transparent;
	}
	/* Crop: every photo gets the same shape, filled and centered */
	.n14-pgallery.is-mobile-crop .n14-pgallery__item img {
		aspect-ratio: var(--n14-mobile-ratio, 4 / 5);
		height: auto;
		object-fit: cover;
		object-position: center;
	}
	/* Adapt: the frame follows the height of the photo you are looking at */
	.n14-pgallery.is-mobile-adapt .n14-pgallery__item img {
		aspect-ratio: auto;
	}
	.n14-pgallery.is-mobile-adapt .n14-pgallery__track {
		align-items: flex-start;
		transition: height 0.35s ease;
	}
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item {
		opacity: 0;
		transition: opacity 0.9s ease;
	}
	.n14-pgallery.has-reveal.is-js .n14-pgallery__item.is-visible {
		opacity: 1;
	}
	.n14-pgallery__thumbs {
		display: flex;
		gap: 0.5rem;
		margin-top: 0.625rem;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.n14-pgallery__thumb {
		flex: 0 0 56px;
		height: 70px;
		padding: 0;
		border: 1px solid transparent;
		background: none;
		opacity: 0.55;
		cursor: pointer;
	}
	.n14-pgallery__thumb img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
	.n14-pgallery__thumb.is-active {
		opacity: 1;
		border-color: var(--wp--preset--color--ink);
	}
	.n14-sale-badge {
		top: 12px;
		left: 12px;
		padding: 0.5rem 0.625rem 0.375rem;
	}
	.n14-sale-badge__value {
		font-size: 1.375rem;
	}
}

/* Lightbox */
.n14-lightbox {
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(251, 248, 245, 0.97);
}
.n14-lightbox::backdrop {
	background: rgba(28, 24, 24, 0.4);
}
.n14-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}
.n14-lightbox__img {
	max-width: 92vw;
	max-height: 92vh;
	object-fit: contain;
}
.n14-lightbox__close,
.n14-lightbox__prev,
.n14-lightbox__next {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
.n14-lightbox__close { top: 16px; right: 16px; }
.n14-lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.n14-lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Editor */
.n14-pgallery.is-editor-preview {
	min-height: 520px;
	background: var(--wp--preset--color--blush);
}
.n14-pgallery__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 520px;
	text-align: center;
	color: var(--wp--preset--color--muted);
}
.n14-pgallery__placeholder span {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	color: var(--wp--preset--color--ink);
}

/* Video in the gallery */
.n14-pgallery__item.is-video {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--blush);
}
.n14-pgallery__video,
.n14-pgallery__iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}
.n14-pgallery__vtoggle {
	position: absolute;
	right: 14px;
	bottom: 14px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.88);
	cursor: pointer;
}
.n14-pgallery__vtoggle::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 12px;
	height: 14px;
	background: linear-gradient(90deg, var(--wp--preset--color--ink) 0 4px, transparent 4px 8px, var(--wp--preset--color--ink) 8px 12px);
}
.n14-pgallery__vtoggle.is-paused::before {
	width: 0;
	height: 0;
	margin: auto auto auto 17px;
	background: none;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent var(--wp--preset--color--ink);
}
.n14-pgallery__vplay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	border: 0;
	background: var(--wp--preset--color--blush) center / cover no-repeat;
	color: #fff;
	cursor: pointer;
}
.n14-pgallery__vplay-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(28, 24, 24, 0.55);
	position: relative;
}
.n14-pgallery__vplay-icon::after {
	content: "";
	position: absolute;
	left: 26px;
	top: 20px;
	border-style: solid;
	border-width: 12px 0 12px 18px;
	border-color: transparent transparent transparent #fff;
}
.n14-pgallery__vplay-text {
	padding: 0.375rem 0.875rem;
	border-radius: 999px;
	background: rgba(28, 24, 24, 0.55);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.n14-pgallery__thumb.is-video {
	position: relative;
	background: var(--wp--preset--color--blush) center / cover no-repeat;
}
.n14-pgallery__thumb.is-video::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border-radius: 50%;
	background: rgba(28, 24, 24, 0.6);
}
.n14-pgallery__thumb.is-video::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -6px 0 0 -3px;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
}
/* Play cover over the MP4 until it is playing */
.n14-pgallery__vcover {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--blush) center / cover no-repeat;
	transition: opacity 0.4s ease;
	pointer-events: none;
}
.n14-pgallery__item.is-playing .n14-pgallery__vcover {
	opacity: 0;
}
.n14-pgallery__vtoggle {
	z-index: 2;
}
