/* PDF.js + PageFlip catalogue viewer - shared assets - v18 wide/tall + mobile touch + load more catalogues
   CSS comune per tutti i cataloghi dentro /flip/css/.
   I PDF restano nelle rispettive cartelle /flip/selection-.../catalogue.pdf.
*/

/* Blocco anti-scroll orizzontale della pagina principale. */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

body {
	position: relative;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

#topDaBottom {
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
}

/*
   Viewer quasi a tutta larghezza.
   Usa 100vw meno un margine di sicurezza: abbastanza largo, ma senza creare
   la barra di scroll orizzontale della pagina principale.
*/
.catalogue-viewer-container {
	width: calc(100vw - 24px) !important;
	max-width: calc(100vw - 24px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	overflow-x: hidden;
}

.catalogue-viewer-row {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	overflow-x: hidden;
}

.catalogue-viewer-col {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding-left: 0;
	padding-right: 0;
	overflow-x: hidden;
}

.catalogue-section {
	width: 100%;
	max-width: 100%;
	margin-top: 0;
	margin-bottom: 0;
	overflow-x: hidden;
}

/* Compatibilità: se resta qualche vecchio div .catalogue-full-width, usa la stessa larghezza sicura. */
.catalogue-full-width {
	width: calc(100vw - 24px) !important;
	max-width: calc(100vw - 24px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	overflow-x: hidden;
}

.catalogue-menu-links {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.catalogue-menu-link {
	display: inline-block;
	font-size: 14px;
	font-weight: 300;
	color: #00b4e2;
	text-decoration: none;
}

.catalogue-menu-link:hover,
.catalogue-menu-link:focus {
	color: #00b4e2;
	text-decoration: underline;
}

.matteo-pdf-flipbook {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 8px 0 8px;
	color: #ffffff;
	background: transparent;
}

.matteo-pdf-flipbook-header {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	text-align: center;
	background: transparent;
}

.matteo-pdf-flipbook-title {
	font-size: 18px;
	font-weight: 600;
	color: rgb(233, 133, 13);
	line-height: 1.25;
	text-align: center;
}

.matteo-pdf-download {
	display: inline-block;
	margin-top: 3px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: #00b4e2;
	text-decoration: none;
}

.matteo-pdf-download:hover,
.matteo-pdf-download:focus {
	color: #00b4e2;
	text-decoration: underline;
}

.matteo-pdf-flipbook-counter {
	font-size: 14px;
	font-weight: 400;
	color: #d8d8d8;
	white-space: nowrap;
	padding-left: 4px;
}

.matteo-pdf-flipbook-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 6px;
	background: transparent;
}

.matteo-pdf-zoom {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 6px;
}

.matteo-pdf-button {
	min-width: 38px;
	min-height: 34px;
	padding: 5px 10px;
	border: 1px solid #444;
	border-radius: 4px;
	background: #1d1d1d;
	color: #ffffff;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}

.matteo-pdf-prev,
.matteo-pdf-next,
.matteo-pdf-zoom-out,
.matteo-pdf-zoom-in {
	font-size: 20px;
}

.matteo-pdf-button:disabled {
	opacity: 0.35;
	cursor: default;
}

.matteo-pdf-button:not(:disabled):hover {
	background: #2b2b2b;
}

.matteo-pdf-zoom-value {
	min-width: 54px;
	display: inline-block;
	text-align: center;
	font-size: 13px;
	color: #d8d8d8;
}

/*
  Al 100% niente barre interne.
  Sopra 100%, il JS aggiunge .is-zoomed e le barre tornano.
  Sfondo e riquadro rimossi: dietro al catalogo non appare più il box nero.
*/
.matteo-pdf-flipbook-stage {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: 118vh;
	min-height: 900px;
	overflow: hidden;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
}

.matteo-pdf-flipbook:not(.is-zoomed) .matteo-pdf-flipbook-stage::-webkit-scrollbar {
	display: none;
}

.matteo-pdf-flipbook.is-zoomed .matteo-pdf-flipbook-stage {
	overflow: auto;
	scrollbar-width: auto;
	-ms-overflow-style: auto;
}

.matteo-pdf-flipbook.is-zoomed .matteo-pdf-flipbook-stage::-webkit-scrollbar {
	display: initial;
}

.matteo-pdf-book-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 0;
	overflow: visible;
	background: transparent;
}

.matteo-pdf-book {
	position: relative;
	margin: 0 auto;
	transform-origin: top center;
	direction: ltr;
	outline: none !important;
	background: transparent;
}

.matteo-pdf-page {
	position: relative;
	background: #ffffff;
	overflow: hidden;
	direction: ltr;
	outline: none !important;
	box-shadow: none !important;
	border: 0 !important;
}

.matteo-pdf-page canvas {
	display: block;
	width: 100%;
	height: 100%;
	background: #ffffff;
	outline: none !important;
	border: 0 !important;
}

.matteo-pdf-page-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f5f5f5;
	color: #777777;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	letter-spacing: 0.03em;
	pointer-events: none;
}

.matteo-pdf-page.is-rendered .matteo-pdf-page-placeholder {
	display: none;
}

/* Viewer mobile stabile: niente PageFlip, solo canvas PDF.js. */
.matteo-pdf-mobile-viewer {
	display: none;
	width: 100%;
	height: 100%;
	align-items: flex-start;
	justify-content: center;
	overflow: visible;
	background: transparent;
}

.matteo-pdf-mobile-canvas {
	display: block;
	background: #ffffff;
	box-shadow: none;
	touch-action: pan-x pan-y;
}

.matteo-pdf-flipbook.is-mobile-mode .matteo-pdf-flipbook-stage,
.matteo-pdf-flipbook.is-mobile-mode .matteo-pdf-mobile-viewer,
.matteo-pdf-flipbook.is-mobile-mode .matteo-pdf-mobile-canvas {
	cursor: pointer;
}

.matteo-pdf-flipbook.is-mobile-mode .matteo-pdf-book-wrap {
	display: none;
}

.matteo-pdf-flipbook.is-mobile-mode .matteo-pdf-mobile-viewer {
	display: flex;
}

/* Riduce/elimina le linee diagonali prodotte da PageFlip durante l'animazione. */
.stf__wrapper,
.stf__block,
.stf__item,
.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
	outline: none !important;
	border: 0 !important;
	box-shadow: none !important;
}

.stf__item {
	background: #ffffff !important;
}

.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
	display: none !important;
	opacity: 0 !important;
}

.matteo-pdf-loading {
	position: absolute;
	top: 8px;
	left: 50%;
	z-index: 40;
	width: max-content;
	transform: translateX(-50%);
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.76);
	color: #cfcfcf;
	font-size: 12px;
	letter-spacing: 0.02em;
	pointer-events: none;
}

.matteo-pdf-loading.is-hidden {
	display: none;
}

.matteo-pdf-mobile-note {
	display: none;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 300;
	color: #9f9f9f;
	text-align: center;
}

.matteo-pdf-error {
	margin: 16px auto 0;
	max-width: 760px;
	padding: 16px;
	background: #2a1111;
	border: 1px solid #7a3030;
	border-radius: 4px;
	color: #ffffff;
	font-size: 13px;
	line-height: 1.5;
}

.matteo-pdf-error code {
	color: #ffffff;
	background: rgba(255,255,255,0.08);
	padding: 1px 4px;
	border-radius: 3px;
}


@media (max-width: 1200px) {
	.catalogue-viewer-container,
	.catalogue-full-width {
		width: calc(100vw - 20px) !important;
		max-width: calc(100vw - 20px) !important;
	}

	.matteo-pdf-flipbook-stage {
		height: 112vh;
		min-height: 820px;
	}
}

@media (max-width: 991px) {
	.catalogue-viewer-container,
	.catalogue-full-width {
		width: calc(100vw - 16px) !important;
		max-width: calc(100vw - 16px) !important;
	}

	.matteo-pdf-flipbook-stage {
		height: 104vh;
		min-height: 720px;
	}
}

@media (max-width: 768px) {
	.catalogue-viewer-container,
	.catalogue-full-width {
		width: calc(100vw - 10px) !important;
		max-width: calc(100vw - 10px) !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.matteo-pdf-flipbook {
		padding-top: 5px;
	}

	.matteo-pdf-flipbook-header {
		margin-bottom: 7px;
	}

	.matteo-pdf-flipbook-title {
		font-size: 15px;
	}

	.matteo-pdf-flipbook-counter {
		font-size: 13px;
		padding-left: 0;
	}

	.matteo-pdf-flipbook-toolbar {
		gap: 6px;
		margin-bottom: 7px;
	}

	.matteo-pdf-button {
		min-width: 34px;
		min-height: 32px;
		padding: 4px 8px;
		font-size: 12px;
	}

	.matteo-pdf-prev,
	.matteo-pdf-next,
	.matteo-pdf-zoom-out,
	.matteo-pdf-zoom-in {
		font-size: 18px;
	}

	.matteo-pdf-flipbook-stage {
		height: auto;
		min-height: 0;
		padding: 0;
	}

	.matteo-pdf-flipbook.is-zoomed .matteo-pdf-flipbook-stage {
		max-height: 92vh;
		overflow: auto;
	}

	.matteo-pdf-mobile-viewer {
		justify-content: flex-start;
	}

	.matteo-pdf-mobile-note {
		display: block;
		margin-top: 4px;
	}
}

@media (max-width: 480px) {
	.catalogue-viewer-container,
	.catalogue-full-width {
		width: calc(100vw - 8px) !important;
		max-width: calc(100vw - 8px) !important;
	}

	.matteo-pdf-flipbook-stage {
		height: auto;
		min-height: 0;
	}

	.matteo-pdf-flipbook.is-zoomed .matteo-pdf-flipbook-stage {
		max-height: 90vh;
	}
}


/* Menu cataloghi: link disabilitati finché il catalogo non è stato caricato nel DOM. */
.catalogue-menu-link.is-disabled,
.catalogue-menu-link[aria-disabled="true"] {
	color: #777777;
	opacity: 0.45;
	pointer-events: none;
	cursor: default;
	text-decoration: none;
}

.catalogue-menu-link.is-loaded {
	color: #00b4e2;
	opacity: 1;
	pointer-events: auto;
	cursor: pointer;
}

.catalogue-load-more-wrap {
	width: 100%;
	max-width: 100%;
	text-align: center;
	margin: 4px auto 34px;
	padding: 0 12px;
	overflow-x: hidden;
}

.catalogue-load-more-button {
	display: inline-block;
	min-width: 220px;
	padding: 10px 22px;
	border: 1px solid #666666;
	border-radius: 4px;
	background: #1d1d1d;
	color: #ffffff;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-align: center;
	cursor: pointer;
}

.catalogue-load-more-button:hover:not(:disabled),
.catalogue-load-more-button:focus:not(:disabled) {
	background: #2b2b2b;
}

.catalogue-load-more-button:disabled,
.catalogue-load-more-button.is-finished {
	opacity: 0.62;
	cursor: default;
}

.catalogue-lazy-template-holder {
	display: none;
}


/* BLOCCO SELEZIONE / TASTO DESTRO / SALVATAGGIO CANVAS PAGINE
   Applicato solo all'area delle pagine, non al link Download. */
.matteo-pdf-flipbook-stage,
.matteo-pdf-flipbook-stage *,
.matteo-pdf-book-wrap,
.matteo-pdf-book,
.matteo-pdf-page,
.matteo-pdf-page canvas,
.matteo-pdf-mobile-viewer,
.matteo-pdf-mobile-viewer *,
.matteo-pdf-mobile-canvas,
.stf__wrapper,
.stf__block,
.stf__item,
.stf__item * {
	-webkit-user-select: none !important;
	-moz-user-select: none !important;
	-ms-user-select: none !important;
	user-select: none !important;
	-webkit-touch-callout: none !important;
	-webkit-user-drag: none !important;
}

.matteo-pdf-flipbook-stage canvas,
.matteo-pdf-mobile-canvas {
	-webkit-user-drag: none !important;
	user-drag: none !important;
}
