/*
 * Blocco Product Gallery — reference/pages/prodotti/ProductGalleryPage.tsx.
 *
 * La griglia asimmetrica della galleria (2fr/3fr alternato riga per riga) usa CSS Grid con
 * `grid-template-columns` impostato inline da render.php per riga, non il blocco nativo
 * wp:columns: wp:columns non supporta rapporti diversi alternati riga per riga in modo pulito
 * (stesso motivo del fix Task 4 del sotto-progetto A).
 *
 * Breakpoint allineati ai default Tailwind del reference: sm 640px, md 768px, lg 1024px.
 */

.mggrp-product-gallery {
	background-color: var(--wp--preset--color--background, #fff);
	color: var(--wp--preset--color--foreground, #1a1a1a);
}

/* ── Hero ── */

.mggrp-product-gallery__hero {
	position: relative;
	height: 65vh;
	min-height: 420px;
	overflow: hidden;
}

.mggrp-product-gallery__hero-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mggrp-product-gallery__hero-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.1) 60%, transparent);
}

.mggrp-product-gallery__hero-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0 1.5rem 3.5rem;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__hero-content {
		padding: 0 3.5rem 5rem;
	}
}

@media (min-width: 768px) {
	.mggrp-product-gallery__hero-content {
		padding-left: 5rem;
		padding-right: 5rem;
	}
}

.mggrp-product-gallery__back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: rgba(255, 255, 255, 0.35);
	font-size: 10px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	text-decoration: none;
	margin-bottom: 2rem;
	transition: color 0.2s ease;
}

.mggrp-product-gallery__back:hover {
	color: #fff;
}

.mggrp-product-gallery__title {
	font-size: clamp(3rem, 8vw, 7rem);
	color: #fff;
	font-weight: 200;
	line-height: 0.95;
	letter-spacing: -0.02em;
	max-width: 64rem;
	margin: 0;
}

.mggrp-product-gallery__subtitle {
	color: rgba(255, 255, 255, 0.5);
	margin-top: 1.25rem;
	font-size: 0.875rem;
	max-width: 32rem;
	line-height: 1.7;
	font-weight: 300;
}

/* ── Scheda tecnica + carosello ── */

.mggrp-product-gallery__specsheet {
	margin-top: 5rem;
	border-top: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__specsheet {
		margin-top: 7rem;
	}
}

.mggrp-product-gallery__specsheet-inner {
	max-width: 64rem;
	margin: 0 auto;
	padding: 2.5rem 1rem;
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__specsheet-inner {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.mggrp-product-gallery__specsheet-inner {
		grid-template-columns: 1fr 1fr;
	}
}

.mggrp-product-gallery__carousel {
	position: relative;
	min-height: 320px;
	overflow: hidden;
	background-color: #f3f4f6;
}

@media (min-width: 1024px) {
	.mggrp-product-gallery__carousel {
		min-height: 0;
		margin-right: 2.5rem;
	}
}

.mggrp-product-gallery__carousel-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 1.2s ease-in-out;
}

.mggrp-product-gallery__carousel-image.is-active {
	opacity: 1;
}

.mggrp-product-gallery__carousel-dots {
	position: absolute;
	left: 1.25rem;
	bottom: 1.25rem;
	z-index: 2;
	display: flex;
	gap: 0.375rem;
}

.mggrp-product-gallery__carousel-dot {
	width: 4px;
	height: 4px;
	padding: 0;
	border: 0;
	background-color: rgba(255, 255, 255, 0.4);
	cursor: pointer;
	transition: all 0.4s ease;
}

.mggrp-product-gallery__carousel-dot.is-active {
	width: 20px;
	background-color: #fff;
}

.mggrp-product-gallery__carousel-scrim {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 5rem;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
	pointer-events: none;
}

.mggrp-product-gallery__data {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	padding-top: 2rem;
}

@media (min-width: 1024px) {
	.mggrp-product-gallery__data {
		padding-top: 0;
		padding-left: 2.5rem;
		border-left: 1px solid #f3f4f6;
	}
}

.mggrp-product-gallery__eyebrow {
	font-size: 9px;
	letter-spacing: 0.35em;
	text-transform: uppercase;
	color: #9ca3af;
	margin: 0 0 1rem;
}

.mggrp-product-gallery__eyebrow--dark {
	color: rgba(255, 255, 255, 0.25);
}

.mggrp-product-gallery__spec-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f3f4f6;
}

.mggrp-product-gallery__spec-row:last-child {
	border-bottom: 0;
}

.mggrp-product-gallery__spec-label {
	font-size: 11px;
	letter-spacing: 0.02em;
	color: #9ca3af;
	font-weight: 300;
	flex-shrink: 0;
}

.mggrp-product-gallery__spec-value {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--wp--preset--color--foreground, #1a1a1a);
	text-align: right;
}

.mggrp-product-gallery__models-tabs {
	display: flex;
	flex-wrap: wrap;
	width: fit-content;
	margin-bottom: 1.25rem;
	border: 1px solid #e5e7eb;
}

.mggrp-product-gallery__model-tab {
	padding: 0.375rem 0.75rem;
	font-size: 11px;
	letter-spacing: 0.02em;
	color: #9ca3af;
	background: none;
	border: 0;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mggrp-product-gallery__model-tab:hover {
	color: #374151;
}

.mggrp-product-gallery__model-tab.is-active {
	background-color: var(--wp--preset--color--foreground, #1a1a1a);
	color: #fff;
}

.mggrp-product-gallery__model-desc {
	font-size: 0.875rem;
	color: #6b7280;
	line-height: 1.7;
	font-weight: 300;
	margin: 0;
}

/* ── Galleria a griglia asimmetrica ── */

.mggrp-product-gallery__gallery {
	padding: 1rem;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__gallery {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

.mggrp-product-gallery__gallery-inner {
	max-width: 64rem;
	margin: 0 auto;
}

.mggrp-product-gallery__gallery-row {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.mggrp-product-gallery__gallery-item {
	position: relative;
	overflow: hidden;
	cursor: zoom-in;
	margin-bottom: 0.5rem;
}

.mggrp-product-gallery__gallery-row .mggrp-product-gallery__gallery-item {
	margin-bottom: 0;
}

.mggrp-product-gallery__gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s ease;
}

.mggrp-product-gallery__gallery-item--full img {
	aspect-ratio: 21 / 9;
}

.mggrp-product-gallery__gallery-row .mggrp-product-gallery__gallery-item img {
	aspect-ratio: 4 / 5;
}

.mggrp-product-gallery__gallery-item--full:hover img {
	transform: scale(1.02);
}

.mggrp-product-gallery__gallery-row .mggrp-product-gallery__gallery-item:hover img {
	transform: scale(1.03);
}

.mggrp-product-gallery__gallery-caption {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 1.25rem;
	background-color: rgba(0, 0, 0, 0);
	transition: background-color 0.4s ease;
}

.mggrp-product-gallery__gallery-row .mggrp-product-gallery__gallery-caption {
	padding: 1rem;
}

.mggrp-product-gallery__gallery-item--full:hover .mggrp-product-gallery__gallery-caption {
	background-color: rgba(0, 0, 0, 0.3);
}

.mggrp-product-gallery__gallery-row .mggrp-product-gallery__gallery-item:hover .mggrp-product-gallery__gallery-caption {
	background-color: rgba(0, 0, 0, 0.35);
}

.mggrp-product-gallery__gallery-caption p {
	color: #fff;
	font-size: 0.75rem;
	font-weight: 300;
	line-height: 1.4;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
}

.mggrp-product-gallery__gallery-item:hover .mggrp-product-gallery__gallery-caption p {
	opacity: 1;
}

/* ── CTA ── */

.mggrp-product-gallery__cta {
	background-color: var(--wp--preset--color--foreground, #1a1a1a);
	padding: 5rem 1.5rem;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__cta {
		padding-left: 3.5rem;
		padding-right: 3.5rem;
		padding-top: 7rem;
		padding-bottom: 7rem;
	}
}

@media (min-width: 768px) {
	.mggrp-product-gallery__cta {
		padding-left: 5rem;
		padding-right: 5rem;
	}
}

.mggrp-product-gallery__cta-inner {
	max-width: 80rem;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem;
	align-items: end;
}

@media (min-width: 1024px) {
	.mggrp-product-gallery__cta-inner {
		grid-template-columns: 1fr 1fr;
	}

	.mggrp-product-gallery__cta-action {
		text-align: right;
	}
}

.mggrp-product-gallery__cta-title {
	color: #fff;
	font-weight: 200;
	line-height: 1.2;
	font-size: 1.875rem;
	margin: 0;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__cta-title {
		font-size: 2.25rem;
	}
}

@media (min-width: 768px) {
	.mggrp-product-gallery__cta-title {
		font-size: 3rem;
	}
}

.mggrp-product-gallery__cta-button {
	position: relative;
	display: inline-block;
	overflow: hidden;
	text-decoration: none;
}

.mggrp-product-gallery__cta-button::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
}

.mggrp-product-gallery__cta-button::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: #fff;
	transform: translateY(100%);
	transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.mggrp-product-gallery__cta-button:hover::after {
	transform: translateY(0);
}

.mggrp-product-gallery__cta-button-label {
	position: relative;
	z-index: 1;
	display: inline-block;
	padding: 1rem 2.5rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #fff;
	transition: color 0.5s ease;
}

.mggrp-product-gallery__cta-button:hover .mggrp-product-gallery__cta-button-label {
	color: var(--wp--preset--color--foreground, #1a1a1a);
}

/* ── Lightbox ── */

.mggrp-product-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mggrp-product-gallery__lightbox[hidden] {
	display: none;
}

.mggrp-product-gallery__lightbox-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: rgba(0, 0, 0, 0.97);
}

.mggrp-product-gallery__lightbox-close,
.mggrp-product-gallery__lightbox-prev,
.mggrp-product-gallery__lightbox-next {
	position: absolute;
	z-index: 2;
	background: none;
	border: 0;
	color: rgba(255, 255, 255, 0.3);
	cursor: pointer;
	transition: color 0.2s ease;
}

.mggrp-product-gallery__lightbox-close:hover,
.mggrp-product-gallery__lightbox-prev:hover,
.mggrp-product-gallery__lightbox-next:hover {
	color: #fff;
}

.mggrp-product-gallery__lightbox-close {
	top: 1.25rem;
	right: 1.25rem;
	padding: 0.5rem;
}

.mggrp-product-gallery__lightbox-prev {
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	padding: 0.75rem;
}

.mggrp-product-gallery__lightbox-next {
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	padding: 0.75rem;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__lightbox-prev {
		left: 2rem;
	}

	.mggrp-product-gallery__lightbox-next {
		right: 2rem;
	}
}

.mggrp-product-gallery__lightbox-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: 0 3.5rem;
	max-width: 64rem;
	width: 100%;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__lightbox-content {
		padding: 0 6rem;
	}
}

.mggrp-product-gallery__lightbox-image {
	max-height: 78vh;
	max-width: 100%;
	object-fit: contain;
}

.mggrp-product-gallery__lightbox-caption {
	color: rgba(255, 255, 255, 0.35);
	font-size: 0.75rem;
	text-align: center;
	font-weight: 300;
	margin: 0;
}

@media (min-width: 640px) {
	.mggrp-product-gallery__lightbox-caption {
		font-size: 0.875rem;
	}
}

.mggrp-product-gallery__lightbox-counter {
	color: rgba(255, 255, 255, 0.2);
	font-size: 10px;
	letter-spacing: 0.1em;
	margin: 0;
}
