/* Beautera Before & After widget */
.beau-ba {
	background: var(--beautera-beige);
	padding: var(--beautera-section-pad-block) var(--beautera-section-pad-inline);
	/* Theme fallbacks — Elementor's size controls write --beau-ba-height /
	   --beau-gal-height per breakpoint and win over these. */
	--beau-ba-h-default: 540px;
	--beau-gal-h-default: 560px;
	--beau-gal-thumb-default: 152px;
}
.beau-ba__stage {
	display: none;
	max-width: var(--beau-ba-max, 880px);
	margin-inline: auto;
	border-radius: var(--beautera-radius);
	overflow: hidden;
	box-shadow: var(--beautera-shadow-lift);
	position: relative;
	height: var(--beau-ba-height, var(--beau-ba-h-default));
	background: var(--beau-ba-bg, var(--beautera-ink));
	cursor: ew-resize;
	user-select: none;
	touch-action: none;
	--beau-ba-pos: 50%;
}
.beau-ba__stage.is-active { display: block; }
/* .beau-theme prefix: must outrank .elementor img { height:auto } */
.beau-theme .beau-ba__stage img.beau-ba__before {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: var(--beau-ba-fit, cover);
	object-position: center top;
	pointer-events: none;
}
/* The clip window is a physical inset — the divider position is a physical
   coordinate driven by pointer X, identical in LTR and RTL. Clipping (rather
   than a width-sized box) keeps the after image at stage width at any size. */
.beau-ba__clip {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	clip-path: inset(0 calc(100% - var(--beau-ba-pos)) 0 0);
}
.beau-theme .beau-ba__clip img.beau-ba__after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: var(--beau-ba-fit, cover);
	object-position: center top;
}
/* Fit modes. "contain" letterboxes inside the fixed height; "auto" drops the
   fixed height and shrink-wraps the frame around the before image — never
   crops. The frame hugs the image (fit-content) so the clipped after image
   stays pixel-aligned with it, and a viewport cap keeps tall portraits sane. */
.beau-ba--fit-contain { --beau-ba-fit: contain; }
.beau-ba--fit-auto .beau-ba__stage {
	height: auto;
	width: fit-content;
	max-width: min(var(--beau-ba-max, 880px), 100%);
}
.beau-theme .beau-ba--fit-auto .beau-ba__stage img.beau-ba__before {
	position: relative;
	display: block; /* inline images leave a baseline gap under the frame */
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: var(--beau-ba-maxh, min(680px, 85vh));
	object-fit: fill;
}
.beau-ba__badge {
	position: absolute;
	bottom: 24px;
	z-index: 2;
	color: var(--beautera-paper);
	font-family: var(--beautera-sans);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	padding: 6px 14px;
	border-radius: 4px;
	pointer-events: none;
}
.beau-ba__badge--before { right: 24px; background: rgba(43, 33, 24, 0.65); }
.beau-ba__badge--after { left: 24px; background: rgba(200, 155, 60, 0.9); color: #fff; }
.beau-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--beau-ba-pos);
	transform: translateX(-50%);
	width: 2px;
	background: #fff;
	z-index: 3;
	pointer-events: none;
}
.beau-ba__handle {
	position: absolute;
	top: 50%;
	left: var(--beau-ba-pos);
	transform: translate(-50%, -50%);
	z-index: 4;
	width: 48px;
	height: 48px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

/* ── Optional gallery slider under the comparison: one large frame with
   prev/next arrows and a wrapping thumbnail strip. Slides are stacked in a
   single grid cell, so the frame never jumps between images. */
.beau-bagal {
	max-width: var(--beau-gal-max, 1200px);
	margin: 48px auto 0;
}
.beau-ba__stage + .beau-bagal { margin-block-start: 40px; }
.beau-bagal__viewport { position: relative; }
.beau-bagal__stage {
	display: grid;
	position: relative;
	height: var(--beau-gal-height, var(--beau-gal-h-default));
	border-radius: var(--beautera-radius);
	overflow: hidden;
	background: var(--beau-gal-bg, rgba(43, 33, 24, 0.06));
	box-shadow: var(--beautera-shadow-lift);
}
.beau-theme .beau-bagal__stage img {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	object-fit: var(--beau-gal-fit, cover);
	object-position: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.45s var(--beautera-ease);
}
.beau-theme .beau-bagal__stage img.is-active {
	opacity: 1;
	visibility: visible;
}
/* "auto": the frame shrink-wraps the current slide — nothing is cropped and
   there is no dead space when images have different shapes. Only the active
   slide is in flow; the rest sit absolutely on top of it for the crossfade. */
.beau-bagal--fit-auto .beau-bagal__stage {
	display: block;
	height: auto;
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}
.beau-theme .beau-bagal--fit-auto .beau-bagal__stage img {
	position: absolute;
	inset: 0;
	object-fit: contain;
}
.beau-theme .beau-bagal--fit-auto .beau-bagal__stage img.is-active {
	position: relative;
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: var(--beau-gal-maxh, min(620px, 80vh));
}
.beau-bagal--fit-contain { --beau-gal-fit: contain; }

.beau-bagal__arrow {
	position: absolute;
	inset-block-start: calc(50% - 26px);
	z-index: 3;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1px solid rgba(255, 253, 248, 0.85);
	background: rgba(43, 33, 24, 0.32);
	backdrop-filter: blur(4px);
	color: var(--beautera-paper);
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.beau-bagal__arrow:hover {
	background: var(--beautera-paper);
	border-color: var(--beautera-paper);
	color: var(--beautera-ink);
}
.beau-bagal__arrow--prev { inset-inline-start: 20px; }
.beau-bagal__arrow--next { inset-inline-end: 20px; }

.beau-bagal__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-block-start: 14px;
}
.beau-bagal__thumb {
	flex: 0 0 auto;
	width: var(--beau-gal-thumb-w, var(--beau-gal-thumb-default));
	height: calc(var(--beau-gal-thumb-w, var(--beau-gal-thumb-default)) * 0.58);
	padding: 0;
	border: 0;
	background: none;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.25s, box-shadow 0.25s, transform 0.25s;
}
.beau-bagal__thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.beau-bagal__thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px var(--beautera-gold);
}
.beau-theme .beau-bagal__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

@media (max-width: 700px) {
	.beau-ba {
		--beau-ba-h-default: 380px;
		--beau-gal-h-default: 320px;
		--beau-gal-thumb-default: 104px;
	}
	.beau-bagal__arrow { width: 42px; height: 42px; inset-block-start: calc(50% - 21px); }
	.beau-bagal__arrow--prev { inset-inline-start: 10px; }
	.beau-bagal__arrow--next { inset-inline-end: 10px; }
	.beau-bagal__thumbs { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.beau-theme .beau-bagal__stage img { transition-duration: 0.01ms; }
	.beau-bagal__thumb:hover { transform: none; }
}
