/**
 * Product Sheet Gallery Lightbox + Share (3.16.145)
 *
 * @package PasionGift_App
 */

.pg-product-sheet-gallery__viewport {
	cursor: zoom-in;
}

.pg-product-sheet-gallery__nav,
.pg-product-sheet-gallery__thumb,
.pg-product-sheet-gallery__dot {
	cursor: pointer;
}

html.pg-sheet-lightbox-open {
	overflow: hidden;
}

/*
 * PGSC floating cart (.pgsc-cart-button) stacks near --pgsc-sidecart-z-index (~99999).
 * Theme overlay tokens (~205) sit below it, so the FAB overlapped the lightbox in 3.16.145.
 * Raise the viewer above that stack; demote known floaters only while the lightbox is open.
 */
.pg-sheet-lightbox {
	position: fixed;
	inset: 0;
	z-index: calc(var(--pgsc-sidecart-z-index, 99999) + 10);
	display: flex;
	flex-direction: column;
	background: rgba(8, 8, 10, 0.96);
	color: #f5f5f5;
	padding:
		env(safe-area-inset-top, 0px)
		env(safe-area-inset-right, 0px)
		env(safe-area-inset-bottom, 0px)
		env(safe-area-inset-left, 0px);
}

html.pg-sheet-lightbox-open .pgsc-cart-button,
html.pg-sheet-lightbox-open .pg-cart-add-toast {
	visibility: hidden;
	pointer-events: none;
}

.pg-sheet-lightbox[hidden] {
	display: none !important;
}

.pg-sheet-lightbox__surface {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

.pg-sheet-lightbox__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex: 0 0 auto;
	padding: 0.75rem 0.875rem 0.5rem;
}

.pg-sheet-lightbox__counter {
	margin: 0;
	font-family: var(--pg-font-family, system-ui, sans-serif);
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.92);
}

.pg-sheet-lightbox__top-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.pg-sheet-lightbox__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.pg-sheet-lightbox__icon-btn--compact {
	width: 2.25rem;
	height: 2.25rem;
	font-size: 1.35rem;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
}

.pg-sheet-lightbox__icon-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pg-sheet-lightbox__stage {
	position: relative;
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
	align-items: center;
	min-height: 0;
	padding: 0.25rem 0.25rem 0.5rem;
	touch-action: pan-y pinch-zoom;
}

.pg-sheet-lightbox__frame {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	height: 100%;
	max-height: 100%;
}

.pg-sheet-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: min(72dvh, calc(100dvh - 11rem));
	object-fit: contain;
	object-position: center center;
	user-select: none;
	-webkit-user-drag: none;
}

.pg-sheet-lightbox__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.pg-sheet-lightbox__nav[hidden] {
	visibility: hidden;
	pointer-events: none;
}

.pg-sheet-lightbox__nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.pg-sheet-lightbox__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pg-sheet-lightbox__thumbs {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex: 0 0 auto;
	overflow-x: auto;
	padding: 0.5rem 0.875rem 1rem;
	scrollbar-width: none;
}

.pg-sheet-lightbox__thumbs[hidden] {
	display: none !important;
}

.pg-sheet-lightbox__thumbs::-webkit-scrollbar {
	display: none;
}

.pg-sheet-lightbox__thumb {
	flex: 0 0 auto;
	width: 3.25rem;
	height: 3.25rem;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 0.5rem;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
	cursor: pointer;
}

.pg-sheet-lightbox__thumb.is-active {
	border-color: #fff;
}

.pg-sheet-lightbox__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pg-sheet-lightbox__thumb:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pg-sheet-lightbox__share {
	position: absolute;
	inset: 0;
	z-index: 2;
}

.pg-sheet-lightbox__share[hidden] {
	display: none !important;
}

.pg-sheet-lightbox__share-scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.pg-sheet-lightbox__share-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	max-height: min(78dvh, 32rem);
	padding:
		0.5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
	border-radius: 1rem 1rem 0 0;
	background: #f7f4f1;
	color: #1a1a1a;
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
}

.pg-sheet-lightbox__share-handle {
	width: 2.5rem;
	height: 0.25rem;
	margin: 0.15rem auto 0.35rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.18);
}

.pg-sheet-lightbox__share-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.pg-sheet-lightbox__share-title {
	margin: 0;
	font-family: var(--pg-font-family, system-ui, sans-serif);
	font-size: 1.125rem;
	font-weight: 650;
	line-height: 1.25;
}

.pg-sheet-lightbox__share-name {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: #222;
}

.pg-sheet-lightbox__share-url {
	margin: 0;
	padding: 0.65rem 0.75rem;
	border-radius: 0.65rem;
	background: rgba(0, 0, 0, 0.05);
	font-size: 0.8125rem;
	line-height: 1.4;
	word-break: break-all;
	color: #444;
}

.pg-sheet-lightbox__share-feedback {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #1f6b3a;
}

.pg-sheet-lightbox__share-feedback[hidden] {
	display: none !important;
}

.pg-sheet-lightbox__share-actions {
	display: grid;
	gap: 0.5rem;
}

.pg-sheet-lightbox__share-primary,
.pg-sheet-lightbox__share-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.65rem 1rem;
	border: 0;
	border-radius: 0.75rem;
	font-family: var(--pg-font-family, system-ui, sans-serif);
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

.pg-sheet-lightbox__share-primary {
	background: var(--pg-color-brand-wine, #8b1e3f);
	color: #fff;
}

.pg-sheet-lightbox__share-secondary {
	background: rgba(0, 0, 0, 0.06);
	color: #1a1a1a;
}

.pg-sheet-lightbox__share-secondary[hidden] {
	display: none !important;
}

.pg-sheet-lightbox__share-channels {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.5rem;
	padding-top: 0.25rem;
}

.pg-sheet-lightbox__channel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	padding: 0.5rem 0.4rem;
	border-radius: 0.65rem;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	color: #1a1a1a;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
}

.pg-sheet-lightbox__channel:focus-visible {
	outline: 2px solid var(--pg-color-brand-wine, #8b1e3f);
	outline-offset: 2px;
}

@media (min-width: 768px) {
	.pg-sheet-lightbox__stage {
		grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
		padding-inline: 1rem;
	}

	.pg-sheet-lightbox__image {
		max-height: min(78dvh, calc(100dvh - 12rem));
	}

	.pg-sheet-lightbox__share-sheet {
		left: 50%;
		right: auto;
		width: min(28rem, calc(100% - 2rem));
		transform: translateX(-50%);
		border-radius: 1rem;
		bottom: 1rem;
		padding-bottom: 1rem;
	}
}

@media (max-width: 359px) {
	.pg-sheet-lightbox__top {
		padding-inline: 0.65rem;
	}

	.pg-sheet-lightbox__stage {
		grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
	}

	.pg-sheet-lightbox__thumb {
		width: 2.75rem;
		height: 2.75rem;
	}

	.pg-sheet-lightbox__share-channels {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pg-sheet-lightbox,
	.pg-sheet-lightbox__share-sheet {
		transition: none;
	}
}
