.jblseo-compare-empty {
	display: none;
}

/*
 * Product has no comparison data: the shortcode prints only the hidden marker.
 * Elementor containers often keep a min-height (this template uses 600px), which
 * would leave a blank band where the block used to be. Collapse it.
 */
/**
 * Per-product before/after comparison block (front end).
 */
.jblseo-compare {
	display: grid;
	grid-template-columns: 1fr 1fr; /* 50% text · 50% images */
	gap: 0; /* no space between the text panel and the comparison */
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.jblseo-compare > * {
	min-width: 0;
}

.jblseo-compare--single,
.jblseo-compare--media-only {
	grid-template-columns: 1fr;
}

.jblseo-compare--media-only .jblseo-compare-media,
.jblseo-compare--single .jblseo-compare-media {
	grid-column: 1 / -1;
}

.jblseo-compare-panel {
	background: #f4f1ec;
	border-radius: 4px;
	padding: 28px 30px;
	color: #1f1f1f;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: auto;
	/* Safety valve: if someone pastes a very long text, it scrolls instead of
	   spilling out of the beige box. */
	overflow: auto;
}

.jblseo-compare-title {
	margin: 0 0 12px;
	font-size: 1.15em;
	line-height: 1.3;
}

.jblseo-compare-body {
	font-size: 0.95em;
	line-height: 1.65;
}

.jblseo-compare-body p {
	margin: 0 0 0.8em;
}

.jblseo-compare-body p:last-child {
	margin-bottom: 0;
}

/* Edge-to-edge opt-in: [jblseo_compare bleed="1"] */
.jblseo-compare--bleed {
	width: var(--jblseo-vw, 100vw);
	max-width: var(--jblseo-vw, 100vw);
	margin-left: calc(50% - var(--jblseo-vw, 100vw) / 2);
	margin-right: calc(50% - var(--jblseo-vw, 100vw) / 2);
	box-sizing: border-box;
}

.jblseo-compare-media {
	min-width: 0;
	/* Stretches to the row; if the text column is taller than the capped photo
	   frame, the frame is centred instead of leaving the gap under it. */
	display: flex;
	align-items: center;
}

.jblseo-ba {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	/* Thin BLACK frame around the whole comparison (keeps the photos inside it). */
	border: 1px solid #000;
	border-radius: 4px;
	line-height: 0;
	touch-action: pan-y;
	/* Explicit width: with max-height + aspect-ratio the box otherwise shrank to
	   496px inside a 980px column (measured on the live page). */
	width: 100%;
	flex: 1 1 auto;
	height: auto;
	aspect-ratio: 4 / 5;
	/* Frame height cap (desktop): taller than the 500px pass, below the old 620px. */
	max-height: 560px;
	background: #f1efec;
	contain: paint;
}

/* The theme keeps <img> at its natural ratio (height:auto); without this the
   photo renders 1170px tall inside a 620px frame and its bottom is cut off. */
.jblseo-ba-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	z-index: 1;
	object-fit: cover;
	object-position: center top;
	user-select: none;
	pointer-events: none;
}

.jblseo-ba-top {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	/* The reveal is a clip-path animation; promote it so dragging stays smooth. */
	will-change: clip-path;
	clip-path: inset(0 0 0 var(--pos, 50%));
}

/* "Before" / "After": plain small black text on the photo - no box, no blur,
   no shadow. The frame sets line-height: 0, hence the explicit line-height. */
.jblseo-ba-tag {
	position: absolute;
	top: 14px;
	z-index: 5;
	display: inline-block;
	font-size: 10px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	color: #000;
	pointer-events: none;
	white-space: nowrap;
}

.jblseo-ba-tag-before {
	left: 16px;
}

.jblseo-ba-tag-after {
	right: 16px;
}

/* The theme styles input[type="range"] with a white background and a border on a
   selector that outranks a single class, which painted a white sheet over both
   photos (measured on the live product page). !important is required here. */
.jblseo-ba-range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	/* Invisible on purpose: some themes style input[type="range"] with an opaque
	   background/track that cannot be reliably overridden. The visible handle and
	   divider are drawn from --pos below, so the input is only the interaction layer. */
	opacity: 0 !important;
	-webkit-appearance: none;
	appearance: none;
	cursor: ew-resize;
	z-index: 3;
}

/* Handle + divider drawn from --pos (kept in sync by compare.js).
   Both are centred on the divider line, horizontally on --pos and vertically
   in the middle of the frame. */
.jblseo-ba::before,
.jblseo-ba::after {
	content: "";
	position: absolute;
	top: 50%;
	left: var(--pos, 50%);
	transform: translate(-50%, -50%);
	z-index: 4;
	pointer-events: none;
}

.jblseo-ba::before {
	width: 2px;
	height: 100%;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.jblseo-ba::after {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #1f1f1f;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.jblseo-ba-range::-webkit-slider-runnable-track {
	height: 100%;
	background: transparent !important;
	border: 0 !important;
}

.jblseo-ba-range::-moz-range-track {
	height: 100%;
	background: transparent !important;
	border: 0 !important;
}

.jblseo-ba-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #1f1f1f;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	color: transparent;
}

.jblseo-ba-range::-moz-range-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #1f1f1f;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.jblseo-ba-range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid #1d4ed8;
	outline-offset: 2px;
}

@media (max-width: 900px) {
	.jblseo-compare {
		grid-template-columns: 1fr;
		gap: 0;
	}

	/* Phone order, fixed: heading + text first, then the before/after image. */
	.jblseo-compare-panel {
		order: 1;
		height: auto;
	}

	.jblseo-compare-media {
		order: 2;
	}

	.jblseo-compare-panel {
		padding: 20px;
	}

	.jblseo-ba {
		aspect-ratio: 1 / 1;
		max-height: 520px;
	}

	.jblseo-compare-panel {
		padding: 22px;
	}
}

/* ---------------------------------------------------------------------------
 * Full-bleed autoplaying background video (per product): [jblseo_bgvideo]
 * Fixed, standard height on every device; the video is cropped to fill it, so
 * there is never letterboxing and never a gap on the left/right.
 * ------------------------------------------------------------------------- */
/* The shortcode sits inside an Elementor flex item, which otherwise shrinks it. */
.elementor-widget-shortcode:has(> .elementor-shortcode > .jblseo-compare),
.elementor-widget-shortcode:has(> .elementor-shortcode > .jblseo-bgvideo),
.elementor-element:has(> .elementor-widget-shortcode > .elementor-shortcode > .jblseo-compare),
.elementor-element:has(> .elementor-widget-shortcode > .elementor-shortcode > .jblseo-bgvideo) {
	width: 100% !important;
	max-width: 100% !important;
	flex: 1 1 100% !important;
	flex-shrink: 0 !important;
	align-self: stretch !important;
}

.elementor-widget-shortcode:has(.jblseo-compare) > .elementor-shortcode,
.elementor-widget-shortcode:has(.jblseo-bgvideo) > .elementor-shortcode {
	width: 100% !important;
}

.jblseo-compare,
.jblseo-bgvideo {
	flex: 1 1 auto;
}

.jblseo-bgvideo {
	position: relative;
	flex: 0 0 auto;
	width: var(--jblseo-vw, 100vw);
	max-width: var(--jblseo-vw, 100vw);
	margin-left: calc(50% - var(--jblseo-vw, 100vw) / 2);
	margin-right: calc(50% - var(--jblseo-vw, 100vw) / 2);
	height: 440px;
	overflow: hidden;
	background: #000;
}

.jblseo-bgvideo-media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	cursor: pointer;
}

.jblseo-bgvideo-sound {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
	width: 42px;
	height: 42px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: background 0.15s ease, transform 0.15s ease;
}

.jblseo-bgvideo-sound:hover {
	background: rgba(0, 0, 0, 0.72);
	transform: scale(1.04);
}

.jblseo-bgvideo-sound:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.jblseo-bgvideo-sound .jblseo-snd-on {
	display: none;
}

.jblseo-bgvideo-sound.is-unmuted .jblseo-snd-muted {
	display: none;
}

.jblseo-bgvideo-sound.is-unmuted .jblseo-snd-on {
	display: block;
}

.jblseo-bgvideo-empty {
	display: none;
}

@media (max-width: 900px) {
	.jblseo-bgvideo {
		height: clamp(320px, 46vw, 420px);
	}
}

@media (max-width: 600px) {
	.jblseo-bgvideo {
		height: 235px; /* phone only: a touch shorter than 260px */
	}
}

/* Background video from YouTube / Vimeo: cover the fixed-height band */
.jblseo-bgvideo-frame {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #000;
}

.jblseo-bgvideo-frame iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 177.78vh;
	height: 56.25vw;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%, -50%);
	border: 0;
	pointer-events: none;
}


/* Click-to-load facade for YouTube / Vimeo (no third-party request before consent). */
.jblseo-bgvideo-facade {
	position: absolute;
	inset: 0;
	background-color: #000;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.jblseo-bgvideo-facade iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 177.78vh;
	height: 56.25vw;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%, -50%);
	border: 0;
	pointer-events: none;
}

.jblseo-bgvideo-play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 64px;
	height: 64px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.55);
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	cursor: pointer;
	z-index: 2;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: transform 0.15s ease, background 0.15s ease;
}

.jblseo-bgvideo-play:hover {
	transform: scale(1.05);
	background: rgba(0, 0, 0, 0.65);
}

.jblseo-bgvideo-play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.jblseo-bgvideo-play[hidden] {
	display: none;
}
