/* ==========================================================================
   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 >= 1025px) is 100% UNTOUCHED!
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESKTOP GUARDS (screens >= 1025px) — 100% NATIVE & UNTOUCHED
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	/* Hide mobile Swarovski gallery container completely on desktop */
	.spf-sw-gallery {
		display: none !important;
	}

	/* Sticky Desktop Gallery (>= 1025px) */
	body.spf-gal-sticky .woocommerce-product-gallery,
	body.spf-gal-sticky .ct-product-gallery-container {
		position: sticky;
		top: calc(var(--spf-header-h, 80px) + 16px);
		align-self: flex-start;
	}

	/* Desktop Hover Pan Zoom */
	@media (hover: hover) and (pointer: fine) {
		.spf-gal-zoom-host {
			position: relative;
			overflow: hidden;
			cursor: zoom-in;
		}
		.spf-gal-zoom-host img {
			transition: transform 0.12s ease-out;
			transform-origin: center center;
		}
		.spf-gal-zoom-host.is-zooming img {
			transform: scale(1.85);
		}
	}

	/* 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 <= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	/* 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;
	}

	/* 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;
		margin: 0 !important;
		user-select: none !important;
		-webkit-user-drag: none !important;
		pointer-events: auto !important;
		cursor: zoom-in !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 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: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !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;
		transform: scale(1.15) !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. LIGHTWEIGHT PINCH / DOUBLE-TAP & VIDEO LIGHTBOX
   -------------------------------------------------------------------------- */
.spf-p7-lb {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(9, 9, 11, 0.94);
	color: #ffffff;
	user-select: none;
	touch-action: none;
}
.spf-p7-lb[hidden] {
	display: none !important;
}

.spf-p7-lb__backdrop {
	position: absolute;
	inset: 0;
}

.spf-p7-lb__top {
	position: absolute;
	top: 0;
	inset-inline: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
}

.spf-p7-lb__counter {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.05em;
}

.spf-p7-lb__close {
	appearance: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.spf-p7-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	font-size: 18px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.spf-p7-lb__nav--prev {
	inset-inline-start: 14px;
}
.spf-p7-lb__nav--next {
	inset-inline-end: 14px;
}

.spf-p7-lb__stage {
	position: relative;
	z-index: 2;
	width: 92vw;
	height: 82vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.spf-p7-lb__stage img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: transform 0.2s ease;
	will-change: transform;
}

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