.nbp-product-viewer {
	--nbp-accent: #1768a6;
	--nbp-button: #252525;
	--nbp-button-text: #fff;
	box-sizing: border-box;
	float: left;
	width: 48%;
	margin: 0 0 2.5rem;
	padding: 0;
	clear: none;
}

.nbp-product-viewer *,
.nbp-product-viewer *::before,
.nbp-product-viewer *::after {
	box-sizing: border-box;
}

.nbp-book-layout.has-pages {
	display: grid;
	grid-template-columns: minmax(62px, 78px) minmax(0, 1fr);
	align-items: stretch;
}

.nbp-side-pages {
	display: flex;
	flex-direction: column;
	align-self: center;
	gap: .55rem;
	max-height: clamp(390px, 45vw, 600px);
	padding: .35rem .45rem .35rem .1rem;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
}

.nbp-side-thumbnail {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	padding: 3px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nbp-side-thumbnail:hover,
.nbp-side-thumbnail:focus-visible,
.nbp-side-thumbnail.is-active {
	border-color: var(--nbp-accent);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .13);
}

.nbp-side-thumbnail:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--nbp-accent), transparent 48%);
	outline-offset: 2px;
}

.nbp-side-thumbnail img {
	display: block;
	width: 100%;
	aspect-ratio: .74;
	height: auto;
	object-fit: cover;
}

.nbp-stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: clamp(420px, 48vw, 640px);
	padding: 1.25rem 1rem 1.5rem;
	perspective: 1500px;
	overflow: visible;
}

.nbp-inline-preview[hidden] {
	display: none;
}

.nbp-inline-preview {
	position: absolute;
	inset: 1rem;
	z-index: 5;
	display: grid;
	place-items: center;
	min-width: 0;
	min-height: 0;
}

.nbp-inline-image {
	display: block;
	max-width: 100%;
	max-height: calc(clamp(420px, 48vw, 640px) - 2.5rem);
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 14px 18px 24px rgba(28, 36, 46, .2);
}

.nbp-inline-close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	padding: .48rem .8rem;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	color: #252525;
	font: inherit;
	font-size: .82rem;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .1);
}

.nbp-inline-close:hover,
.nbp-inline-close:focus-visible {
	border-color: var(--nbp-accent);
	color: var(--nbp-accent);
}

.nbp-stage.is-inline-open .nbp-book {
	visibility: hidden;
}

.nbp-book {
	position: relative;
	width: min(78%, 390px);
	aspect-ratio: 0.72;
	transform: rotateY(-7deg) rotateX(1deg);
	transform-style: preserve-3d;
	transform-origin: center center;
	transition: transform 700ms cubic-bezier(.22, .72, .22, 1);
}

.nbp-book.is-back {
	transform: rotateY(-173deg) rotateX(1deg);
}

.nbp-book-face {
	position: absolute;
	inset: 0;
	background: #f7f3e9;
	backface-visibility: hidden;
	overflow: hidden;
	border-radius: 2px 5px 5px 2px;
	box-shadow: 20px 24px 19px rgba(28, 36, 46, .22);
}

.nbp-book-front {
	transform: translateZ(12px);
}

.nbp-book-back {
	transform: rotateY(180deg) translateZ(12px);
}

.nbp-cover-image,
.nbp-book-face > img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.nbp-book-front::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 9%;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(19, 14, 7, .28), rgba(255, 255, 255, .18) 36%, transparent);
	mix-blend-mode: multiply;
}

.nbp-book-spine {
	position: absolute;
	top: 1px;
	bottom: 1px;
	left: -12px;
	width: 24px;
	background: linear-gradient(90deg, #5d554a, #ddd4c4 58%, #746b60);
	transform: rotateY(-90deg);
	transform-origin: right center;
}

.nbp-book-pages {
	position: absolute;
	top: 6px;
	right: -10px;
	bottom: 7px;
	width: 20px;
	background: repeating-linear-gradient(90deg, #f6f1e8 0, #f6f1e8 2px, #d7d0c5 3px);
	transform: rotateY(90deg);
	transform-origin: left center;
	box-shadow: inset 0 0 6px rgba(0, 0, 0, .14);
}

.nbp-flat-spine .nbp-book-front::after,
.nbp-flat-spine .nbp-book-spine {
	display: none;
}

.nbp-back-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(145deg, #f1ecdf, #d8d0c2);
}

.nbp-actions {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: .75rem;
	min-height: 44px;
	padding: .1rem 1rem;
	flex-wrap: wrap;
}

.nbp-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .35rem;
	min-height: 38px;
	padding: .48rem 1rem;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	background: #fff;
	color: #252525;
	font: inherit;
	font-size: .94rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
	transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nbp-action:hover,
.nbp-action:focus-visible {
	border-color: var(--nbp-accent);
	color: var(--nbp-accent);
	transform: translateY(-1px);
	box-shadow: 0 4px 13px rgba(0, 0, 0, .09);
}

.nbp-flip-icon {
	width: 1.15em;
	height: 1.15em;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 700ms cubic-bezier(.22, .72, .22, 1);
}

.nbp-flip-button[aria-pressed="true"] .nbp-flip-icon {
	transform: scaleX(-1);
}

.nbp-action:focus-visible,
.nbp-dialog button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--nbp-accent), transparent 58%);
	outline-offset: 2px;
}

.nbp-dialog[hidden] {
	display: none;
}

.nbp-dialog {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: clamp(.5rem, 2vw, 2rem);
	background: rgba(16, 20, 25, .82);
	backdrop-filter: blur(2px);
}

.nbp-dialog-panel {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(1180px, 96vw);
	height: min(880px, 94vh);
	background: #fff;
	border-radius: 5px;
	overflow: hidden;
	box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.nbp-dialog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 54px;
	padding: .75rem 1rem;
	border-bottom: 1px solid #e6e6e6;
}

.nbp-dialog-header p {
	margin: 0;
	font-size: .95rem;
	line-height: 1.35;
}

.nbp-dialog-header p > span {
	margin-right: .5rem;
	color: #777;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.nbp-dialog-header strong {
	color: var(--nbp-accent);
	font-weight: 600;
}

.nbp-dialog-close {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #666;
	font: 400 2rem/1 sans-serif;
	cursor: pointer;
}

.nbp-dialog-close:hover {
	color: var(--nbp-accent);
}

.nbp-dialog-body {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	min-height: 0;
	background: #f8f8f7;
}

.nbp-thumbnails {
	display: flex;
	flex-direction: column;
	gap: .6rem;
	padding: .8rem;
	overflow-y: auto;
	border-right: 1px solid #e2e2e2;
	background: #fff;
}

.nbp-thumbnail {
	position: relative;
	width: 100%;
	padding: 3px;
	border: 2px solid transparent;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
}

.nbp-thumbnail.is-active {
	border-color: var(--nbp-accent);
}

.nbp-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 92px;
	object-fit: cover;
}

.nbp-page-area {
	position: relative;
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) 52px;
	align-items: center;
	min-width: 0;
	min-height: 0;
	padding: 1rem .5rem;
	overflow: auto;
}

.nbp-product-viewer .nbp-page-frame {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	place-items: center;
	justify-content: stretch;
	width: 100%;
	min-width: 0;
	min-height: 100%;
	margin: 0;
	padding: 0;
}

.nbp-product-viewer .nbp-page-image {
	display: block;
	max-width: 100% !important;
	max-height: calc(94vh - 145px);
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
	transform: scale(1);
	transform-origin: center top;
	transition: transform 180ms ease;
}

.nbp-page-nav {
	position: relative;
	z-index: 2;
	width: 42px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: rgba(255, 255, 255, .92);
	color: #555;
	font: 300 2.4rem/1 sans-serif;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.nbp-page-nav:hover:not(:disabled) {
	background: var(--nbp-accent);
	color: #fff;
}

.nbp-page-nav:disabled {
	opacity: .28;
	cursor: default;
}

.nbp-dialog-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	padding: .55rem 1rem .55rem 112px;
	border-top: 1px solid #e6e6e6;
	background: #fff;
}

.nbp-page-counter {
	color: #666;
	font-size: .86rem;
}

.nbp-zoom-controls {
	display: flex;
	gap: .5rem;
}

.nbp-zoom-controls button {
	width: 39px;
	height: 39px;
	padding: 0;
	border: 1px solid #dedede;
	border-radius: 50%;
	background: #fff;
	color: #555;
	font: 300 1.55rem/1 sans-serif;
	cursor: pointer;
}

.nbp-zoom-controls button:hover:not(:disabled) {
	border-color: var(--nbp-accent);
	color: var(--nbp-accent);
}

body.nbp-dialog-open {
	overflow: hidden;
}

/* La portada completa ya enlaza al producto: evitamos controles duplicados al pasar el cursor. */
.single-product .related.products .post_featured.hover_shop .icons,
.single-product .related.products .post_featured.hover_shop .mask {
	display: none !important;
}

/* Iguala Productos relacionados con la cuadrícula de Publicaciones de Autor. */
.single-product .related.products > h2 {
	margin: 0 0 28px !important;
	color: #151312;
	font-family: "Oswald", "Arial Narrow", sans-serif !important;
	font-size: clamp(28px, 4vw, 40px) !important;
	font-weight: 600 !important;
	line-height: 1.15 !important;
	text-transform: uppercase;
}

.single-product .related.products > h2::before {
	display: none !important;
	content: none !important;
}

.single-product .related.products ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0 !important;
	padding: 0 !important;
}

.single-product .related.products ul.products::before,
.single-product .related.products ul.products::after {
	display: none !important;
}

.single-product .related.products ul.products li.product {
	float: none !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	list-style: none !important;
}

.single-product .related.products ul.products li.product::marker {
	content: "";
}

.single-product .related.products .post_featured {
	padding: 12px;
	background: #fff;
}

.single-product .related.products .post_featured > a {
	display: block;
	width: 100%;
}

.single-product .related.products .post_featured img {
	display: block;
	width: 100% !important;
	height: auto !important;
}

.single-product .related.products .post_data {
	padding-top: 12px;
	text-align: left;
}

.single-product .related.products .woocommerce-loop-product__title {
	min-height: 2.6em !important;
	margin: 0 0 7px !important;
	padding: 0 !important;
	color: #151312;
	font-family: Roboto, Arial, sans-serif !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
}

.single-product .related.products .woocommerce-loop-product__title a {
	color: inherit;
	text-decoration: none;
}

.single-product .related.products .price {
	display: block;
	color: #3b3a38;
	font-size: 19px;
}

.single-product .related.products .post_data .button,
.single-product .related.products .post_data .yith-wcqv-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: auto !important;
	height: 38px !important;
	min-height: 38px !important;
	margin: 8px 5px 0 0 !important;
	padding: 0 12px !important;
	border: 1px solid #151312 !important;
	border-radius: 0 !important;
	box-sizing: border-box;
	box-shadow: 2px 2px 0 rgb(21 19 18 / 28%);
	font-family: Roboto, Arial, sans-serif;
	font-size: 11px !important;
	font-weight: 800;
	line-height: 1.1 !important;
	letter-spacing: .04em;
	text-decoration: none !important;
	text-transform: uppercase;
}

.single-product .related.products .post_data .button.add_to_cart_button {
	background: #e8412f !important;
	color: #fff !important;
}

.single-product .related.products .post_data .yith-wcqv-button {
	background: transparent !important;
	color: #151312 !important;
}

.single-product .related.products .post_data .button:hover,
.single-product .related.products .post_data .button:focus-visible,
.single-product .related.products .post_data .yith-wcqv-button:hover,
.single-product .related.products .post_data .yith-wcqv-button:focus-visible {
	transform: translate(-1px, -1px);
	box-shadow: 4px 4px 0 rgb(21 19 18 / 28%);
}

@media (max-width: 1024px) {
	.single-product .related.products ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.nbp-book,
	.nbp-action,
	.nbp-page-image,
	.nbp-side-thumbnail {
		transition-duration: 0.01ms;
	}
}

@media (max-width: 768px) {
	.single-product .related.products ul.products {
		grid-template-columns: minmax(0, 1fr);
	}

	.nbp-product-viewer {
		float: none;
		width: 100%;
		margin-right: 0;
	}

	.nbp-book-layout.has-pages {
		display: flex;
		flex-direction: column;
	}

	.nbp-side-pages {
		order: 2;
		flex-direction: row;
		align-self: stretch;
		gap: .5rem;
		max-height: none;
		padding: .6rem .75rem .2rem;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.nbp-side-thumbnail {
		flex: 0 0 60px;
	}

	.nbp-stage {
		order: 1;
		min-height: min(125vw, 570px);
		padding-top: .5rem;
	}

	.nbp-inline-preview {
		inset: .5rem;
	}

	.nbp-inline-image {
		max-height: calc(min(125vw, 570px) - 1rem);
	}

	.nbp-book {
		width: min(75vw, 350px);
	}

	.nbp-dialog {
		padding: 0;
	}

	.nbp-dialog-panel {
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}

	.nbp-dialog-header p > span {
		display: none;
	}

	.nbp-dialog-body {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(0, 1fr) 82px;
	}

	.nbp-thumbnails {
		grid-row: 2;
		flex-direction: row;
		padding: .45rem .6rem;
		overflow-x: auto;
		overflow-y: hidden;
		border-top: 1px solid #e2e2e2;
		border-right: 0;
	}

	.nbp-thumbnail {
		flex: 0 0 54px;
	}

	.nbp-thumbnail img {
		height: 62px;
	}

	.nbp-page-area {
		grid-row: 1;
		grid-template-columns: 40px minmax(0, 1fr) 40px;
		padding: .5rem .15rem;
	}

	.nbp-page-nav {
		width: 34px;
		height: 46px;
	}

	.nbp-page-image {
		max-height: calc(100dvh - 205px);
	}

	.nbp-dialog-footer {
		padding-left: 1rem;
	}
}
