/* ePlay – Lightbox Garanzia Legale
   L’immagine sta tutta visibile: max larghezza = schermo,
   se è troppo alta viene ridotta proporzionalmente. */

.eplay-gl-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.eplay-gl-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.eplay-gl-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.eplay-gl-overlay[hidden] {
	display: none !important;
}

.eplay-gl-overlay.is-open[hidden] {
	display: flex !important;
}

.eplay-gl-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	cursor: pointer;
}

.eplay-gl-dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: fit-content;
	max-width: 100%;
	max-height: 100%;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
}

.eplay-gl-overlay.is-open .eplay-gl-dialog {
	transform: translateY(0) scale(1);
}

.eplay-gl-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #000;
	color: #fff;
	line-height: 0;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	transition: background 0.15s ease, transform 0.15s ease;
}

.eplay-gl-close-icon {
	display: block;
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

.eplay-gl-close:hover,
.eplay-gl-close:focus-visible {
	background: #111;
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.eplay-gl-close:active {
	transform: scale(0.96);
}

.eplay-gl-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	max-width: 100%;
	max-height: 100%;
	padding: 0;
	background: #fff;
}

.eplay-gl-destination {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	color: inherit;
	text-decoration: none;
}

.eplay-gl-destination-label {
	display: block;
	padding: 0.85rem 1.25rem 1rem;
	color: #be0100;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.95rem;
	line-height: 1.4;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.eplay-gl-destination:hover .eplay-gl-destination-label {
	color: #8e0100;
}

.eplay-gl-destination:focus-visible {
	outline: 2px solid #be0100;
	outline-offset: -2px;
}

/* Trigger nelle schede prodotto Tudor (pagina completa e quick-view). */
.eplay-garan-label-action {
	width: 100%;
	margin: 0.5rem 0 1.25rem;
}

.eplay-garan-label-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 2.75rem;
	padding: 0.35rem 0;
	border: 0;
	background: transparent;
	color: var(--eplay-gl-button-color, #be0100);
	font: inherit;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.eplay-garan-label-btn:hover {
	color: var(--eplay-gl-button-color, #be0100);
	opacity: 0.78;
}

.eplay-garan-label-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.eplay-garan-label-btn-icon {
	display: block;
	flex: 0 0 auto;
}

.eplay-gl-checkout-documents {
	clear: both;
	width: 100%;
	margin: 1rem 0;
	padding: 0.85rem 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.eplay-gl-checkout-documents-title {
	margin: 0 0 0.35rem;
}

.eplay-gl-checkout-documents-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

.eplay-gl-checkout-link {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.35rem 0;
	border: 0;
	background: transparent;
	color: var(--eplay-gl-button-color, #be0100);
	font: inherit;
	line-height: 1.35;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.eplay-gl-checkout-link:hover {
	color: var(--eplay-gl-button-color, #be0100);
	opacity: 0.78;
}

.eplay-gl-checkout-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Contiene l’immagine intera nello spazio disponibile (niente scroll) */
.eplay-gl-image {
	display: block;
	width: auto;
	height: auto;
	max-width: min(100vw - 1.5rem, 720px);
	max-height: calc(100vh - 1.5rem);
	max-height: calc(100dvh - 1.5rem);
	object-fit: contain;
}

html.eplay-gl-open,
html.eplay-gl-open body {
	overflow: hidden;
}

html.eplay-gl-open body {
	touch-action: none;
}

@media (max-width: 767px) {
	.eplay-gl-overlay {
		padding: 0.5rem;
		padding:
			max(0.5rem, env(safe-area-inset-top, 0px))
			max(0.5rem, env(safe-area-inset-right, 0px))
			max(0.5rem, env(safe-area-inset-bottom, 0px))
			max(0.5rem, env(safe-area-inset-left, 0px));
	}

	.eplay-gl-dialog {
		width: 100%;
		max-width: 100%;
		border-radius: 2px;
	}

	.eplay-gl-image {
		width: 100%;
		max-width: 100%;
		height: auto;
		max-height: calc(100vh - 1rem);
		max-height: calc(100dvh - 1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}

	.eplay-gl-close {
		top: 0.4rem;
		right: 0.4rem;
		width: 2.75rem;
		height: 2.75rem;
	}

	.eplay-gl-close-icon {
		width: 1rem;
		height: 1rem;
	}

	.eplay-gl-destination-label {
		padding: 0.65rem 0.85rem 0.85rem;
		font-size: 0.9rem;
	}
}

.eplay-gl-destination .eplay-gl-image {
	max-height: calc(100vh - 5.5rem);
	max-height: calc(100dvh - 5.5rem);
}

/* Solo etichetta GARAN: la X sta sopra l’immagine, non sullo scudo. */
.eplay-gl-dialog--label .eplay-gl-close {
	position: static;
	align-self: flex-end;
	flex-shrink: 0;
	margin: 0.4rem 0.4rem 0.15rem;
}

.eplay-gl-dialog--label .eplay-gl-destination .eplay-gl-image {
	max-height: calc(100vh - 9rem);
	max-height: calc(100dvh - 9rem);
}

@media (max-width: 767px) {
	.eplay-gl-destination .eplay-gl-image {
		max-height: calc(100vh - 4.5rem);
		max-height: calc(100dvh - 4.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}

	.eplay-gl-dialog--label .eplay-gl-close {
		margin: 0.35rem 0.35rem 0.1rem;
	}

	.eplay-gl-dialog--label .eplay-gl-destination .eplay-gl-image {
		max-height: calc(100vh - 8rem);
		max-height: calc(100dvh - 8rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.eplay-gl-overlay,
	.eplay-gl-dialog,
	.eplay-gl-close {
		transition: none;
	}
}
