/**
 * Product page: gallery layout, video gallery slide, enlarge overlay,
 * min-persons note, suffix.
 */

/* ==========================================================================
   Gallery layout
   Square slides with rounded corners and a 3-up thumbnail nav. The scope
   classes come from class-bb-product-gallery.php, which also sets the
   nav's column count, so this file never has to fight Flatsome on
   specificity alone (flatsome-shop.css is enqueued after the plugin CSS).
   The knobs below mirror styling-scss/_global_variables.scss — $radius-card,
   $radius-thumb and $color-sand — kept as local custom properties so the
   plugin stays independent of the SCSS build.
   ========================================================================== */

.bb-product-gallery,
.bb-product-thumbnails {
	--bb-gallery-ratio: 1 / 1;
	--bb-gallery-radius: 16px;
	--bb-gallery-thumb-radius: 10px;
	--bb-gallery-thumb-columns: 3;
	--bb-gallery-thumb-gap: 10px;
	--bb-gallery-placeholder: #e8e2da;
}

.bb-product-gallery .woocommerce-product-gallery__image {
	position: relative;
	width: 100%; /* Flickity cells lose Flatsome's `.slider > div` width once wrapped */
	aspect-ratio: var(--bb-gallery-ratio);
	overflow: hidden;
	border-radius: var(--bb-gallery-radius);
	background-color: var(--bb-gallery-placeholder);
}

/* Lightbox link / <picture> must fill the slide */
.bb-product-gallery .woocommerce-product-gallery__image > a,
.bb-product-gallery .woocommerce-product-gallery__image > picture {
	display: block;
	width: 100%;
	height: 100%;
}

.bb-product-gallery .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: inherit;
}

/* The zoom flyout keeps its own (large) dimensions */
.bb-product-gallery .easyzoom-flyout img {
	height: auto;
	object-fit: none;
	border-radius: 0;
}

/* --- Thumbnail nav, WooCommerce gallery (flexslider control nav) ---
   The engine this shop runs. Flatsome styles this list as a wrapping
   4-column grid with dimmed thumbs; here it becomes a single row of three
   that scrolls horizontally. Arrows and the video marker come from
   product-gallery.js. */
.bb-product-gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--bb-gallery-thumb-gap);
	margin: var(--bb-gallery-thumb-gap) 0 0;
	padding: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.bb-product-gallery .flex-control-thumbs::-webkit-scrollbar {
	width: 0;
	height: 0;
}

.bb-product-gallery .flex-control-thumbs li {
	position: relative;
	flex: 0 0 calc(
		(100% - (var(--bb-gallery-thumb-columns) - 1) * var(--bb-gallery-thumb-gap)) /
			var(--bb-gallery-thumb-columns)
	);
	width: auto; /* Flatsome: 25% */
	margin: 0;
	padding: 0; /* Flatsome: 0 5px */
	overflow: hidden;
	border-radius: var(--bb-gallery-thumb-radius);
	background-color: var(--bb-gallery-placeholder);
	list-style: none;
	scroll-snap-align: start;
}

/* .flex-active is listed too: on an equal score Flatsome's opacity would win */
.bb-product-gallery .flex-control-thumbs li img,
.bb-product-gallery .flex-control-thumbs li img.flex-active {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--bb-gallery-ratio);
	object-fit: cover;
	object-position: center;
	border-radius: inherit;
	opacity: 1; /* Flatsome dims inactive thumbs to .6 */
	cursor: pointer;
	transition: transform 0.6s ease;
}

.bb-product-gallery .flex-control-thumbs li:hover img {
	transform: scale(1.06);
}

/* Active thumb: brand ring. An inset shadow would sit behind the image, so
   this uses an outline, which paints over it. */
.bb-product-gallery .flex-control-thumbs li img.flex-active {
	outline: 2px solid var(--bb-red, #b01e22);
	outline-offset: -2px;
}

/* Video thumb marker — mirrors .bb-video-thumb__play in the Flatsome nav */
.bb-product-gallery .flex-control-thumbs li.bb-video-thumb::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	transform: translate(-40%, -50%);
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
	pointer-events: none;
}

/* --- Thumbnail nav arrows (added by product-gallery.js above 3 thumbs) --- */
.bb-thumb-nav {
	position: relative;
}

.bb-thumb-nav__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 3px 6px rgba(32, 18, 12, 0.15);
	color: #20120c;
	cursor: pointer;
	transition: opacity 0.25s ease, background 0.25s ease;
}

.bb-thumb-nav__arrow:hover {
	background: #fff;
}

.bb-thumb-nav__arrow--prev {
	left: 6px;
}

.bb-thumb-nav__arrow--next {
	right: 6px;
}

.bb-thumb-nav__arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

.bb-thumb-nav__arrow span {
	display: block;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.bb-thumb-nav__arrow--prev span {
	margin-left: 3px;
	transform: rotate(-135deg);
}

.bb-thumb-nav__arrow--next span {
	margin-right: 3px;
	transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
	.bb-product-gallery .flex-control-thumbs {
		scroll-behavior: auto;
	}

	.bb-product-gallery .flex-control-thumbs li:hover img {
		transform: none;
	}
}

/* --- Thumbnail nav, Flatsome gallery (Flickity nav row) ---
   Only rendered when the Flatsome gallery is active; the column count and
   the arrows come from class-bb-product-gallery.php. */
.product-thumbnails.bb-product-thumbnails a {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--bb-gallery-ratio);
	overflow: hidden;
	border: 0;
	border-radius: var(--bb-gallery-thumb-radius);
	background-color: var(--bb-gallery-placeholder);
}

.product-thumbnails.bb-product-thumbnails img {
	display: block;
	width: 100%;
	height: 100%;
	margin-bottom: 0; /* Flatsome's -5px peek */
	object-fit: cover;
	object-position: center;
	opacity: 1; /* Flatsome dims inactive thumbs to .5 */
	transform: none;
	transition: transform 0.6s ease;
}

.product-thumbnails.bb-product-thumbnails a:hover,
.product-thumbnails.bb-product-thumbnails .is-nav-selected a {
	border-color: transparent;
}

.product-thumbnails.bb-product-thumbnails a:hover img,
.product-thumbnails.bb-product-thumbnails .is-nav-selected a img {
	transform: scale(1.06); /* instead of Flatsome's translateY(-5px) */
	opacity: 1;
}

.product-thumbnails.bb-product-thumbnails .is-nav-selected a img {
	outline: 2px solid var(--bb-red, #b01e22);
	outline-offset: -2px;
}

/* Arrows only appear above 3 thumbs (slider-no-arrows is set in PHP) */
.product-thumbnails.bb-product-thumbnails .flickity-prev-next-button {
	z-index: 3;
}

/* --- Minimum persons note --- */
.bb-min-persons {
	display: inline-block;
	margin: 0 0 1em;
	padding: 4px 12px;
	font-size: 0.85em;
	font-weight: 600;
	color: var(--bb-red, #b01e22);
	background: var(--bb-red-tint, #f8ecec);
	border-radius: 999px;
}

/* --- "vanaf" before the product-page price (class-bb-persons.php) ---
   Same layout as the product cards (styling-scss/_card_product.scss):
     regular:  vanaf           sale:  vanaf € 51,50   (old price struck)
               € 47,50 p.p.           € 47,50 p.p.
   The price itself stays Flatsome/SCSS-styled (Peace Sans, red); the label
   is petrol body text on its own row. */
.product-page-price .bb-price-from {
	display: block;
	margin-bottom: 4px;
	font-family: 'Creato Display', sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	color: var(--bb-petrol, #244757);
}

/* Sale: label and old price share the first row, new price on the second */
.product-page-price:has(del) .bb-price-from {
	display: inline;
	margin: 0 0.25em 0 0;
}

.product-page-price del {
	font-family: 'Creato Display', sans-serif;
	font-size: 1rem;
	color: #707070;
	text-decoration: line-through;
	opacity: 1;
}

/* Flatsome: del span.amount { opacity: .6; margin-right: .3em } */
.product-page-price del .woocommerce-Price-amount {
	margin-right: 0;
	font-family: inherit;
	font-size: inherit;
	font-weight: 500;
	color: inherit;
	opacity: 1;
}

.product-page-price del::after {
	content: "\A";
	white-space: pre;
}

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

/* --- Video slide --- */
.bb-video-slide {
	position: relative;
	overflow: hidden;
	background: var(--bb-gallery-placeholder, #e8e2da);
}

.bb-video-slide .bb-video-poster {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0;
	pointer-events: none;
}

.bb-video-media {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bb-gallery-placeholder, #e8e2da);
	border-radius: inherit;
}

.bb-video-media video.bb-video-el {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bb-video-embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: var(--bb-gallery-placeholder, #e8e2da);
	border-radius: inherit;
}

.bb-video-embed iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: inherit;
}

/* Enlarge button */
.bb-video-enlarge {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 3;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.bb-video-enlarge:hover {
	background: var(--bb-red, #b01e22);
	transform: scale(1.06);
}

.bb-video-enlarge__icon,
.bb-video-enlarge__icon::before,
.bb-video-enlarge__icon::after {
	box-sizing: border-box;
}

.bb-video-enlarge__icon {
	position: relative;
	display: block;
	width: 18px;
	height: 18px;
	margin: 0 auto;
}

/* Corner "expand" arrows */
.bb-video-enlarge__icon::before,
.bb-video-enlarge__icon::after {
	content: "";
	position: absolute;
	width: 8px;
	height: 8px;
	border: 2px solid #fff;
}

.bb-video-enlarge__icon::before {
	top: 0;
	left: 0;
	border-right: 0;
	border-bottom: 0;
}

.bb-video-enlarge__icon::after {
	right: 0;
	bottom: 0;
	border-left: 0;
	border-top: 0;
}

/* Nav thumbnail (Flatsome) */
.bb-video-thumb {
	position: relative;
}

.bb-video-thumb__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	transform: translate(-40%, -50%);
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
	pointer-events: none;
}

/* --- Enlarge overlay --- */
body.bb-video-open {
	overflow: hidden;
}

.bb-video-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba(15, 15, 15, 0.9);
	backdrop-filter: blur(4px);
	animation: bb-video-fade 0.25s ease;
}

@keyframes bb-video-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.bb-video-overlay__frame {
	position: relative;
	width: min(1100px, 92vw);
	aspect-ratio: 16 / 9;
	max-height: 88vh;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.bb-video-overlay__media {
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
	background: #000;
}

.bb-video-overlay__close {
	position: absolute;
	top: 14px;
	right: 18px;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 30px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.bb-video-overlay__close:hover {
	color: var(--bb-red-light, #c93a3e);
}

/* --- Dots nav (built by product-gallery.js) ---
   Replaces the thumbnail row on mobile. Colours are $color-petrol-light
   and $color-petrol; the selected dot stretches to a pill. */
.bb-gallery-dots {
	display: none;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
}

.bb-gallery-dots .bb-gallery-dots__dot {
	width: 10px;
	height: 10px;
	min-width: 0; /* Flatsome button reset */
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: var(--bb-petrol-light, #ccdae1);
	box-shadow: none;
	cursor: pointer;
	transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.bb-gallery-dots .bb-gallery-dots__dot.is-selected {
	width: 20px;
	background: var(--bb-petrol, #244757);
}

/* Mobile: dots instead of thumbnails. Breakpoint matches MOBILE in
   product-gallery.js. */
@media (max-width: 549px) {
	.bb-product-gallery .flex-control-thumbs,
	.bb-product-gallery .bb-thumb-nav {
		display: none;
	}

	.bb-product-gallery .bb-gallery-dots {
		display: flex;
	}
}

/* --------------------------------------------------------
 * Product tabs — Flatsome "Accordion" style as white cards
 * that alternate left/right, with a plus/minus toggle.
 * Scoped to .product-page-accordian so other accordions
 * (e.g. the FAQ) keep their own styling.
 * ------------------------------------------------------ */

.product-page-accordian {
	--bb-acc-ink: var(--bb-petrol, #244757);
	--bb-acc-active: var(--bb-red, #b01e22);
	--bb-acc-icon-bg: #d6dfe5;
	--bb-acc-width: 90%;
	--bb-acc-gap: 16px;
	--bb-acc-pad: 24px;
	--bb-acc-icon: 18px;
}

.product-page-accordian .accordion {
	display: flex;
	flex-direction: column;
	gap: var(--bb-acc-gap);
}

.product-page-accordian .accordion-item {
	width: var(--bb-acc-width);
	margin-right: auto;
	overflow: hidden;
	background: #fff;
	border-radius: var(--bb-card-radius, 14px);
	box-shadow: 0 6px 24px rgba(36, 71, 87, 0.08);
}

.product-page-accordian .accordion-item:nth-child(even) {
	margin-right: 0;
	margin-left: auto;
}

.product-page-accordian .accordion-title,
.product-page-accordian .accordion-title.active {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px var(--bb-acc-pad);
	border: 0;
	background: none;
	color: var(--bb-acc-ink);
	font-family: "Peace Sans", sans-serif;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.product-page-accordian .accordion-title.active {
	color: var(--bb-acc-active);
}

/* Plus/minus toggle: a tinted square with two bars; the vertical
   bar disappears and the square turns petrol when open. */
.product-page-accordian .accordion .toggle {
	position: relative;
	top: auto;
	left: auto;
	flex: none;
	width: var(--bb-acc-icon);
	height: var(--bb-acc-icon);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: var(--bb-acc-icon-bg);
	color: var(--bb-acc-ink);
	opacity: 1;
	transform: none;
	transition: background-color 0.2s;
}

.product-page-accordian .accordion .toggle i {
	display: none;
}

.product-page-accordian .accordion .toggle::before,
.product-page-accordian .accordion .toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 50%;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform 0.2s;
}

.product-page-accordian .accordion .toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.product-page-accordian .accordion .active .toggle {
	background: var(--bb-acc-ink);
	color: #fff;
}

.product-page-accordian .accordion .active .toggle::after {
	transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
}

/* Content lines up with the title text, past the icon. */
.product-page-accordian .accordion-inner {
	padding: 0 var(--bb-acc-pad) var(--bb-acc-pad) calc(var(--bb-acc-pad) + var(--bb-acc-icon) + 14px);
	color: var(--bb-acc-ink);
	font-size: 14px;
}

.product-page-accordian .accordion-inner > :last-child {
	margin-bottom: 0;
}

/* Tablet and phone: full width, no left/right alternation. */
@media (max-width: 849px) {
	.product-page-accordian {
		--bb-acc-width: 100%;
	}
}

@media (max-width: 549px) {
	.product-page-accordian {
		--bb-acc-pad: 18px;
	}

	.product-page-accordian .accordion-inner {
		padding-left: var(--bb-acc-pad);
	}
}

/* --------------------------------------------------------
 * Sticky add-to-cart bar (class-bb-sticky-cart.php)
 * Desktop: thumb + title + price + form. Tablet: title + price
 * + form. Mobile: price + form. The button reads "Voeg toe".
 * The quantity sits right of the button so the button lands
 * near the middle. Selectors carry `.single-product
 * .sticky-add-to-cart` because the product page's own
 * add-to-cart rules (WPCodebox, _single_add_to_cart.scss)
 * match this form too — order, flex, label and wrap included.
 * ------------------------------------------------------ */

.sticky-add-to-cart--active {
	padding: 8px 16px;
	background-color: rgba(255, 255, 255, 0.96);
	border-top: 0;
	box-shadow: 0 -6px 24px rgba(36, 71, 87, 0.1);
}

.single-product .sticky-add-to-cart .bb-sticky-atc {
	gap: 16px;
	width: 100%;
	max-width: 1080px;
	justify-content: center;
	padding: 0;
}

.single-product .sticky-add-to-cart .bb-sticky-atc > * {
	margin: 0;
}

.single-product .sticky-add-to-cart .bb-sticky-atc__title {
	max-width: 240px;
	margin: 0;
	color: var(--bb-petrol, #244757);
}

.single-product .sticky-add-to-cart .bb-sticky-atc__price .price-wrapper,
.single-product .sticky-add-to-cart .bb-sticky-atc__price .product-page-price {
	margin: 0;
	padding: 0;
	border: 0;
}

.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart .single_add_to_cart_button {
	order: 1;
	flex: 0 0 auto;
	min-height: 44px;
	margin: 0;
	padding: 6px 20px;
}

.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart .quantity {
	order: 2;
	margin: 0;
}

/* "Aantal personen" label floats above the field on the page — no room here. */
.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart .quantity::before {
	display: none;
}

/* Tablet: no thumbnail. */
@media (max-width: 849px) {
	.single-product .sticky-add-to-cart .bb-sticky-atc__thumb {
		display: none;
	}
}

/* Mobile: price left, button + quantity right. */
@media (max-width: 549px) {
	.sticky-add-to-cart--active {
		padding: 8px 12px;
	}

	.single-product .sticky-add-to-cart .bb-sticky-atc {
		justify-content: space-between;
		gap: 10px;
	}

	.single-product .sticky-add-to-cart .bb-sticky-atc__title {
		display: none;
	}

	.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart {
		gap: 8px;
	}

	.single-product .sticky-add-to-cart .bb-sticky-atc__action form.cart .single_add_to_cart_button {
		min-height: 40px;
		padding: 4px 14px;
	}
}
