/**
 * Bausch Product Page
 * Single-product gallery, lightbox, summary refinements and the
 * Before / After comparison section.
 */

:root {
	--bpp-accent: #0097A0;
	--bpp-accent-dark: #007076;
	--bpp-accent-soft: rgba(0, 151, 160, 0.12);
	--bpp-ink: #103d62;
	--bpp-body: #6b7783;
	--bpp-line: #e6eaee;
	--bpp-surface: #f6f8f9;
	--bpp-radius: 12px;
	--bpp-radius-sm: 8px;
	--bpp-shadow: 0 8px 30px rgba(16, 61, 98, 0.08);
	--bpp-shadow-lift: 0 14px 40px rgba(16, 61, 98, 0.14);
}

/* =========================================================================
   1. Gallery
   ====================================================================== */

.bpp-gallery {
	margin-bottom: 30px;
}

.bpp-gallery__stage {
	position: relative;
	border: 1px solid var(--bpp-line);
	border-radius: var(--bpp-radius);
	background: #fff;
	overflow: hidden;
}

.bpp-gallery__main {
	margin: 0;
}

/* Before Slick initialises, every slide is in the flow; hide all but the
   first so the block does not flash as a tall stack of images. */
.bpp-gallery__main:not(.slick-initialized) .bpp-gallery__slide:not(:first-child) {
	display: none;
}

.bpp-gallery__slide {
	outline: none;
}

.bpp-gallery__slide img {
	display: block;
	width: 100%;
	height: auto;
}

/* --- hover zoom --- */

.bpp-gallery__zoom {
	position: relative;
	display: block;
	cursor: zoom-in;
	background-repeat: no-repeat;
	background-size: 200%;
	background-position: center;
}

.bpp-gallery__zoom.is-zooming img {
	opacity: 0;
}

.bpp-gallery__zoom img {
	transition: opacity 0.2s ease;
}

/* --- badges --- */

.bpp-gallery__flash {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	display: inline-block;
	padding: 6px 14px;
	border-radius: 100px;
	background: var(--bpp-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.4;
}

.bpp-gallery__flash--out {
	background: #8b95a1;
}

.bpp-gallery__flash + .bpp-gallery__flash {
	top: 54px;
}

/* --- expand button + counter --- */

.bpp-gallery__expand {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	width: 42px;
	height: 42px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--bpp-ink);
	box-shadow: var(--bpp-shadow);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bpp-gallery__expand:hover,
.bpp-gallery__expand:focus-visible {
	background: var(--bpp-accent);
	color: #fff;
	transform: translateY(-2px);
}

.bpp-gallery__expand svg {
	width: 18px;
	height: 18px;
}

.bpp-gallery__counter {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 3;
	padding: 5px 12px;
	border-radius: 100px;
	background: rgba(16, 61, 98, 0.72);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

/* --- thumbnails --- */

.bpp-gallery__thumbs-wrap {
	position: relative;
	margin-top: 14px;
	padding: 0 34px;
}

.bpp-gallery__thumbs:not(.slick-initialized) {
	display: flex;
	gap: 10px;
	overflow: hidden;
}

.bpp-gallery__thumbs:not(.slick-initialized) .bpp-gallery__thumb-slide {
	flex: 0 0 20%;
}

.bpp-gallery__thumbs .slick-track {
	display: flex;
}

.bpp-gallery__thumbs .slick-slide {
	height: auto;
}

.bpp-gallery__thumb-slide {
	padding: 0 5px;
}

.bpp-gallery__thumb {
	display: block;
	border: 2px solid transparent;
	border-radius: var(--bpp-radius-sm);
	overflow: hidden;
	cursor: pointer;
	background: #fff;
	opacity: 0.62;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.bpp-gallery__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.bpp-gallery__thumb:hover,
.bpp-gallery__thumb:focus-visible {
	opacity: 1;
}

.bpp-gallery__thumbs .slick-current .bpp-gallery__thumb,
.bpp-gallery__thumbs .slick-slide.slick-current .bpp-gallery__thumb {
	opacity: 1;
	border-color: var(--bpp-accent);
}

.bpp-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--bpp-line);
	border-radius: 50%;
	background: #fff;
	color: var(--bpp-ink);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bpp-gallery__arrow:hover {
	background: var(--bpp-accent);
	border-color: var(--bpp-accent);
	color: #fff;
}

.bpp-gallery__arrow svg {
	width: 15px;
	height: 15px;
}

/* Slick marks its own root `position: relative`, so the arrows anchor to the
   thumbnail track rather than the padded wrapper. Pull them back out into the
   gutter the wrapper reserves for them. */
.bpp-gallery__arrow--prev {
	left: -32px;
}

.bpp-gallery__arrow--next {
	right: -32px;
}

.bpp-gallery__arrow.slick-disabled {
	opacity: 0.35;
	cursor: default;
}

.bpp-gallery__arrow.slick-disabled:hover {
	background: #fff;
	border-color: var(--bpp-line);
	color: var(--bpp-ink);
}

/* Products with a very long gallery get slightly smaller thumbnails so more
   of the set is visible at a glance. */
@media (min-width: 992px) {
	.bpp-gallery--many .bpp-gallery__thumbs-wrap {
		padding: 0 30px;
	}
}

@media (max-width: 1023px) {
	.bpp-gallery__zoom {
		cursor: pointer;
	}
}

/* =========================================================================
   2. Lightbox
   ====================================================================== */

body.bpp-lightbox-open {
	overflow: hidden;
}

.bpp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bpp-lightbox.is-open {
	opacity: 1;
}

.bpp-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 26, 40, 0.93);
	cursor: zoom-out;
}

.bpp-lightbox__figure {
	position: relative;
	z-index: 1;
	margin: 0;
	max-width: min(92vw, 1100px);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transform: scale(0.97);
	transition: transform 0.2s ease;
}

.bpp-lightbox.is-open .bpp-lightbox__figure {
	transform: scale(1);
}

.bpp-lightbox__img {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: var(--bpp-radius-sm);
	background: #fff;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.bpp-lightbox__caption {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 14px;
	text-align: center;
}

.bpp-lightbox__caption:empty {
	display: none;
}

.bpp-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.bpp-lightbox__btn:hover,
.bpp-lightbox__btn:focus-visible {
	background: var(--bpp-accent);
}

.bpp-lightbox__btn svg {
	width: 22px;
	height: 22px;
}

.bpp-lightbox__close {
	top: 20px;
	right: 20px;
}

.bpp-lightbox__nav {
	top: 50%;
	margin-top: -23px;
}

.bpp-lightbox__nav--prev {
	left: 20px;
}

.bpp-lightbox__nav--next {
	right: 20px;
}

.bpp-lightbox--solo .bpp-lightbox__nav,
.bpp-lightbox--solo .bpp-lightbox__counter {
	display: none;
}

.bpp-lightbox__counter {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	padding: 6px 16px;
	border-radius: 100px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}

@media (max-width: 767px) {
	.bpp-lightbox__nav {
		width: 40px;
		height: 40px;
		margin-top: -20px;
	}

	.bpp-lightbox__nav--prev {
		left: 8px;
	}

	.bpp-lightbox__nav--next {
		right: 8px;
	}

	.bpp-lightbox__close {
		top: 12px;
		right: 12px;
	}
}

/* =========================================================================
   3. Product summary refinements
   ====================================================================== */

.single-product .product-block {
	align-items: flex-start;
}

.single-product .product-block-info {
	padding-top: 0 !important;
}

.single-product .product-block-title {
	color: var(--bpp-ink);
	letter-spacing: -0.01em;
}

.single-product .product-block-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--bpp-line);
}

.single-product .product-block-price .price {
	color: var(--bpp-accent);
	font-weight: 700;
}

.single-product .product-block-price del {
	opacity: 0.55;
	font-weight: 400;
}

.single-product .product-block-price ins {
	text-decoration: none;
}

.single-product .woocommerce-product-details__short-description {
	color: var(--bpp-body);
	line-height: 1.75;
}

/* Stock state reads as a pill rather than a stray line of text. */
.single-product .product-block-info .stock {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 14px;
	border-radius: 100px;
	font-size: 13px;
	font-weight: 600;
}

.single-product .product-block-info .stock::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.single-product .product-block-info .stock.in-stock {
	background: var(--bpp-accent-soft);
	color: var(--bpp-accent-dark);
}

.single-product .product-block-info .stock.out-of-stock {
	background: rgba(139, 149, 161, 0.15);
	color: #6b7783;
}

.single-product .product-block-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.single-product .product-block-actions .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--bpp-line);
	border-radius: var(--bpp-radius-sm);
	overflow: hidden;
}

.single-product .product-block-actions .quantity input.qty {
	width: 68px;
	height: 52px;
	border: 0;
	text-align: center;
	font-weight: 600;
	color: var(--bpp-ink);
	background: transparent;
}

.single-product .product_meta {
	margin-top: 26px;
	padding-top: 20px;
	border-top: 1px solid var(--bpp-line);
	font-size: 14px;
	color: var(--bpp-body);
}

.single-product .product_meta > span {
	display: block;
}

.single-product .product_meta > span + span {
	margin-top: 6px;
}

/* --- tabs --- */

.single-product .prd-tabs-wrap .woocommerce-tabs ul.tabs {
	border-bottom: 1px solid var(--bpp-line);
}

.single-product .prd-tabs-wrap .woocommerce-tabs .panel {
	color: var(--bpp-body);
	line-height: 1.8;
}

/* --- sticky add-to-cart bar (small screens) --- */

.bpp-sticky-cart {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	display: none;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: #fff;
	border-top: 1px solid var(--bpp-line);
	box-shadow: 0 -6px 24px rgba(16, 61, 98, 0.1);
	transform: translateY(110%);
	transition: transform 0.25s ease;
}

.bpp-sticky-cart.is-visible {
	transform: translateY(0);
}

.bpp-sticky-cart__thumb {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: var(--bpp-radius-sm);
	object-fit: cover;
}

.bpp-sticky-cart__text {
	flex: 1 1 auto;
	min-width: 0;
}

.bpp-sticky-cart__title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--bpp-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bpp-sticky-cart__price {
	display: block;
	font-size: 14px;
	color: var(--bpp-accent);
	font-weight: 700;
}

.bpp-sticky-cart__price del {
	opacity: 0.5;
	font-weight: 400;
}

.bpp-sticky-cart__btn {
	flex: 0 0 auto;
	padding: 12px 22px;
	border: 0;
	border-radius: var(--bpp-radius-sm);
	background: var(--bpp-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.bpp-sticky-cart__btn:hover {
	background: var(--bpp-accent-dark);
	color: #fff;
}

@media (max-width: 991px) {
	.bpp-sticky-cart {
		display: flex;
	}
}

/* =========================================================================
   4. Before / After section
   ====================================================================== */

.bpp-ba {
	padding: 70px 0;
	background: var(--bpp-surface);
}

.bpp-ba__head {
	max-width: 640px;
	margin: 0 auto 44px;
	text-align: center;
}

.bpp-ba__sub {
	margin-bottom: 10px;
	color: var(--bpp-accent);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.bpp-ba__title {
	margin: 0;
	color: var(--bpp-ink);
	font-size: 34px;
	line-height: 1.25;
}

.bpp-ba__decor {
	width: 60px;
	height: 3px;
	margin: 18px auto 0;
	border-radius: 3px;
	background: var(--bpp-accent);
}

.bpp-ba__hint {
	margin: 16px 0 0;
	color: var(--bpp-body);
	font-size: 14px;
}

.bpp-ba__grid {
	display: grid;
	gap: 30px;
}

.bpp-ba__grid--cols-1 {
	grid-template-columns: minmax(0, 720px);
	justify-content: center;
}

@media (min-width: 768px) {
	.bpp-ba__grid--cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.bpp-ba__item {
	margin: 0;
	border-radius: var(--bpp-radius);
	background: #fff;
	box-shadow: var(--bpp-shadow);
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.bpp-ba__item:hover {
	box-shadow: var(--bpp-shadow-lift);
	transform: translateY(-3px);
}

.bpp-ba__caption {
	padding: 18px 22px;
	color: var(--bpp-ink);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}

/* --- comparison slider --- */

.bpp-compare {
	--bpp-pos: 50%;
	position: relative;
	overflow: hidden;
	line-height: 0;
	touch-action: pan-y;
	user-select: none;
}

/* The "before" image is in flow and therefore sets the height; the "after"
   image is laid over it and revealed from the divider rightwards. */
.bpp-compare__img {
	display: block;
	width: 100%;
	height: auto;
}

.bpp-compare__img--after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	clip-path: inset(0 0 0 var(--bpp-pos));
}

.bpp-compare__label {
	position: absolute;
	bottom: 14px;
	z-index: 3;
	padding: 5px 14px;
	border-radius: 100px;
	background: rgba(16, 61, 98, 0.78);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	pointer-events: none;
}

.bpp-compare__label--before {
	left: 14px;
}

.bpp-compare__label--after {
	right: 14px;
}

.bpp-compare__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--bpp-pos);
	z-index: 4;
	width: 3px;
	margin-left: -1.5px;
	background: #fff;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
	pointer-events: none;
}

.bpp-compare__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	background: #fff;
	color: var(--bpp-ink);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

.bpp-compare__handle svg {
	width: 22px;
	height: 22px;
}

/* The range input is the real control: stretched over the whole image and
   made invisible, so a drag or tap anywhere moves the divider. */
.bpp-compare__range {
	position: absolute;
	inset: 0;
	z-index: 5;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	opacity: 0;
	cursor: ew-resize;
	-webkit-appearance: none;
	appearance: none;
}

.bpp-compare__range::-webkit-slider-thumb {
	width: 46px;
	height: 100%;
	cursor: ew-resize;
	-webkit-appearance: none;
	appearance: none;
}

.bpp-compare__range::-moz-range-thumb {
	width: 46px;
	height: 100%;
	border: 0;
	border-radius: 0;
	cursor: ew-resize;
}

.bpp-compare__range:focus-visible ~ .bpp-compare__divider .bpp-compare__handle {
	outline: 3px solid var(--bpp-accent);
	outline-offset: 3px;
}

.bpp-compare__range:active ~ .bpp-compare__divider .bpp-compare__handle {
	transform: scale(1.08);
}

/* Without JS the divider would sit at the default 50% and the input still
   works, so no no-JS fallback beyond the inline custom property is needed. */

@media (max-width: 767px) {
	.bpp-ba {
		padding: 46px 0;
	}

	.bpp-ba__title {
		font-size: 26px;
	}

	.bpp-ba__head {
		margin-bottom: 30px;
	}
}
