/* Shared slider used by the Product Videos + Product Gallery widgets. */

.nrpv {
	position: relative;
}

.nrpv__swiper {
	overflow: hidden;
}

.nrpv__slide {
	height: auto;
}

.nrpv__frame {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 50px;
	background: #000;
	cursor: pointer;
	/* Safari clips children of a rounded box correctly only with its own stacking context. */
	isolation: isolate;
	transform: translateZ(0);
}

.nrpv__thumb,
.nrpv__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: 0;
	transition: transform .4s ease;
}

.nrpv__frame:hover .nrpv__thumb,
.nrpv__frame:hover .nrpv__img {
	transform: scale(1.04);
}

.nrpv__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.nrpv__link {
	display: block;
	width: 100%;
	height: 100%;
}

.nrpv__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background-color: rgba(0, 0, 0, .55);
	cursor: pointer;
	transition: transform .25s ease, background-color .25s ease;
}

.nrpv__play svg {
	margin-inline-start: 3px;
}

.nrpv__frame:hover .nrpv__play {
	transform: translate(-50%, -50%) scale(1.1);
}

.nrpv__play:focus-visible,
.nrpv__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ---- Navigation ----
 * Arrows reuse the site-wide .peek-arrow class (Customizer > Additional CSS) so they stay
 * identical to the Case Studies slider. These rules mirror those values so the widget still
 * looks right if that stylesheet ever changes, and only add layout on top.
 */
.nrpv__nav {
	display: flex;
	flex-direction: row;
	gap: 12px;
	margin-top: 32px;
}

.nrpv__arrow {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid #1a3a6b;
	background: transparent;
	color: #1a3a6b;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	flex-shrink: 0;
	transition: background .2s, color .2s;
	-webkit-tap-highlight-color: transparent;
}

.nrpv__arrow:hover,
.nrpv__arrow:active,
.nrpv__arrow:focus {
	background: #1a3a6b;
	color: #fff;
}

.nrpv__arrow svg {
	display: block;
	width: 32px;
	height: 32px;
	pointer-events: none;
	flex-shrink: 0;
}

.nrpv__arrow.swiper-button-disabled {
	opacity: .35;
	pointer-events: none;
}

/* watchOverflow adds -lock when every slide already fits: no slider needed, no arrows. */
.nrpv__arrow.swiper-button-lock,
.nrpv__nav--locked {
	display: none;
}

/* ---- Top-right nav, in line with the section heading ----
 * The JS moves .nrpv__nav--top up into the Elementor container that also holds the heading
 * and tags it .nrpv-nav-host, so the arrows can sit on the heading's line.
 */
.nrpv-nav-host {
	position: relative;
}

@media (min-width: 1025px) {
	.nrpv-nav-host > .nrpv__nav--top {
		position: absolute;
		top: 0;
		inset-inline-end: 0;
		margin-top: 0;
		z-index: 5;
	}
}

/* Below desktop the arrows sit under the slider, centred. */
@media (max-width: 1024px) {
	.nrpv-nav-host > .nrpv__nav--top {
		position: static;
		margin-top: 20px;
		justify-content: center;
	}
}

/* ---- Gallery ---- */
/* Elementor row containers size children to their content, which collapsed the gallery
 * to the image's natural width and pinned it left. The widget must own the full column. */
.elementor-widget-newroad-product-gallery,
.elementor-widget-newroad-product-videos {
	width: 100%;
	align-self: stretch;
}

.elementor-widget-newroad-product-gallery > .elementor-widget-container {
	width: 100%;
	height: 100%;
}

.nrpv--gallery {
	width: 100%;
}

.nrpv--gallery .nrpv__slide {
	display: block;
	height: auto;
}

.nrpv--gallery .nrpv__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 0;
}

/* Every product's gallery is the same box: fixed ratio, image fills it, no dead space. */
.nrpv--gallery .nrpv__box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 50px;
}

.nrpv--gallery .nrpv__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 50px;
}

.nrpv--gallery .nrpv__img:hover {
	transform: none;
}

/* Stretch mode: match the height of the column beside it. */
.nrpv--stretch {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.nrpv--stretch .nrpv__swiper {
	flex: 1 1 auto;
	min-height: 0;
}

.nrpv--stretch .swiper-wrapper,
.nrpv--stretch .nrpv__slide {
	height: 100%;
}

.nrpv--stretch .nrpv__box {
	height: 100%;
	aspect-ratio: auto;
}

.nrpv--stretch .nrpv__nav {
	flex: 0 0 auto;
}

/* Stacked layouts have no column to match, so fall back to the fixed ratio. */
@media (max-width: 1024px) {
	.nrpv--stretch {
		height: auto;
	}

	.nrpv--stretch .nrpv__box {
		height: auto;
		aspect-ratio: 16 / 9;
	}
}

/* Arrows centred under the gallery, at every screen size. */
.nrpv__nav--center {
	justify-content: center;
	margin-top: 20px;
}

.nrpv__dots {
	position: static;
	margin-top: 16px;
}

.nrpv__dots.swiper-pagination-lock {
	display: none;
}

.nrpv__notice {
	padding: 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #646970;
	text-align: center;
}

@media (max-width: 1024px) {
	.nrpv__arrow {
		width: 44px;
		height: 44px;
	}

	.nrpv__arrow svg {
		width: 26px;
		height: 26px;
	}

	.nrpv__play {
		width: 54px;
		height: 54px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nrpv__thumb,
	.nrpv__img,
	.nrpv__play {
		transition: none;
	}

	.nrpv__frame:hover .nrpv__thumb,
	.nrpv__frame:hover .nrpv__img {
		transform: none;
	}
}
