/* CollectionSimpleGallery lightbox (Aurora SimpleGallery-inspired) */

.jq-toast-wrap {
	z-index: 100060 !important;
	/* own layer: the "slide" animation left a white line across the photos (Chrome repaint glitch) */
	transform: translateZ(0);
	will-change: transform;
}

.csg-modal {
	position: fixed;
	inset: 0;
	z-index: 8888;
	display: none;
	justify-content: center;
	align-items: center;
}

.csg-modal.open {
	display: flex;
}

.csg-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(8px);
	cursor: pointer;
	touch-action: manipulation;
}

.csg-content {
	position: relative;
	z-index: 2;
	max-width: 70vw;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 0 1rem;
	box-sizing: border-box;
}

.csg-progress-wrap {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, #6366f1, #8b5cf6);
	overflow: hidden;
	z-index: 100051;
}

.csg-progress-bar {
	height: 100%;
	width: 100%;
	background: #000;
	transform-origin: right;
}

.csg-progress-bar.csg-progress-active {
	animation: csg-progress-shrink linear forwards;
}

.csg-modal.csg-slideshow-paused .csg-progress-bar.csg-progress-active {
	animation-play-state: paused;
}

.csg-count {
	position: fixed;
	top: max(1rem, env(safe-area-inset-top));
	left: max(1rem, env(safe-area-inset-left));
	z-index: 100052;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
	background: rgba(55, 65, 81, 0.95);
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	line-height: 1.2;
	pointer-events: none;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.csg-count-sep {
	opacity: 0.85;
	font-weight: 500;
}

.csg-stage {
	position: relative;
	display: inline-flex;
	max-width: 100%;
	max-height: 100%;
}

.csg-photo-id {
	position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: none;
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    /* background: rgba(55, 65, 81, 0.95); */
    /* padding: 0.35rem 0.85rem; */
    /* border-radius: 999px; */
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    line-height: 1.2;
    pointer-events: none;
	text-shadow: 0 0 5px black;
}

/* Side nav: prev/next only; pause hidden; full-screen hit layer with pointer-events on buttons only */
.csg-toolbar {
	position: fixed;
	inset: 0;
	z-index: 100052;
	pointer-events: none;
}

.csg-toolbar > .csg-toolbar-btn {
	pointer-events: auto;
}

.csg-toolbar .csg-prev {
	position: fixed;
	left: max(1rem, env(safe-area-inset-left));
	top: 50%;
	transform: translateY(-50%);
}

.csg-toolbar .csg-next {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right));
	top: 50%;
	transform: translateY(-50%);
}

.csg-toolbar .csg-pause {
	/* display: none !important; */
	margin: 10px auto;
}

.csg-toolbar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	background: none;
	border: none;
	cursor: pointer;
	touch-action: manipulation;
	line-height: 0;
}

.csg-toolbar-btn:hover {
	opacity: 0.9;
}

.csg-toolbar-btn:focus {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: 2px;
	border-radius: 4px;
}

.csg-toolbar-btn svg {
	display: block;
	vertical-align: middle;
}

@keyframes csg-progress-shrink {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

.csg-inner {
	display: flex;
	justify-content: center;
	align-items: center;
	max-width: 100%;
}

.csg-inner .csg-image {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

@keyframes csg-slide-in-enter {
	from {
		opacity: 0;
		transform: translateY(1.25rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes csg-slide-in-next {
	from {
		opacity: 0;
		transform: translateX(2.5rem);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes csg-slide-in-prev {
	from {
		opacity: 0;
		transform: translateX(-2.5rem);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.csg-inner .csg-image.csg-slide-in-enter {
	animation: csg-slide-in-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.csg-inner .csg-image.csg-slide-in-next {
	animation: csg-slide-in-next 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.csg-inner .csg-image.csg-slide-in-prev {
	animation: csg-slide-in-prev 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
	.csg-inner .csg-image.csg-slide-in-enter,
	.csg-inner .csg-image.csg-slide-in-next,
	.csg-inner .csg-image.csg-slide-in-prev {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

.csg-actions {
	position: fixed;
	bottom: max(1.5rem, env(safe-area-inset-bottom));
	left: 50%;
	transform: translateX(-50%);
	z-index: 100052;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	pointer-events: none;
}

.csg-actions .elem-ControllBar-action {
	pointer-events: auto;
	color: #fff;
}

.csg-close {
	position: absolute;
	top: max(1.5rem, env(safe-area-inset-top));
	right: max(1.5rem, env(safe-area-inset-right));
	z-index: 3;
	background: none;
	border: none;
	cursor: pointer;
	touch-action: manipulation;
}

.csg-close:hover {
	opacity: 0.9;
}

@media (max-width: 768px) {
	.csg-content {
		max-width: 92vw;
	}

	.csg-close {
		top: max(0.75rem, env(safe-area-inset-top));
		right: max(0.75rem, env(safe-area-inset-right));
	}

	.csg-close svg {
		width: 40px;
		height: 40px;
	}

	.csg-count {
		top: max(0.75rem, env(safe-area-inset-top));
		left: max(0.75rem, env(safe-area-inset-left));
		font-size: 0.8125rem;
		padding: 0.3rem 0.65rem;
	}

	.csg-photo-id {
		bottom: 0.5rem;
		left: 0.5rem;
		font-size: 0.8125rem;
		padding: 0.3rem 0.65rem;
	}

	.csg-toolbar .csg-prev {
		left: max(0.5rem, env(safe-area-inset-left));
	}

	.csg-toolbar .csg-next {
		right: max(0.5rem, env(safe-area-inset-right));
	}

	.csg-toolbar-btn svg {
		width: 40px;
		height: 40px;
	}

	.csg-inner .csg-image {
		max-height: 75vh;
	}

	.csg-actions {
		bottom: max(1rem, env(safe-area-inset-bottom));
	}
}

/* No play / pause button: opening a photo never plays by itself (only the gallery's Slideshow button does) */
.csg-toolbar .csg-pause { display: none !important; }
.csg-modal { overscroll-behavior: contain; touch-action: none; }
/* the viewer handles pinch / drag / swipe itself (CollectionSimpleGallery.js); the strip still scrolls sideways */
.csg-strip { touch-action: pan-x; }

/* ===== Zoom + photo strip (photo store 3a; CollectionSimpleGallery.js) ===== */
.csg-zoom {
	position: fixed;
	top: calc(max(1.5rem, env(safe-area-inset-top)) + 2px);
	right: calc(max(1.5rem, env(safe-area-inset-right)) + 50px);
	z-index: 100053;
	display: flex;
	align-items: center;
	gap: 6px;
}
.csg-zbtn {
	height: 36px;
	min-width: 36px;
	padding: 0 10px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(55, 65, 81, 0.6);
	color: #fff;
	font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	cursor: pointer;
	touch-action: manipulation;
}
.csg-zbtn:hover { background: rgba(75, 85, 99, 0.85); }
.csg-zbtn:disabled { opacity: 0.35; cursor: default; }
.csg-zbtn[hidden] { display: none; }
.csg-zoom-level { min-width: 58px; font-size: 13px; font-variant-numeric: tabular-nums; }
/* zoomed in and the 4096 px copy is still on its way: a note under the top bar says so */
.csg-detail-note {
	position: fixed;
	top: calc(max(1.5rem, env(safe-area-inset-top)) + 48px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 100053;
	display: none;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(17, 24, 39, 0.8);
	color: #fff;
	font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	white-space: nowrap;
	pointer-events: none;
}
.csg-modal.csg-detail-loading .csg-detail-note { display: flex; }
.csg-spin {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: csg-spin 0.8s linear infinite;
}
@keyframes csg-spin { to { transform: rotate(360deg); } }
@media (max-width: 768px) {
	.csg-detail-note { top: calc(max(0.75rem, env(safe-area-inset-top)) + 46px); }
}
.csg-photos[aria-pressed="true"] { background: rgba(255, 255, 255, 0.2); }
.csg-inner { transition: transform 0.18s ease; transform-origin: center; }
.csg-modal.csg-zoomed .csg-stage { overflow: hidden; border-radius: 6px; cursor: grab; touch-action: none; }
.csg-modal.csg-zoomed .csg-inner { transition: none; }
.csg-modal.csg-zoomed .csg-stage:active { cursor: grabbing; }
.csg-modal.csg-zoomed .csg-photo-id { visibility: hidden; }
.csg-strip {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	height: 72px;
	z-index: 100052;
	display: flex;
	align-items: center;
	gap: 8px;
	overflow-x: auto;
	padding: 0 16px env(safe-area-inset-bottom);
	background: rgba(0, 0, 0, 0.35);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	scrollbar-width: thin;
}
.csg-strip:empty, .csg-modal.csg-strip-off .csg-strip { display: none; }
.csg-strip::before, .csg-strip::after { content: ""; flex: 1 0 0; }
.csg-thumb {
	flex: none;
	width: 46px;
	height: 46px;
	padding: 0;
	border-radius: 2px;
	border: 2px solid transparent;
	background: #262626 center / cover no-repeat;
	opacity: 0.55;
	cursor: pointer;
}
.csg-thumb:hover { opacity: 0.85; }
.csg-thumb.is-current { border-color: #fff; opacity: 1; }
/* strip on: the photo buttons sit above it, the photo a little smaller */
.csg-modal:not(.csg-strip-off) .csg-actions { bottom: calc(72px + 0.75rem); }
.csg-modal:not(.csg-strip-off) .csg-inner .csg-image { max-height: calc(80vh - 120px); }
@media (max-width: 768px) {
	.csg-zoom { top: calc(max(0.75rem, env(safe-area-inset-top)) + 2px); right: calc(max(0.75rem, env(safe-area-inset-right)) + 48px); gap: 4px; }
	.csg-zbtn { height: 34px; min-width: 32px; padding: 0 8px; font-size: 13px; }
	.csg-zoom-level { min-width: 48px; font-size: 12px; }
	.csg-modal:not(.csg-strip-off) .csg-inner .csg-image { max-height: calc(75vh - 120px); }
}
@media (max-width: 420px) {
	/* room for the count: tapping the percentage goes back to 100% */
	.csg-zoom-out { display: none; }
}

/* ===== Save to Photos: its popup styles are in public/assets/css/savePhotos.css (also used by the order page) ===== */

/* ===== Full screen: the photo uses the whole width between the top controls and the photo strip (the bottom
   edge when the strip is hidden), as large as it fits; the photo buttons float as a small bar above the strip ===== */
.csg-modal .csg-content {
	position: absolute;
	top: 64px;
	bottom: 72px;
	left: 0;
	right: 0;
	max-width: none;
	max-height: none;
	padding: 0;
	display: flex;
	align-items: stretch;
	justify-content: stretch;
}
.csg-modal.csg-strip-off .csg-content { bottom: 0; }
.csg-modal .csg-stage { display: flex; width: 100%; height: 100%; max-width: none; max-height: none; align-items: center; justify-content: center; overflow: hidden; }
.csg-modal .csg-inner { width: 100%; height: 100%; max-width: none; }
.csg-modal .csg-inner .csg-image,
.csg-modal:not(.csg-strip-off) .csg-inner .csg-image { max-width: 100%; max-height: 100%; border-radius: 0; box-shadow: none; }
.csg-modal .csg-actions {
	background: rgba(17, 24, 39, 0.55);
	border-radius: 999px;
	padding: 2px 10px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.csg-modal:not(.csg-strip-off) .csg-actions { bottom: calc(72px + 10px); }
.csg-modal.csg-strip-off .csg-actions { bottom: max(14px, env(safe-area-inset-bottom)); }
@media (max-width: 768px) {
	.csg-modal .csg-content { top: 56px; }
	.csg-modal .csg-inner .csg-image,
	.csg-modal:not(.csg-strip-off) .csg-inner .csg-image { max-height: 100%; }
}

/* ===== Same look as the website viewer (rb-site.css): top bar with business / count / photo number, square
   buttons and arrows, the same backdrop; on phones the arrows give way to swiping ===== */
.csg-modal .csg-overlay { background: rgba(10, 10, 12, 0.94); backdrop-filter: none; -webkit-backdrop-filter: none; }
.csg-modal .csg-count {
	top: 0;
	left: 0;
	height: 56px;
	padding: 0 0 0 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: calc(100vw - 340px);
	background: none;
	box-shadow: none;
	border-radius: 0;
	color: #d4d4d4;
	font: 400 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
}
.csg-brand { overflow: hidden; text-overflow: ellipsis; }
.csg-brand:empty, .csg-caption:empty { display: none; }
.csg-modal .csg-count-num { color: #a3a3a3; letter-spacing: 0.04em; }
.csg-modal .csg-count-sep { opacity: 1; font-weight: 400; }
.csg-caption { color: #a3a3a3; text-transform: none; letter-spacing: 0.02em; }
.csg-modal .csg-photo-id { display: none !important; }
.csg-modal .csg-zoom { top: 10px; right: 58px; gap: 8px; }
.csg-modal .csg-zbtn { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; font-weight: 400; font-size: 13px; }
.csg-modal .csg-zbtn:hover { background: rgba(255, 255, 255, 0.1); }
.csg-modal .csg-zbtn:disabled { background: transparent; }
.csg-modal .csg-photos[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); }
.csg-modal .csg-close {
	position: fixed;
	top: 10px;
	right: 12px;
	z-index: 100053;
	width: 36px;
	height: 36px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
}
.csg-modal .csg-close:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.csg-modal .csg-close svg { width: 14px; height: 14px; }
.csg-modal .csg-content { top: 56px; }
.csg-modal .csg-toolbar .csg-prev, .csg-modal .csg-toolbar .csg-next {
	width: 44px;
	height: 52px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(0, 0, 0, 0.25);
}
.csg-modal .csg-toolbar .csg-prev { left: 14px; }
.csg-modal .csg-toolbar .csg-next { right: 14px; }
.csg-modal .csg-toolbar-btn:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.csg-modal .csg-toolbar-btn svg { width: 16px; height: 16px; }
@media (max-width: 768px) {
	.csg-modal .csg-content { top: 56px; }
	.csg-modal .csg-count { padding-left: 12px; max-width: calc(100vw - 300px); }
	.csg-modal .csg-zoom { top: 10px; right: 54px; gap: 6px; }
	.csg-modal .csg-zbtn { height: 34px; min-width: 34px; padding: 0 8px; }
	.csg-modal .csg-close { top: 10px; right: 10px; width: 34px; height: 34px; }
	.csg-modal .csg-close svg { width: 14px; height: 14px; }
	.csg-modal .csg-toolbar-btn svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
	.csg-brand, .csg-caption { display: none; }
	.csg-modal .csg-count { max-width: none; }
	.csg-modal .csg-toolbar .csg-prev, .csg-modal .csg-toolbar .csg-next { display: none; }
}
@media (max-width: 480px) {
	.csg-modal .csg-zoom-out { display: none; }
	.csg-modal .csg-zoom { gap: 4px; right: 50px; }
	.csg-modal .csg-zbtn { height: 32px; min-width: 32px; padding: 0 7px; font-size: 12px; }
	.csg-modal .csg-close { width: 32px; height: 32px; top: 11px; }
}
/* the same icons as the website viewer (Font Awesome solid) */
.csg-modal .csg-close i, .csg-modal .csg-toolbar-btn i { color: #fff; font-size: 16px; line-height: 1; }
.csg-modal .csg-close i { font-size: 15px; }
.csg-modal .csg-zbtn i { font-size: 13px; line-height: 1; }
/* a solid backdrop, like the website viewer: nothing of the page shows through */
.csg-modal .csg-overlay { background: rgb(10, 10, 12); }
/* the photo's size (photos for sale) sits in the top bar with the count and photo number */
.csg-size { color: #a3a3a3; text-transform: none; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.csg-size:empty { display: none; }
