/* ==========================================================================
   Phase 7 — Feature 2: Product Gallery Upgrade (Zoom, Lightbox, Video & Sticky)
   + Swarovski Mobile Luxury Gallery (Edge-to-edge Touch Swipe, Floating Heart,
     Circular Pagination Dots ○ ○ ○ ○ ○ ○ ●)
   IMPORTANT: Desktop view (screens >= 769px) is 100% UNTOUCHED NATIVE BLOCKSY!
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESKTOP GUARDS (screens >= 769px) — 100% NATIVE & UNTOUCHED
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
	/* Hide mobile Swarovski gallery container completely on desktop */
	.spf-sw-gallery,
	div.spf-sw-gallery,
	body .spf-sw-gallery,
	body.single-product .spf-sw-gallery,
	.woocommerce div.product .spf-sw-gallery,
	.ct-product-gallery-container ~ .spf-sw-gallery,
	.woocommerce-product-gallery ~ .spf-sw-gallery,
	div#content .spf-sw-gallery,
	main .spf-sw-gallery {
		display: none !important;
		visibility: hidden !important;
		width: 0 !important;
		height: 0 !important;
		max-width: 0 !important;
		max-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
		position: absolute !important;
		top: -9999px !important;
		left: -9999px !important;
	}

	/* Force Blocksy native gallery to display normally on desktop with zero custom hover distortion */
	body .woocommerce-product-gallery,
	body .ct-product-gallery-container,
	body.single-product .woocommerce-product-gallery,
	body.single-product .ct-product-gallery-container {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: static !important;
	}

	/* Swipeable Thumbnail Strip */
	.spf-gal-swipe-thumbs {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 8px;
		overflow-x: auto !important;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-block: 6px;
	}
	.spf-gal-swipe-thumbs::-webkit-scrollbar {
		display: none;
	}
	.spf-gal-swipe-thumbs > * {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}
}

/* --------------------------------------------------------------------------
   2. MOBILE SWAROVSKI GALLERY (screens <= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
	/* When Swarovski mobile gallery is active, hide desktop gallery markup on mobile */
	body.spf-has-sw-gallery .woocommerce-product-gallery,
	body.spf-has-sw-gallery .ct-product-gallery-container {
		display: none !important;
	}

	.spf-sw-gallery {
		display: block !important;
		position: relative !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 0 16px 0 !important;
		padding: 0 !important;
		background: #ffffff !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
		user-select: none !important;
		-webkit-user-select: none !important;
	}

	/* Floating Wishlist Heart (♡) in Top-Right Corner */
	.spf-sw-wl {
		position: absolute !important;
		top: 14px !important;
		right: 14px !important;
		z-index: 12 !important;
		width: 40px !important;
		height: 40px !important;
		border-radius: 50% !important;
		border: 1px solid rgba(0, 0, 0, 0.06) !important;
		background: rgba(255, 255, 255, 0.92) !important;
		backdrop-filter: blur(8px) !important;
		-webkit-backdrop-filter: blur(8px) !important;
		color: #111827 !important;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0 !important;
		margin: 0 !important;
		cursor: pointer !important;
		-webkit-tap-highlight-color: transparent !important;
		transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease !important;
	}

	.spf-sw-wl:active {
		transform: scale(0.9) !important;
	}

	.spf-sw-wl svg {
		display: block !important;
		width: 20px !important;
		height: 20px !important;
		stroke-width: 1.8 !important;
		stroke: currentColor !important;
		fill: none !important;
		transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), fill 0.2s ease, stroke 0.2s ease !important;
	}

	.spf-sw-wl.is-on {
		color: #e11d48 !important;
		background: #ffffff !important;
		box-shadow: 0 4px 14px rgba(225, 29, 72, 0.18) !important;
		border-color: rgba(225, 29, 72, 0.2) !important;
	}

	.spf-sw-wl.is-on svg {
		fill: #e11d48 !important;
		stroke: #e11d48 !important;
		transform: scale(1.1) !important;
	}

	/* Kymee-Style Left & Right Navigation Chevrons (< and >) */
	.spf-sw-arrow {
		position: absolute !important;
		top: 50% !important;
		transform: translateY(-50%) !important;
		z-index: 10 !important;
		width: 36px !important;
		height: 36px !important;
		border-radius: 50% !important;
		border: 1px solid rgba(0, 0, 0, 0.08) !important;
		background: rgba(255, 255, 255, 0.9) !important;
		backdrop-filter: blur(8px) !important;
		-webkit-backdrop-filter: blur(8px) !important;
		color: #18181b !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0 !important;
		cursor: pointer !important;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
		-webkit-tap-highlight-color: transparent !important;
		transition: transform 0.15s ease, background-color 0.15s ease !important;
	}

	.spf-sw-arrow:active {
		transform: translateY(-50%) scale(0.9) !important;
	}

	.spf-sw-prev {
		left: 12px !important;
	}

	.spf-sw-next {
		right: 12px !important;
	}

	.spf-sw-arrow svg {
		display: block !important;
		width: 16px !important;
		height: 16px !important;
		stroke-width: 2.2 !important;
		stroke: currentColor !important;
	}

	/* Swipeable Product Image Track */
	.spf-sw-track {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		width: 100% !important;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		scroll-snap-type: x mandatory !important;
		-webkit-overflow-scrolling: touch !important;
		scrollbar-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
		outline: none !important;
		touch-action: pan-x pan-y !important;
	}

	.spf-sw-track::-webkit-scrollbar {
		display: none !important;
	}

	/* Slides */
	.spf-sw-slide {
		flex: 0 0 100% !important;
		width: 100% !important;
		min-width: 100% !important;
		max-width: 100% !important;
		scroll-snap-align: start !important;
		scroll-snap-stop: always !important;
		position: relative !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
		background: #fbfbfb !important;
	}

	/* Aspect Ratio Modifiers */
	.spf-sw-gallery--aspect-1-1 .spf-sw-slide {
		aspect-ratio: 1 / 1 !important;
	}
	.spf-sw-gallery--aspect-4-5 .spf-sw-slide {
		aspect-ratio: 4 / 5 !important;
	}
	.spf-sw-gallery--aspect-auto .spf-sw-slide {
		min-height: 320px !important;
		max-height: 75vh !important;
	}

	/* Images */
	.spf-sw-img {
		width: 100% !important;
		height: 100% !important;
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		margin: 0 !important;
		user-select: none !important;
		-webkit-user-drag: none !important;
		pointer-events: auto !important;
		cursor: default !important;
	}

	.spf-sw-gallery--fit-cover .spf-sw-img {
		object-fit: cover !important;
		object-position: center center !important;
	}

	.spf-sw-gallery--fit-contain .spf-sw-img {
		object-fit: contain !important;
		object-position: center center !important;
		padding: 10px !important;
		box-sizing: border-box !important;
	}

	/* Swarovski Circular & Pill Pagination Dots (○ ○ ○ ●) */
	.spf-sw-dots {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 8px !important;
		padding: 14px 0 18px !important;
		width: 100% !important;
		margin: 0 auto !important;
		background: transparent !important;
	}

	.spf-sw-dot {
		appearance: none !important;
		-webkit-appearance: none !important;
		width: 7px !important;
		height: 7px !important;
		min-width: 7px !important;
		min-height: 7px !important;
		border-radius: 50% !important;
		border: 1.5px solid #18181b !important;
		background: transparent !important;
		padding: 0 !important;
		margin: 0 !important;
		cursor: pointer !important;
		opacity: 0.5 !important;
		outline: none !important;
		-webkit-tap-highlight-color: transparent !important;
		transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
	}

	.spf-sw-dot:active {
		transform: scale(0.9) !important;
	}

	.spf-sw-dot.is-active {
		background: #18181b !important;
		border-color: #18181b !important;
		opacity: 1 !important;
		width: 22px !important;
		border-radius: 999px !important;
	}

	/* WebP Responsive Picture Wrapper */
	.spf-sw-picture {
		display: flex !important;
		width: 100% !important;
		height: 100% !important;
		align-items: center !important;
		justify-content: center !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* Mobile Luxury Discount / Sale Badge (Top-Left) */
	.spf-sw-badge {
		position: absolute !important;
		top: 14px !important;
		left: 14px !important;
		z-index: 12 !important;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
		font-size: 11px !important;
		font-weight: 700 !important;
		letter-spacing: 0.05em !important;
		text-transform: uppercase !important;
		line-height: 1 !important;
		padding: 5px 10px !important;
		border-radius: 999px !important;
		background: #0f172a !important;
		color: #ffffff !important;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
		pointer-events: none !important;
	}
	.spf-sw-badge--sale {
		background: #0f172a !important;
		color: #ffffff !important;
	}
	.spf-sw-badge--soldout {
		background: #475569 !important;
		color: #ffffff !important;
	}

	/* Floating "Tap to zoom" Badge (Bottom-Right — Kymee.in / Shopify Style) */
	.spf-sw-zoom-btn {
		position: absolute !important;
		bottom: 14px !important;
		right: 14px !important;
		z-index: 12 !important;
		appearance: none !important;
		-webkit-appearance: none !important;
		display: inline-flex !important;
		align-items: center !important;
		gap: 5px !important;
		padding: 6px 12px !important;
		border-radius: 999px !important;
		border: 1px solid rgba(0, 0, 0, 0.08) !important;
		background: rgba(255, 255, 255, 0.9) !important;
		backdrop-filter: blur(8px) !important;
		-webkit-backdrop-filter: blur(8px) !important;
		color: #0f172a !important;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
		font-size: 11.5px !important;
		font-weight: 600 !important;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
		cursor: pointer !important;
		transition: transform 0.15s ease, background-color 0.15s ease !important;
		-webkit-tap-highlight-color: transparent !important;
	}
	.spf-sw-zoom-btn:active {
		transform: scale(0.92) !important;
	}
	.spf-sw-zoom-btn svg {
		display: block !important;
		width: 14px !important;
		height: 14px !important;
	}
}

/* --------------------------------------------------------------------------
   3. PRODUCT VIDEO TRIGGER BUTTON
   -------------------------------------------------------------------------- */
.spf-gal-video-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block-start: 10px;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--theme-border-color, #d4d4d8);
	background: #ffffff;
	color: var(--theme-text-color, #111827);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.spf-gal-video-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.spf-gal-video-btn__ico {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--spf-accent, #111827);
	color: var(--spf-accent-text, #ffffff);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* --------------------------------------------------------------------------
   4. SHOPIFY / KYMEE LUXURY PINCH, DOUBLE-TAP & FULLSCREEN LIGHTBOX
   -------------------------------------------------------------------------- */
.spf-p7-lb {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483647 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	background: rgba(8, 8, 10, 0.96) !important;
	backdrop-filter: blur(18px) !important;
	-webkit-backdrop-filter: blur(18px) !important;
	color: #ffffff !important;
	user-select: none !important;
	touch-action: none !important;
	opacity: 1 !important;
	transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.spf-p7-lb[hidden] {
	display: none !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.spf-p7-lb__backdrop {
	position: absolute !important;
	inset: 0 !important;
	z-index: 1 !important;
}

.spf-p7-lb__top {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 10 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 14px !important;
	pointer-events: auto !important;
}

.spf-p7-lb__counter {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.06em !important;
	background: rgba(255, 255, 255, 0.15) !important;
	padding: 6px 14px !important;
	border-radius: 999px !important;
	backdrop-filter: blur(8px) !important;
	-webkit-backdrop-filter: blur(8px) !important;
	color: #ffffff !important;
}

.spf-p7-lb__actions {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
}

.spf-p7-lb__action {
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 42px !important;
	height: 42px !important;
	border-radius: 50% !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	background: rgba(255, 255, 255, 0.12) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	color: #ffffff !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	font-size: 22px !important;
	line-height: 1 !important;
	padding: 0 !important;
	margin: 0 !important;
	transition: transform 0.15s ease, background 0.15s ease !important;
	-webkit-tap-highlight-color: transparent !important;
}
.spf-p7-lb__action:active {
	transform: scale(0.9) !important;
	background: rgba(255, 255, 255, 0.25) !important;
}
.spf-p7-lb__action svg {
	display: block !important;
	stroke: currentColor !important;
}

.spf-p7-lb__nav {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	z-index: 8 !important;
	width: 44px !important;
	height: 44px !important;
	border-radius: 50% !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	background: rgba(255, 255, 255, 0.12) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	color: #ffffff !important;
	font-size: 18px !important;
	cursor: pointer !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: transform 0.15s ease, background 0.15s ease !important;
	-webkit-tap-highlight-color: transparent !important;
}
.spf-p7-lb__nav:active {
	transform: translateY(-50%) scale(0.9) !important;
	background: rgba(255, 255, 255, 0.25) !important;
}
.spf-p7-lb__nav--prev {
	left: 14px !important;
}
.spf-p7-lb__nav--next {
	right: 14px !important;
}

.spf-p7-lb__stage {
	position: relative !important;
	z-index: 5 !important;
	width: 100vw !important;
	height: 82vh !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	overflow: hidden !important;
	touch-action: none !important;
}

.spf-p7-lb__stage img {
	max-width: 96vw !important;
	max-height: 80vh !important;
	object-fit: contain !important;
	transform-origin: center center !important;
	transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
	will-change: transform !important;
	user-select: none !important;
	-webkit-user-drag: none !important;
	pointer-events: auto !important;
	cursor: grab !important;
}

.spf-p7-lb__stage.is-panning img {
	transition: none !important;
	cursor: grabbing !important;
}

.spf-p7-lb__stage iframe,
.spf-p7-lb__stage video {
	width: min(92vw, 920px) !important;
	aspect-ratio: 16 / 9 !important;
	max-height: 80vh !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: #000000 !important;
}

.spf-p7-lb__hint {
	position: absolute !important;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
	left: 50% !important;
	transform: translateX(-50%) !important;
	z-index: 10 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	color: rgba(255, 255, 255, 0.7) !important;
	background: rgba(0, 0, 0, 0.45) !important;
	padding: 5px 14px !important;
	border-radius: 999px !important;
	pointer-events: none !important;
	white-space: nowrap !important;
	backdrop-filter: blur(8px) !important;
	-webkit-backdrop-filter: blur(8px) !important;
	transition: opacity 0.4s ease !important;
}
