/* Shared product rails keep native touch scrolling and snap each card. */
.cvpd-rail-frame { position: relative; min-width: 0; }
.cvpd-rail-frame [data-cvpd-rail] { scrollbar-width: none; scroll-snap-type: x mandatory; }
.cvpd-rail-frame [data-cvpd-rail]::-webkit-scrollbar { display: none; }
.cvpd-rail-controls { pointer-events: none; }
.cvpd-page .cvpd-rail-controls[hidden],
.cvpd-page .cvpd-artist-toggle[hidden] { display: none; }
.cvpd-rail-controls button {
	position: absolute;
	z-index: 3;
	top: var(--cvpd-control-y, 50%);
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255,255,255,.28);
	background: #201e1b;
	color: #fff;
	line-height: 1;
	font-size: 21px;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 3px 10px #201e1b36;
}
.cvpd-rail-controls button:disabled { visibility: hidden; }
.cvpd-rail-controls [data-cvpd-prev] { inset-inline-start: 6px; }
.cvpd-rail-controls [data-cvpd-next] { inset-inline-end: 6px; }
.cvpd-rail-frame.is-rtl .cvpd-rail-controls button { scale: -1 1; }
.cvpd-rail-controls button:focus-visible,
.cvpd-media-card:focus-visible,
.cvpd-media-dialog button:focus-visible,
.cvpd-sticky-button:focus-visible { outline: 2px solid #967546; outline-offset: 3px; }

.cvpd-real-life {
	container-type: inline-size;
	margin-top: clamp(22px, 3vw, 36px);
	padding-top: 18px;
	border-top: 1px solid #25221e29;
}
.cvpd-real-life h2 {
	margin: 0 0 14px;
	font-size: clamp(18px, 2vw, 23px);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: .01em;
}
.cvpd-media-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 12px) / 2);
	gap: 12px;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	padding-block: 3px;
}
@container (min-width: 510px) {
	.cvpd-media-rail { grid-auto-columns: calc((100% - 24px) / 3); }
}
.cvpd-media-rail.has-single-card { grid-auto-columns: min(100%, 245px); }
.cvpd-media-card {
	display: grid;
	place-items: center;
	position: relative;
	width: 100%;
	min-width: 0;
	aspect-ratio: 9/16;
	overflow: hidden;
	border: 0;
	padding: 0;
	border-radius: 12px;
	background: #e5dbcd;
	color: #fff;
	cursor: pointer;
	scroll-snap-align: start;
}
.cvpd-media-card > img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }
.cvpd-media-card:focus-visible { outline-offset: -3px; }
.cvpd-media-play {
	z-index: 1;
	display: grid;
	place-items: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #faf8f3;
	color: #24211e;
}
.cvpd-media-caption {
	position: absolute;
	inset: auto 0 0;
	padding: 22px 9px 9px;
	background: linear-gradient(transparent,#211b16e8);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
	text-align: start;
}
.cvpd-media-note { margin: 9px 0 0; color: #665c51; font-size: 12px; line-height: 1.5; }

.cvpd-studio-gallery {
	container-type: inline-size;
	margin-block-start: 18px;
	padding-block-start: 15px;
	border-top: 1px solid #25221e29;
}
.cvpd-studio-gallery h2 { margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.25; }
.cvpd-studio-gallery .cvpd-media-note { margin: 6px 0 12px; }
.cvpd-studio-gallery .cvpd-rail-frame { max-width: 500px; }
.cvpd-page .cvpd-studio-rail {
	grid-auto-columns: calc((100% - 12px) / 2);
}
@container (min-width: 390px) {
	.cvpd-page .cvpd-studio-rail { grid-auto-columns: calc((100% - 24px) / 3); }
}
.cvpd-page .cvpd-studio-rail.has-single-card { grid-auto-columns: min(100%, 168px); }
.cvpd-studio-card { min-width: 0; scroll-snap-align: start; }
.cvpd-studio-player {
	position: relative;
	aspect-ratio: 2/3;
	overflow: hidden;
	border-radius: 12px;
	background: #e5dbcd;
}
.cvpd-studio-player :is(.cvpd-studio-preview, video) {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.cvpd-studio-player video { opacity: 0; }
.cvpd-studio-player video[data-frame-visible] { opacity: 1; }
.cvpd-page .cvpd-studio-toggle {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	width: 100%;
	padding: 6px;
	border: 0;
	border-radius: inherit;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}
.cvpd-page .cvpd-studio-toggle:focus-visible { outline: 2px solid #967546; outline-offset: -3px; }
.cvpd-page .cvpd-studio-player:not(:has(.cvpd-studio-preview, video[data-frame-visible])) .cvpd-studio-toggle {
	align-items: center;
	justify-content: center;
}
.cvpd-studio-status { margin: 0; color: #665c51; font-size: 11px; text-align: center; }
.cvpd-studio-status:not(:empty) { margin-block-start: 6px; }
.cvpd-studio-toggle .cvpd-media-play { width: 34px; height: 34px; }
.cvpd-studio-toggle .cvpd-media-play::before {
	content: "";
	margin-inline-start: 3px;
	border-block: 6px solid transparent;
	border-inline-start: 9px solid currentColor;
}
.cvpd-studio-toggle[data-playing] .cvpd-media-play::before {
	width: 9px;
	height: 11px;
	box-sizing: border-box;
	margin: 0;
	border: 0;
	border-inline: 3px solid currentColor;
}
.cvpd-studio-caption {
	display: grid;
	gap: 3px;
	padding: 8px 2px 2px;
	text-align: center;
	font-size: 13px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}
.cvpd-studio-caption span { font-weight: 600; }
.cvpd-studio-caption :is(small, a) { color: #665c51; font-size: 11px; }
.cvpd-studio-caption a { text-decoration: underline; text-underline-offset: 2px; }

.cvpd-media-dialog {
	box-sizing: border-box;
	width: min(740px, calc(100% - 24px));
	max-height: 92vh;
	max-height: 92dvh;
	padding: 15px;
	overflow: auto;
	border: 1px solid #d9cfc0;
	border-radius: 12px;
	background: #faf8f3;
	color: #25221e;
}
.cvpd-media-dialog::backdrop { background: #211c16cc; }
.cvpd-viewer-top,.cvpd-viewer-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cvpd-viewer-top h3 { margin: 0; font-size: 18px; }
.cvpd-media-dialog button { min-height: 44px; border: 1px solid #cfc3b4; border-radius: 4px; background: #faf8f3; color: #25221e; cursor: pointer; }
.cvpd-viewer-top button { width: 44px; font-size: 24px; }
.cvpd-viewer-nav { margin-top: 12px; font-size: 13px; }
.cvpd-viewer-nav button:disabled { opacity: .4; cursor: default; }
.cvpd-viewer-content { display: grid; place-items: center; margin-top: 10px; background: #25221e; min-height: 72px; }
.cvpd-viewer-content :is(img,video) { display: block; width: auto; max-width: 100%; max-height: min(65vh, 760px); max-height: min(65dvh, 760px); object-fit: contain; }
.cvpd-viewer-content .cvpd-viewer-play { padding: 0 0 10px; min-width: 110px; overflow: hidden; }
.cvpd-viewer-play img { margin: 0 0 10px; }

/* Recommendations retain their square canvas, price and native links. */
.cvpd-related--corridor .cvpd-rail-frame .cvpd-related-grid { scrollbar-width: none; }
.cvpd-related--corridor .cvpd-related-image { position: relative; overflow: hidden; }
.cvpd-related--corridor .cvpd-related-image .cvpd-related-hover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover !important;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
	.cvpd-related-image:hover .cvpd-related-hover,
	.cvpd-related-image:focus-visible .cvpd-related-hover { opacity: 1; }
}

/* Keep the label, author identity and biography in three distinct rows. */
.cvpd-page .cvpd-artist-inner {
	width: min(100%, 920px);
	margin-inline: auto;
}
.cvpd-page .cvpd-artist-label {
	margin: 0 0 clamp(16px, 2.2vw, 30px);
	font-size: 13px;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.cvpd-page .cvpd-artist-identity {
	display: grid;
	grid-template-columns: minmax(0, clamp(15rem, 24vw, 24rem)) minmax(0, 21rem);
	gap: clamp(20px, 3vw, 48px);
	width: 100%;
	margin-inline: auto;
}
.cvpd-page .cvpd-artist-media {
	width: 100%;
	height: auto;
	aspect-ratio: 4/3;
	margin: 0;
	overflow: hidden;
	border-radius: 12px;
}
.cvpd-page .cvpd-artist-media img { width: 100%; height: 100% !important; object-fit: contain; filter: none; }
.cvpd-page .cvpd-artist-meta { min-width: 0; text-align: start; overflow-wrap: anywhere; }
.cvpd-page .cvpd-artist-bio { display: block; overflow: visible; margin: clamp(20px, 3vw, 34px) auto 0; max-width: 70ch; line-height: 1.7; }
.cvpd-artist-bio p:first-child { margin-top: 0; }
.cvpd-artist-bio p:last-child { margin-bottom: 0; }
.cvpd-page .cvpd-artist.is-collapsible:not(.is-expanded) .cvpd-artist-bio {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--cvpd-artist-lines-desktop, 2);
}
.cvpd-page .cvpd-artist-toggle { width: auto; height: auto; min-height: 44px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* Canvas comparison images and the original-size viewer. */
#cvpd-size-guide { scroll-margin-top: calc(var(--cvlh-height-desktop, 90px) + 14px); }
.cvpd-canvas-scale { margin: 0 0 26px; padding-bottom: 22px; border-bottom: 1px solid #25221e22; }
.cvpd-page .cvpd-canvas-tabs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
}
.cvpd-page .cvpd-canvas-tabs[hidden],
.cvpd-scale-scroll [hidden] { display: none; }
.cvpd-page .cvpd-canvas-tabs .cvpd-scene-tab {
	min-height: 44px;
	width: 100%;
	padding: 8px;
	border-radius: 4px;
	font-size: 12px;
}
.cvpd-scale-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cvpd-scale-note { margin: 8px 0; color: #665c51; font-size: 13px; line-height: 1.5; }
.cvpd-page .cvpd-scale-open {
	flex: none;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--cvpd-ink);
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.cvpd-canvas-tabs button:focus-visible,
.cvpd-scale-open:focus-visible,
.cvpd-scale-zoom:focus-visible { outline: 2px solid var(--cvpd-ink); outline-offset: 3px; }
.cvpd-scale-scroll {
	overflow: hidden;
	border: 1px solid #ded6ca;
	border-radius: 8px;
	background: var(--cvpd-bg);
}
.cvpd-scale-scroll img { display: block; width: 100%; height: auto; }
.cvpd-scale-dialog {
	width: min(1160px, calc(100% - 16px));
	padding: clamp(10px, 2.5vw, 22px);
	overscroll-behavior: contain;
}
.cvpd-scale-zoom {
	margin-top: 10px;
	max-height: 72vh;
	overflow: auto;
	overscroll-behavior: contain;
}
.cvpd-scale-zoom img { display: block; width: 100%; min-width: 680px; max-width: none; height: auto; }
.cvpd-scale-dialog-hint { display: none; }
@media (max-width: 740px) {
	.cvpd-scale-dialog-hint { display: block; margin: 8px 0 0; font-size: 13px; }
}
/* Bottom placement follows the existing viewport trigger. */
.cvpd-page .cvpd-sticky-purchase {
	bottom: max(10px, env(safe-area-inset-bottom));
	background: #faf8f3;
	border: 1px solid #25221e26;
	box-shadow: 0 6px 24px #25221e25;
	border-radius: 8px;
	backdrop-filter: none;
}
.cvpd-page .cvpd-sticky-purchase-inner {
	grid-template-columns: minmax(0,1fr) auto auto;
	gap: 18px;
	min-height: 72px;
	padding: 8px 14px;
}
.cvpd-page .cvpd-sticky-thumb { flex-basis: 50px; width: 50px; height: 50px; padding: 0; border-radius: 5px; overflow: hidden; }
.cvpd-page .cvpd-sticky-price { display: block; white-space: nowrap; font-size: clamp(14px,1.5vw,19px); }
.cvpd-page .cvpd-sticky-button { min-width: 144px; min-height: 44px; padding: 7px 18px; border-radius: 5px; background: #201e1b; color: #fff; }
.cvpd-page .cvpd-sticky-button:disabled { opacity: .58; cursor: default; }
.cvpd-page .cvpd-sticky-purchase.is-canvas-overlap { transition: none; }
body:has(dialog[open]) .cvpd-page .cvpd-sticky-purchase.is-visible { visibility: hidden; pointer-events: none; transition: none; }
body:has(.cvpd-sticky-purchase.is-visible):not(:has(dialog[open])) .cvc-launch {
	bottom: max(96px,calc(var(--cvpd-sticky-height, 86px) + 24px + env(safe-area-inset-bottom)));
}
.cvpd-summary .cvpd-product-meta { margin-top: clamp(18px, 2vw, 28px); overflow-wrap: anywhere; }

@media (max-width: 820px) {
	#cvpd-size-guide { scroll-margin-top: calc(var(--cvlh-height-mobile, 74px) + 12px); }
}

@media (max-width: 650px) {
	.cvpd-media-rail { grid-auto-columns: min(75%, 255px); }
	.cvpd-rail-controls button { width: 40px; height: 40px; }
	.cvpd-page .cvpd-artist-identity { grid-template-columns: minmax(0, 1fr); gap: 15px; width: min(100%, 22rem); }
	.cvpd-page .cvpd-artist-meta { text-align: center; }
	.cvpd-page .cvpd-artist.is-collapsible:not(.is-expanded) .cvpd-artist-bio { -webkit-line-clamp: var(--cvpd-artist-lines-mobile, 3); }
	.cvpd-page .cvpd-sticky-purchase { inset-inline: 0; bottom: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
	.cvpd-page .cvpd-sticky-purchase-inner { gap: 8px; min-height: 65px; padding-inline: 10px; }
	.cvpd-page .cvpd-sticky-thumb { display: none; }
	.cvpd-page .cvpd-sticky-copy strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; font-size: 11px; }
	.cvpd-page .cvpd-sticky-price { font-size: 14px; }
	.cvpd-page .cvpd-sticky-button { min-width: 105px; padding-inline: 8px; font-size: 11px; }
	.cvpd-related--corridor .cvpd-rail-frame .cvpd-related-card { flex-basis: min(68%, 245px) !important; }
}
@media (prefers-reduced-motion: reduce) {
	.cvpd-related-hover { transition: none !important; }
}
