/* Producty PDF viewer. Neutral palette per Producty house style. No blue. */

.producty-pdf {
	position: relative;
	display: block;
	width: 100%;
	background: #f6f7f7;
	border: 1px solid #ddd;
	box-sizing: border-box;
	overflow: hidden;
}

.producty-pdf .producty-pdf-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f6f7f7 25%, #eee 25%, #eee 50%, #f6f7f7 50%, #f6f7f7 75%, #eee 75%);
	background-size: 24px 24px;
	opacity: 0.4;
}

.producty-pdf-toolbar {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 6px 10px;
	background: #333;
	color: #f6f7f7;
	border-bottom: 1px solid #222;
	font-size: 13px;
}

.producty-pdf-toolbar-hidden {
	display: none;
}

.producty-pdf-toolbar-hover {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	z-index: 2;
	opacity: 0;
	transform: translateY(-100%);
	transition: opacity 150ms ease, transform 150ms ease;
}

.producty-pdf:hover .producty-pdf-toolbar-hover {
	opacity: 1;
	transform: translateY(0);
}

.producty-pdf-btn {
	background: #555;
	color: #f6f7f7;
	border: 1px solid #666;
	border-radius: 3px;
	padding: 4px 10px;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	text-decoration: none;
}

.producty-pdf-btn:hover {
	background: #666;
}

.producty-pdf-pageinfo {
	margin: 0 6px;
	font-variant-numeric: tabular-nums;
	min-width: 80px;
	text-align: center;
}

.producty-pdf-pages {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 0;
	overflow: auto;
	height: calc(100% - 38px);
	background: #f6f7f7;
}

.producty-pdf-toolbar-hidden + .producty-pdf-pages,
.producty-pdf-toolbar-hover + .producty-pdf-pages {
	height: 100%;
}

.producty-pdf-page {
	position: relative;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	max-width: 100%;
}

.producty-pdf-page canvas {
	display: block;
	max-width: 100%;
	height: auto;
}

.producty-pdf-textlayer {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	overflow: hidden;
	opacity: 0.25;
	line-height: 1;
	pointer-events: auto;
}

.producty-pdf-textlayer span,
.producty-pdf-textlayer br {
	color: transparent;
	position: absolute;
	white-space: pre;
	cursor: text;
	transform-origin: 0% 0%;
}

.producty-pdf-textlayer ::selection {
	background: #888;
	color: transparent;
}

/* Single-page mode: fits one page with no scroll. */
.producty-pdf-single .producty-pdf-pages {
	overflow: hidden;
	gap: 0;
}

.producty-pdf-single .producty-pdf-page {
	box-shadow: none;
}

/* Aspect-ratio mode: the pages area sizes itself to the PDF's true page
   ratio, so the container's height tracks its width across every viewport
   instead of leaking empty space below the canvas on narrow screens. The
   outer .producty-pdf has no fixed height in this mode — it auto-sizes
   to toolbar + pages — so we also drop the calc(100% - 38px) rule that
   only made sense when the parent had an explicit pixel height. */
.producty-pdf-has-aspect .producty-pdf-pages {
	aspect-ratio: var(--producty-pdf-aspect, auto);
	height: auto;
}

/* Pre-boot placeholder needs the aspect too — otherwise the outer container
   collapses to zero height (placeholder is height: 100% of an auto-sized
   parent) and the embed pops into existence only once viewer.js renders. */
.producty-pdf-has-aspect .producty-pdf-placeholder {
	aspect-ratio: var(--producty-pdf-aspect, auto);
	height: auto;
}

.producty-pdf-error {
	padding: 12px;
	background: #fff3f3;
	color: #800;
	border: 1px solid #c00;
}
