/* Details popup of the YB Product Grid. Size, colors, fonts, radii and spacing come from the Style controls (all in rem / vw / vh). */
html.ybsb-popup-open {
	overflow: hidden;
	padding-right: var(--ybsb-scrollbar-gap, 0);
}

.ybsb-popup[hidden] {
	display: none;
}

/* --ybsb-vh is set by the script from the REAL visible height (phone address bars make 100vh too tall). */
.ybsb-popup {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	height: calc(var(--ybsb-vh, 1vh) * 100);
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.ybsb-popup.ybsb-popup-visible {
	opacity: 1;
}

.ybsb-popup-overlay {
	position: absolute;
	inset: 0;
}

/*
 * The box is a fixed rectangle (Popup Width x Popup Height controls); it never resizes to its content.
 * The script places it on whole device pixels (left / top / size) so text and icons stay sharp - a box
 * centred on a half pixel is drawn blurred.
 */
.ybsb-popup-box {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	flex-direction: column;
	max-width: calc(100% - 1.5rem);
	max-height: calc(100% - 1.5rem);
	overflow: hidden;
	box-sizing: border-box;
	margin: 0;
	translate: -50% -50%;
}

.ybsb-popup-box.ybsb-popup-snapped {
	translate: none;
}

.ybsb-popup-box:focus {
	outline: none;
}

.ybsb-popup-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 0.25rem 1rem 0.5rem 0;
	/* Chrome draws sub-pixel (sharp) text only on layers with an opaque background; a scrolling layer is its own layer, so it takes the box colour. */
	background-color: inherit;
	scrollbar-width: thin;
	scrollbar-color: var(--ybsb-scroll-thumb, #94A3B8) var(--ybsb-scroll-track, transparent);
}

.ybsb-popup-body::-webkit-scrollbar,
.ybsb-qv-info::-webkit-scrollbar {
	width: 0.5rem;
}

.ybsb-popup-body::-webkit-scrollbar-thumb,
.ybsb-qv-info::-webkit-scrollbar-thumb {
	background: var(--ybsb-scroll-thumb, #94A3B8);
	border-radius: 0.25rem;
}

.ybsb-popup-body::-webkit-scrollbar-track,
.ybsb-qv-info::-webkit-scrollbar-track {
	background: var(--ybsb-scroll-track, transparent);
	border-radius: 0.25rem;
}

.ybsb-popup-box.ybsb-popup-loading .ybsb-popup-body {
	opacity: 0.35;
	pointer-events: none;
}

.ybsb-popup-status {
	margin: 0;
	padding: 4rem 0;
	text-align: center;
}

/* Loading spinner: same look and settings as the image spinner (Messages & Spinner). */
.ybsb-popup-spinner,
.ybsb-qv-main::after {
	box-sizing: border-box;
	border: var(--ybsb-img-spinner-thickness, 3px) solid var(--ybsb-img-spinner-track, rgba(0, 0, 0, 0.12));
	border-top-color: var(--ybsb-img-spinner-color, #d9381e);
	border-radius: 50%;
	animation: ybsb-image-spin var(--ybsb-img-spinner-speed, 700ms) linear infinite;
	pointer-events: none;
}

.ybsb-popup-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 4;
	width: calc(var(--ybsb-img-spinner-size, 26px) * 1.4);
	height: calc(var(--ybsb-img-spinner-size, 26px) * 1.4);
	margin: calc(var(--ybsb-img-spinner-size, 26px) * -0.7) 0 0 calc(var(--ybsb-img-spinner-size, 26px) * -0.7);
	opacity: 0;
	visibility: hidden;
}

.ybsb-popup-box.ybsb-popup-loading .ybsb-popup-spinner {
	opacity: 1;
	visibility: visible;
}

.ybsb-qv-main {
	position: relative;
	overflow: hidden;
}

.ybsb-qv-main::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	width: var(--ybsb-img-spinner-size, 26px);
	height: var(--ybsb-img-spinner-size, 26px);
	margin: calc(var(--ybsb-img-spinner-size, 26px) / -2) 0 0 calc(var(--ybsb-img-spinner-size, 26px) / -2);
}

.ybsb-qv-main.ybsb-image-ready::after,
.ybsb-card-spinner-off .ybsb-qv-main::after {
	display: none;
}

.ybsb-popup .ybsb-popup-close,
.ybsb-popup .ybsb-popup-arrow {
	box-shadow: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	transition: background-color 0.15s ease;
}

.ybsb-popup-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 5;
	font-size: 1.6rem;
}

.ybsb-popup-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	gap: 1rem;
	padding-top: 0.75rem;
}

.ybsb-popup-arrow svg {
	width: 1.2em;
	height: 1.2em;
}

.ybsb-popup-next svg {
	transform: rotate(180deg);
}

.ybsb-popup-arrow[aria-disabled="true"] {
	opacity: 0.4;
	cursor: default;
}

.ybsb-popup-counter {
	min-width: 8rem;
	text-align: center;
}

/* Keyboard focus: thick, offset, in the focus ring color. */
.ybsb-popup-close:focus-visible,
.ybsb-popup-arrow:focus-visible,
.ybsb-qv-thumb:focus-visible,
.ybsb-qv-main:focus-visible {
	outline: var(--ybsb-ring-width, 0.1875rem) solid var(--ybsb-ring, #1E40AF);
	outline-offset: var(--ybsb-ring-offset, 0.25rem);
}

/* Built-in content */
.ybsb-qv {
	display: grid;
	align-items: start;
	background-color: inherit;
	--ybsb-qv-icon: 1.75rem;
}

.ybsb-qv-media {
	min-width: 0;
}

/* The photo frame has a fixed shape; the photo is always centred inside it. */
.ybsb-qv-main {
	aspect-ratio: var(--ybsb-qv-ratio, 4 / 3);
}

.ybsb-qv-main img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

/* data-fit is the setting; data-fit-applied is what the script decided for this photo when the setting is Automatic. */
.ybsb-qv-main[data-fit="contain"] img,
.ybsb-qv-main[data-fit="auto"][data-fit-applied="contain"] img {
	inset: 0;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: auto;
	object-fit: initial;
	border-radius: var(--ybsb-qv-radius, 0.75rem);
}

.ybsb-qv-thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
}

.ybsb-popup .ybsb-qv-thumb {
	flex: 0 0 auto;
	width: 4rem;
	height: 4rem;
	padding: 0;
	border: 2px solid transparent;
	background: transparent;
	color: inherit;
	box-shadow: none;
	overflow: hidden;
	cursor: pointer;
}

/* Themes (e.g. Hello Elementor) paint buttons on hover / focus / press; the thumbnails stay transparent. */
.ybsb-popup .ybsb-qv-thumb:hover,
.ybsb-popup .ybsb-qv-thumb:focus,
.ybsb-popup .ybsb-qv-thumb:active {
	background: transparent;
	color: inherit;
	box-shadow: none;
}

.ybsb-qv-thumbs {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ybsb-qv-thumbs::-webkit-scrollbar {
	display: none;
}

.ybsb-qv-thumbs.ybsb-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.ybsb-qv-thumbs.ybsb-dragging .ybsb-qv-thumb {
	pointer-events: none;
}

.ybsb-popup .ybsb-qv-thumb-active,
.ybsb-popup .ybsb-qv-thumb-active:hover,
.ybsb-popup .ybsb-qv-thumb-active:focus {
	border-color: var(--ybsb-ring, #1E40AF);
}

.ybsb-qv-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

.ybsb-qv-info {
	min-width: 0;
	background-color: inherit;
}

.ybsb-qv-head {
	padding-right: 3rem;
}

.ybsb-qv-title {
	margin: 0 0 0.5rem;
}

.ybsb-qv-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 1rem;
}

.ybsb-qv-price,
.ybsb-qv-stock {
	margin: 0;
}

.ybsb-qv-desc {
	margin: 1rem 0 0;
}

.ybsb-qv-specs {
	display: grid;
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.ybsb-qv-group-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid transparent;
}

/* Every icon sits in a box of one size, whatever icon library or shape it comes from. */
.ybsb-qv-group-icon,
.ybsb-qv-item-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	line-height: 1;
}

.ybsb-qv-item-icon {
	width: var(--ybsb-qv-icon, 1.75rem);
	height: var(--ybsb-qv-icon, 1.75rem);
	font-size: calc(var(--ybsb-qv-icon, 1.75rem) * 0.8);
	color: var(--ybsb-ring, currentColor);
}

.ybsb-qv-group-icon {
	width: calc(var(--ybsb-qv-icon, 1.75rem) * 0.8);
	height: calc(var(--ybsb-qv-icon, 1.75rem) * 0.8);
	font-size: calc(var(--ybsb-qv-icon, 1.75rem) * 0.65);
}

.ybsb-qv-group-icon svg,
.ybsb-qv-item-icon svg,
.ybsb-qv-group-icon img,
.ybsb-qv-item-icon img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	fill: currentColor;
}

.ybsb-qv-grid {
	display: grid;
	margin: 0;
}

.ybsb-qv-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
	border: 1px solid transparent;
}

.ybsb-qv-item-text {
	min-width: 0;
}

.ybsb-qv-label,
.ybsb-qv-value {
	margin: 0;
	overflow-wrap: anywhere;
}

.ybsb-qv-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-top: 1.5rem;
	padding-bottom: 0.25rem;
}

/*
 * Stacked layout (phones, tablets in portrait, any narrow popup) is the default: one column, the whole body scrolls,
 * photos in one swipeable row, full-width buttons. Wide popups switch to two columns by the popup's OWN width.
 */
.ybsb-popup-box {
	container-type: inline-size;
	container-name: ybsb-popup;
}

.ybsb-qv {
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

.ybsb-qv-grid {
	grid-template-columns: minmax(0, 1fr);
}

.ybsb-qv-actions > *,
.ybsb-qv-actions .yb-bsd-widget {
	flex: 1 1 100%;
	justify-content: center;
	text-align: center;
}

.ybsb-qv-actions .yb-bsd-widget .yb-bsd-button.yb-bsd-button,
.ybsb-qv-actions .ybsb-fb-btn {
	width: 100%;
	justify-content: center;
}

@container ybsb-popup (min-width: 46rem) {
	.ybsb-popup-body {
		display: flex;
		overflow: hidden;
	}

	.ybsb-qv {
		flex: 1 1 auto;
		min-height: 0;
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: 2rem;
		align-items: stretch;
	}

	.ybsb-qv-media {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.ybsb-qv-main {
		flex: 1 1 auto;
		min-height: 0;
		aspect-ratio: auto;
	}

	.ybsb-qv-thumbs {
		flex: 0 0 auto;
		min-height: calc(var(--ybsb-qv-thumb, 4rem) + 0.25rem);
	}

	.ybsb-qv-info {
		min-height: 0;
		overflow-y: auto;
		background-color: inherit;
		padding-right: 1rem;
		scrollbar-width: thin;
		scrollbar-color: var(--ybsb-scroll-thumb, #94A3B8) var(--ybsb-scroll-track, transparent);
	}

	.ybsb-qv-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ybsb-qv-actions > * {
		flex: 0 0 auto;
	}

	.ybsb-qv-actions .yb-bsd-widget .yb-bsd-button.yb-bsd-button,
	.ybsb-qv-actions .ybsb-fb-btn {
		width: auto;
	}

	.ybsb-qv-actions .yb-bsd-widget {
		flex: 0 0 auto;
	}
}

/* Old browsers without container queries: decide by the screen width instead. */
@supports not (container-type: inline-size) {
	@media (min-width: 768px) {
		.ybsb-popup-body {
			display: flex;
			overflow: hidden;
		}

		.ybsb-qv {
			flex: 1 1 auto;
			min-height: 0;
			grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
			gap: 2rem;
			align-items: stretch;
		}

		.ybsb-qv-media {
			display: flex;
			flex-direction: column;
			min-height: 0;
		}

		.ybsb-qv-main {
			flex: 1 1 auto;
			min-height: 0;
			aspect-ratio: auto;
		}

		.ybsb-qv-thumbs {
			flex: 0 0 auto;
			min-height: calc(var(--ybsb-qv-thumb, 4rem) + 0.25rem);
		}

		.ybsb-qv-info {
			min-height: 0;
			overflow-y: auto;
			padding-right: 0.5rem;
			scrollbar-width: thin;
			scrollbar-color: var(--ybsb-scroll-thumb, #94A3B8) var(--ybsb-scroll-track, transparent);
		}

		.ybsb-qv-grid {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}

		.ybsb-qv-actions > * {
			flex: 0 0 auto;
		}

	}
}

@media (prefers-reduced-motion: reduce) {
	.ybsb-popup {
		transition: none;
	}
}

/* Screen-reader-only announcements ("Product 3 of 39: name"). */
.ybsb-popup-live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Thumbnail row with small scroll arrows. */
.ybsb-qv-rail {
	position: relative;
	flex: 0 0 auto;
	min-width: 0;
}

.ybsb-qv-thumbs img {
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}

[class] .ybsb-qv-rail .ybsb-popup-arrow.ybsb-qv-rail-btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 2rem;
	height: 2rem;
	margin-top: -1rem;
	font-size: 1rem;
	box-shadow: 0 0.125rem 0.5rem rgba(2, 6, 23, 0.25);
}

.ybsb-qv-rail .ybsb-qv-rail-btn[hidden] {
	display: none;
}

.ybsb-qv-rail-prev {
	left: 0.25rem;
}

.ybsb-qv-rail-next {
	right: 0.25rem;
}

.ybsb-qv-rail-next svg {
	transform: rotate(180deg);
}

/* Your own Elementor template: it fills the popup width and the whole body scrolls (the built-in two-column layout needs the body to be a fixed flex row; a template does not). */
.ybsb-popup-body.ybsb-popup-body-template {
	display: block;
	overflow-x: hidden;
	overflow-y: auto;
}

.ybsb-qv-template {
	width: 100%;
	min-width: 0;
}

.ybsb-qv-template > .elementor,
.ybsb-qv-template .e-con.e-parent {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}
