.bppm-modal {
	--bppm-modal-width: 1180px;
	--bppm-surface: #fff;
	--bppm-text: #202124;
	--bppm-muted: #646970;
	--bppm-border: #dcdcde;
	--bppm-accent: #2271b1;
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: var(--bppm-text);
	font-family: inherit;
}

.bppm-modal.is-open {
	display: flex;
}

.bppm-modal[aria-hidden="true"] {
	display: none;
}

.bppm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 12, 16, 0.82);
	backdrop-filter: blur(3px);
}

.bppm-modal__dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
	width: min(var(--bppm-modal-width), calc(100vw - 48px));
	max-height: calc(100vh - 48px);
	overflow: hidden;
	background: var(--bppm-surface);
	border-radius: 14px;
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.42);
}

.bppm-modal--small { --bppm-modal-width: 780px; }
.bppm-modal--medium { --bppm-modal-width: 980px; }
.bppm-modal--large { --bppm-modal-width: 1180px; }
.bppm-modal--full { --bppm-modal-width: calc(100vw - 48px); }

.bppm-card--left .bppm-modal__dialog {
	grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
}

.bppm-card--left .bppm-modal__viewer-column {
	order: 2;
}

.bppm-card--left .bppm-product-card {
	order: 1;
	border-left: 0;
	border-right: 1px solid var(--bppm-border);
}

.bppm-card--bottom .bppm-modal__dialog {
	grid-template-columns: 1fr;
	grid-template-rows: minmax(0, 1fr) auto;
}

.bppm-card--bottom .bppm-product-card {
	display: grid;
	grid-template-columns: auto minmax(180px, 1fr) auto;
	gap: 14px 20px;
	align-items: center;
	border-left: 0;
	border-top: 1px solid var(--bppm-border);
	max-height: 260px;
}

.bppm-card--bottom .bppm-product-card__media {
	grid-row: span 4;
}

.bppm-modal__viewer-column {
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: #f0f0f1;
}

.bppm-modal__title {
	margin: 0;
	padding: 15px 64px 13px 20px;
	font-size: 18px;
	line-height: 1.35;
	background: #fff;
	border-bottom: 1px solid var(--bppm-border);
}

.bppm-modal__close {
	position: absolute;
	top: 9px;
	right: 10px;
	z-index: 5;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: #1d2327;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.bppm-modal__close:hover,
.bppm-modal__close:focus-visible {
	background: #fff;
	outline: 3px solid rgba(34, 113, 177, 0.4);
}

.bppm-slider {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px 56px 48px;
	overflow: hidden;
	user-select: none;
}

.bppm-slider__viewport {
	width: 100%;
	height: 100%;
	min-height: 360px;
	display: grid;
	place-items: center;
}

.bppm-slider__slide {
	width: 100%;
	height: 100%;
	margin: 0;
	place-items: center;
}

.bppm-slider__slide.is-active {
	display: grid;
}

.bppm-slider__slide[hidden] {
	display: none !important;
}

.bppm-slider__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 165px);
	width: auto;
	height: auto;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	-webkit-user-drag: none;
}

.bppm-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 54px;
	margin-top: -27px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.94);
	color: #1d2327;
	font-size: 23px;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

.bppm-slider__arrow--prev { left: 9px; }
.bppm-slider__arrow--next { right: 9px; }

.bppm-slider__arrow:hover:not(:disabled),
.bppm-slider__arrow:focus-visible:not(:disabled) {
	background: #fff;
	outline: 3px solid rgba(34, 113, 177, 0.35);
}

.bppm-slider__arrow:disabled {
	opacity: 0.34;
	cursor: not-allowed;
}

.bppm-slider__counter {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	min-width: 64px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(29, 35, 39, 0.84);
	color: #fff;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.bppm-product-card {
	min-width: 0;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 28px 24px;
	background: #fff;
	border-left: 1px solid var(--bppm-border);
}

.bppm-product-card__media {
	text-align: center;
	margin-bottom: 16px;
}

.bppm-product-card__cover {
	max-width: 135px;
	height: auto;
	border-radius: 5px;
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.15);
}

.bppm-product-card__title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.3;
}

.bppm-product-card__publisher,
.bppm-product-card__description,
.bppm-protection-note {
	color: var(--bppm-muted);
}

.bppm-product-card__publisher {
	margin: 0 0 12px;
	font-size: 14px;
}

.bppm-product-card__publisher span {
	font-weight: 600;
	color: var(--bppm-text);
}

.bppm-product-card__formats {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 13px 0;
}

.bppm-format-badge {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #eef5fb;
	color: #135e96;
	font-size: 12px;
	font-weight: 650;
}

.bppm-product-card__price {
	margin: 14px 0 8px;
	font-size: 22px;
	font-weight: 700;
}

.bppm-product-card__stock .stock {
	margin: 0 0 12px;
}

.bppm-product-card__description {
	font-size: 14px;
	line-height: 1.65;
}

.bppm-product-card__cta {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin-top: 18px !important;
	text-align: center;
}

.bppm-protection-note {
	margin: 16px 0 0;
	font-size: 11px;
	line-height: 1.45;
}

.bppm-protected .bppm-slider__image {
	pointer-events: none;
	-webkit-touch-callout: none;
}

@media print {
	.bppm-modal.bppm-protected,
	.bppm-modal.bppm-protected * {
		display: none !important;
	}
}

/* PDF.js canvas viewer. */
.bppm-slider--pdf {
	touch-action: pan-y;
}

.bppm-pdf-viewport {
	position: relative;
	min-width: 0;
	min-height: 360px;
}

.bppm-pdf-canvas-wrap {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

.bppm-pdf-canvas {
	display: block;
	max-width: 100%;
	max-height: 100%;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transition: opacity 120ms ease;
	-webkit-user-drag: none;
}

.bppm-pdf-canvas.is-rendered {
	opacity: 1;
}

.bppm-pdf-status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 30px;
	color: var(--bppm-muted);
	font-size: 14px;
	text-align: center;
	background: rgba(240, 240, 241, 0.78);
}

.bppm-pdf-status[hidden] {
	display: none !important;
}

.bppm-pdf-status.is-error {
	color: #8a2424;
}

.bppm-pdf-status.is-error .bppm-pdf-spinner {
	display: none;
}

.bppm-pdf-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid rgba(34, 113, 177, 0.24);
	border-top-color: var(--bppm-accent);
	border-radius: 50%;
	animation: bppm-spin 800ms linear infinite;
}

@keyframes bppm-spin {
	to { transform: rotate(360deg); }
}

.bppm-product-card__cta {
	position: relative !important;
	z-index: 10 !important;
	pointer-events: auto !important;
	cursor: pointer !important;
}

.bppm-product-card__cta.is-redirecting {
	opacity: 0.72;
	pointer-events: none !important;
}

.bppm-protected .bppm-pdf-canvas {
	pointer-events: none;
	-webkit-touch-callout: none;
}
