/* Bang & Olufsen gallery sliders */

/* ==========================================================
   1. Shop loop card slider
   ========================================================== */

.bopt-card-slider {
	position: relative;
	overflow: hidden;
	background: #f6f6f6;
	border-radius: 4px;
	line-height: 0;
}

.bopt-card-slider__track {
	position: relative;
	width: 100%;
	/* Keeps the card height stable while images cross-fade. */
	aspect-ratio: 1 / 1;
}

/* Fallback for browsers without aspect-ratio */
@supports not ( aspect-ratio: 1 / 1 ) {
	.bopt-card-slider__track { padding-top: 100%; }
}

.bopt-card-slider__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity .35s ease;
	margin: 0 !important;
	border-radius: 4px;
}

.bopt-card-slider__img.is-active {
	opacity: 1;
}

/* Arrows: hidden until the card is hovered */
.bopt-card-nav {
	position: absolute;
	bottom: 10px;
	z-index: 3;
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .92 );
	color: #111;
	cursor: pointer;
	opacity: 0;
	transform: translateY( 4px );
	transition: opacity .2s ease, transform .2s ease, background .2s ease;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, .12 );
}

.bopt-card-nav--prev { left: 10px; }
.bopt-card-nav--next { right: 10px; }

.bopt-card-slider:hover .bopt-card-nav,
.bopt-card-slider:focus-within .bopt-card-nav {
	opacity: 1;
	transform: translateY( 0 );
}

.bopt-card-nav:hover { background: #fff; }
.bopt-card-nav:focus-visible { outline: 2px solid #111; outline-offset: 2px; opacity: 1; }

/* Small dots at the bottom of the card */
.bopt-card-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 20px;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 5px;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.bopt-card-slider:hover .bopt-card-dots { opacity: 1; }

.bopt-card-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: rgba( 17, 17, 17, .28 );
	transition: background .2s ease;
}

.bopt-card-dot.is-active { background: #111; }

/* Touch devices: no hover, so keep the controls visible */
@media ( hover: none ) {
	.bopt-card-nav,
	.bopt-card-dots { opacity: 1; transform: none; }
}

/* ==========================================================
   2. Single product gallery controls
   ========================================================== */

.woocommerce-product-gallery {
	position: relative;
}

.bopt-single-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	pointer-events: none;
}

.bopt-single-controls > * { pointer-events: auto; }

/* Dots - bottom left */
.bopt-single-dots {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bopt-single-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba( 17, 17, 17, .25 );
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.bopt-single-dot:hover { background: rgba( 17, 17, 17, .5 ); }

.bopt-single-dot.is-active {
	background: #111;
	transform: scale( 1.15 );
}

.bopt-single-dot:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

/* Round arrows - bottom right */
.bopt-single-arrows {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bopt-single-arrow {
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba( 17, 17, 17, .15 );
	border-radius: 50%;
	background: #fff;
	color: #111;
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

.bopt-single-arrow:hover {
	background: #111;
	border-color: #111;
	color: #fff;
}

.bopt-single-arrow:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.bopt-single-arrow[disabled] {
	opacity: .35;
	cursor: default;
}

.bopt-single-arrow[disabled]:hover {
	background: #fff;
	color: #111;
	border-color: rgba( 17, 17, 17, .15 );
}

/* Hide the theme's own thumbnail strip when our controls are used */
.bopt-has-controls .flex-control-thumbs {
	display: none;
}

@media ( max-width: 600px ) {
	.bopt-single-controls { bottom: 8px; padding: 0 10px; }
	.bopt-single-arrow { width: 38px; height: 38px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.bopt-card-slider__img,
	.bopt-card-nav,
	.bopt-card-dots,
	.bopt-single-dot,
	.bopt-single-arrow {
		transition: none;
	}
}


/* ==========================================================
   Elementor & custom card support (JS-built sliders)
   ========================================================== */

/*
 * When the slider is created in the browser it replaces an existing <img>,
 * so it must inherit that image's box instead of forcing a square.
 */
.bopt-card-slider--js {
	background: transparent;
}

.bopt-card-slider--js .bopt-card-slider__track {
	aspect-ratio: auto;
	padding-top: 0;
	min-height: 1px;
}

/* First slide keeps the flow height, the rest are stacked on top of it. */
.bopt-card-slider--js .bopt-card-slider__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.bopt-card-slider--js .bopt-card-slider__img.is-active {
	position: relative;
	inset: auto;
	height: auto;
}

/* Elementor image widgets often set their own object-fit / ratio. */
.e-loop-item .bopt-card-slider__img,
.elementor-widget-image .bopt-card-slider__img {
	object-fit: cover;
	display: block;
}

/* Elementor wraps images in links - keep our buttons clickable above them. */
.bopt-card-slider .bopt-card-nav,
.bopt-card-slider .bopt-card-dots {
	pointer-events: auto;
}

.bopt-card-nav { pointer-events: auto; }

/* Some themes give loop images a transition that fights ours. */
.bopt-card-slider__img {
	transform: none !important;
}
