@charset "utf-8";

.product-page-part-container {
	position:relative;
	margin-bottom:10px;
}

.product-page-custom-preview {
	width: 100%;
}

/* hidden while no viewer is present, or once it turned itself off */
.product-page-custom-preview[hidden],
.product-page-custom-preview-update[hidden],
.product-page-custom-reorder[hidden] {
	display: none;
}

/* Update preview: the site's .form-btn, primary (.form-btn-main) while the preview is out of date */
.product-page-custom-preview-update {
	margin-top: 4px;
}

.product-page-custom-preview-note {
	margin: 6px 0 0;
	font-size: 13px;
	color: #5d6d7e;
}

.product-page-custom-preview-note:empty {
	display: none;
}

.product-page-custom-field {
	margin-bottom: 10px;
}

.product-page-custom-form .product-page-custom-input {
	/* 16px keeps phone browsers from zooming into the field */
	font-size: 16px;
	max-width: 100%;
}

.product-page-custom-required {
	color: #c0392b;
}

.product-page-custom-field-note {
	font-size: 13px;
	color: #5d6d7e;
}

.product-page-custom-field-note:empty {
	display: none;
}

.product-page-custom-field-message {
	min-height: 1.2em;
	font-size: 13px;
	color: #c0392b;
}

.product-page-custom-status {
	margin: 8px 0 0;
}

.product-page-custom-status:empty {
	display: none;
}

.product-page-custom-status-error {
	color: #c0392b;
}

.product-page-custom-reorder {
	margin: 8px 0 0;
	overflow-wrap: anywhere;
}

/* The MatterCAD viewer's canvas (the viewer takes its size from here). A one-finger drag on it turns the model
   and never scrolls the page, so on a phone it stays well short of the screen, leaving room to scroll below it. */
.product-page-custom-preview canvas {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: min(420px, 60vh);
	outline: none;
	border:3px solid #F7F9F9;
	margin-bottom:5px;
	border-radius:5px;
}

/* ---- the live 3D preview as the product gallery's first slide (default_product_listing_page.html) ----
   The rule above stays for pages cached with the preview beside the form. In the gallery the slide keeps the
   photos' 4:3 even with no photo, the preview covers it, and the first photo under it shows until the viewer has
   drawn the part (.is-shown, from public-product-page-custom-part.js); the canvas is hidden till then. visibility,
   never display: the viewer takes its size from the canvas's box, which must stay laid out while the slide is off
   screen, and across a resize. */
.mh--gallery-slide-3d {
	position: relative;
	aspect-ratio: 4 / 3;
}

.mh--gallery-slide-3d .product-page-custom-preview {
	/* no z-index: positioned, it paints over the photo in the flow, and the sale badge (z-index 1) stays over it */
	position: absolute;
	inset: 0;
}

/* A one-finger drag on the model turns it and never swipes the gallery (the dots and the rail still move it), and
   the stage is only as tall as a photo, so the page still scrolls from below it. */
.mh--gallery-slide-3d .product-page-custom-preview canvas {
	height: 100%;
	border: 0;
	border-radius: 0;
	margin: 0;
	touch-action: none;
}

.mh--gallery-slide-3d .product-page-custom-preview:not(.is-shown) canvas,
.mh--gallery-slide-3d .product-page-custom-preview.is-shown ~ .mh--gallery-3d-poster {
	visibility: hidden;
}

/* Till the viewer has drawn the part, the photo is dimmed under a spinner and "Loading 3D preview…", so it reads as
   a stand-in for the 3D view to come. It covers the slide, which keeps its 4:3 with no photo too, and comes after the
   preview, so it paints over it with no z-index. pointer-events: none leaves a drag on it the gallery's swipe, as on
   the photo. It goes with the photo, once the preview is .is-shown, and with the slide when there is no viewer. */
.mh--gallery-3d-loading {
	position: absolute;
	inset: 0;
	box-sizing: border-box;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.7); /* the text keeps AA contrast (4.5:1) over a black photo */
	color: #2c3e50;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	pointer-events: none;
}

.mh--gallery-slide-3d .product-page-custom-preview.is-shown ~ .mh--gallery-3d-loading {
	display: none;
}

/* the ring is public-store.css's .large-overlay-spinner:before, centred on this box */
.mh--gallery-3d-loading-spinner {
	position: relative;
	flex: none;
	width: 50px;
	height: 50px;
}

@media (prefers-reduced-motion: reduce) {
	/* a still ring: the text says it is loading */
	.mh--gallery-3d-loading-spinner.large-overlay-spinner:before {
		animation: none;
	}
}

/* The rail's 3D tile: the first photo under a "3D" label, built like the "+N" tile's label (public-store.css). */
.mh--gallery-thumb-3d-label {
	position: absolute;
	inset: 2px; /* inside the thumb's 2px border */
	border-radius: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	pointer-events: none;
}

/* Update preview brings the gallery into view (mhProductGallery.goTo). On a phone the search bar pins over the top
   of the page once it is scrolled (public.css), so the stage stops below it; goTo reads this margin too. */
@media screen and (max-width: 770px) {
	.product-page .mh--gallery-stage {
		scroll-margin-top: calc(var(--top-bar-fixed-height, 0px) + 2 * var(--nav-search-pin-pad-y, 10px) + var(--nav-search-field-height, 40px));
	}
}

.product-page-custom-form {
	width: 100%;
}

.product-page-custom-form input,
.product-page-custom-form label {
	width:100%;
	display:block;
}

.product-page-custom-form form {
	padding: 10px;
	border: 2px solid #F7F9F9;
	border-radius: 5px;
}
