/**
 * Product Gallery Zoom Styles
 * Apple-inspired elegant zoom interactions
 */

/* ========================================
   Gallery Zoom Button
   ======================================== */
.product-gallery-item,
.product-gallery-grid__item,
.product-hero__image,
.product-editorial__hero-image,
.product-zoom-container,
.woocommerce-product-gallery__image {
	position: relative;
}

.gallery-zoom-btn {
	position: absolute;
	bottom: 16px;
	right: 16px;
	width: 48px;
	height: 48px;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	opacity: 0;
	transform: scale(0.9);
	z-index: 10;
}

.product-gallery-item:hover .gallery-zoom-btn,
.product-gallery-grid__item:hover .gallery-zoom-btn,
.product-hero__image:hover .gallery-zoom-btn,
.product-editorial__hero-image:hover .gallery-zoom-btn,
.product-zoom-container:hover .gallery-zoom-btn,
.woocommerce-product-gallery__image:hover .gallery-zoom-btn {
	opacity: 1;
	transform: scale(1);
}

.gallery-zoom-btn:hover {
	background: white;
	border-color: #c9a962;
	box-shadow: 0 4px 12px rgba(201, 169, 98, 0.3);
	transform: scale(1.1);
}

.gallery-zoom-btn:active {
	transform: scale(0.95);
}

.gallery-zoom-btn svg {
	color: #1a1a1a;
	transition: color 0.3s;
}

.gallery-zoom-btn:hover svg {
	color: #c9a962;
}

.product-gallery-item img,
.product-gallery-grid__item img,
.product-hero__image img,
.product-editorial__hero-image img,
.woocommerce-product-gallery__image img {
	cursor: pointer;
	transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-gallery-item:hover img,
.product-gallery-grid__item:hover img,
.product-hero__image:hover img,
.product-editorial__hero-image:hover img,
.woocommerce-product-gallery__image:hover img {
	transform: scale(1.02);
}

/* ========================================
   Lightbox Modal
   ======================================== */
.product-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
	            visibility 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-lightbox.is-visible {
	opacity: 1;
	visibility: visible;
}

.product-lightbox.is-visible .product-lightbox__content::before {
	opacity: 1;
}

/* Backdrop */
.product-lightbox__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
}

/* Content Container */
.product-lightbox__content {
	position: relative;
	z-index: 2;
	width: 90%;
	max-width: 1400px;
	height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Close Button */
.product-lightbox__close {
	position: absolute;
	top: -60px;
	right: 0;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: white;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.product-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
	transform: scale(1.05);
}

.product-lightbox__close:active {
	transform: scale(0.95);
}

/* Navigation Buttons */
.product-lightbox__prev,
.product-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: white;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 3;
}

.product-lightbox__prev {
	left: 20px;
}

.product-lightbox__next {
	right: 20px;
}

.product-lightbox__prev:hover,
.product-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
	transform: translateY(-50%) scale(1.1);
}

.product-lightbox__prev:active,
.product-lightbox__next:active {
	transform: translateY(-50%) scale(0.95);
}

/* Zoom Container */
.product-lightbox__zoom-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
}

/* Lightbox Image */
.product-lightbox__image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
}

/* Zoom instructions */
.product-lightbox__content::before {
	content: 'Clicca per zoom · Trascina per spostare';
	position: absolute;
	top: -50px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.5px;
	background: rgba(0, 0, 0, 0.4);
	padding: 8px 16px;
	border-radius: 20px;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s;
}

/* Counter */
.product-lightbox__counter {
	position: absolute;
	bottom: -50px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.5px;
	background: rgba(255, 255, 255, 0.1);
	padding: 8px 16px;
	border-radius: 20px;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-lightbox__counter .current {
	color: #c9a962;
	font-weight: 700;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
	.product-lightbox__content {
		width: 95%;
		height: 85vh;
	}

	.product-lightbox__close {
		top: -50px;
		width: 40px;
		height: 40px;
	}

	.product-lightbox__close svg {
		width: 20px;
		height: 20px;
	}

	.product-lightbox__prev,
	.product-lightbox__next {
		width: 44px;
		height: 44px;
	}

	.product-lightbox__prev svg,
	.product-lightbox__next svg {
		width: 24px;
		height: 24px;
	}

	.product-lightbox__prev {
		left: 10px;
	}

	.product-lightbox__next {
		right: 10px;
	}

	.product-lightbox__counter {
		bottom: -40px;
		font-size: 13px;
		padding: 6px 14px;
	}
}

/* ========================================
   Accessibility & Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
	.zoom-overlay,
	.zoom-active img,
	.product-lightbox,
	.product-lightbox__image,
	.product-lightbox__close,
	.product-lightbox__prev,
	.product-lightbox__next {
		transition: none;
	}
}

/* Focus visible for keyboard navigation */
.product-lightbox__close:focus-visible,
.product-lightbox__prev:focus-visible,
.product-lightbox__next:focus-visible {
	outline: 2px solid #c9a962;
	outline-offset: 2px;
}

/* ========================================
   Loading State
   ======================================== */
.product-lightbox__image.is-loading {
	opacity: 0.5;
}

.product-lightbox__zoom-container::after {
	content: '';
	position: absolute;
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #c9a962;
	border-radius: 50%;
	animation: lightbox-spin 0.8s linear infinite;
	opacity: 0;
	transition: opacity 0.3s;
}

.product-lightbox__image.is-loading ~ .product-lightbox__zoom-container::after {
	opacity: 1;
}

@keyframes lightbox-spin {
	to { transform: rotate(360deg); }
}
