/* ReInk: from designer-preview/css/review-modal.css @ 827d893 (oldDesigner-redesign). Everything below this line is that file,
   unchanged. When the prototype changes it, carry the change across: docs/syncing.md. */
/*
 * designer-preview/css/review-modal.css
 *
 * The "Review your design" window (Add To Cart, and the zoom bar's Preview eye).
 * js/review-modal.js rearranges the engine's preview window and adds class "smReview" to #previewDiv;
 * everything here is scoped to that class, so without the script the engine's window is unchanged.
 *
 *   window    centred, at most 1040 x 640 (was the whole screen less 20px), 12px corners
 *   left      the design on a light grey stage, with Front / Back buttons for a multi-page design
 *   right     title, what to double-check, one approval checkbox, Add To Cart, Edit my design, X
 *
 * Colours come from the facelift and Studio Pro tokens (css/facelift.css, css/premium.css).
 *
 * The facelift keeps the engine's other windows square, because a rounded corner lets a click there
 * reach #mui-overlay, which closes the window. This window is smaller than the screen, so a click
 * outside it closes it anyway, and its corners are rounded.
 */

/* ---- The window ---- */
/* the engine's white .modalEl box sits behind #previewDiv; with a smaller window it must not show */
.modalEl:has(> #previewDiv.smReview) {
	min-width: 0;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}
#previewDiv.smReview {
	inset: 0;
	margin: auto;
	width: min(1040px, calc(100vw - 48px));
	height: min(640px, calc(100vh - 48px));
	padding: 0;
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	border-radius: 12px;
	background: var(--sm-surface, rgb(255 255 255));
	color: var(--sm-ink-2, rgb(31 28 28));
	text-align: left;
}
#previewDiv.smReview:focus { outline: none; }
#previewDiv.smReview:focus-visible { outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 2px; }

/* ---- Left: the design ---- */
.smReview .smReviewStage {
	min-width: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 48px;
	background: rgb(243 244 246);
}
.smReview .previewImageContainer,
.smReview .previewImageContainerMulti {
	position: relative;
	flex: 1 1 0;
	min-height: 0;
	width: 100% !important;    /* the engine sizes the multi-page box inline */
	height: auto !important;
	max-width: none;
	max-height: none;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
#previewDiv.smReview .templateThumbnail,
#previewDiv.smReview .templateThumbnailMulti {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0;
	border: 0;
	background-color: rgb(255 255 255);
	box-shadow: 0 0 0 1px rgb(16 24 40 / 0.06), 0 2px 4px rgb(16 24 40 / 0.06), 0 16px 40px -8px rgb(16 24 40 / 0.22);
}
/* a page of a multi-page proof is centred by its inset 0 and auto margins (the rule above sets margin 0 for both kinds) */
#previewDiv.smReview .templateThumbnailMulti { margin: auto; }
/* a round product: its proof (the square around the cut circle, cropped to the trim) shown as the circle that is cut */
#previewDiv.smReview.smReviewRound .templateThumbnail,
#previewDiv.smReview.smReviewRound .templateThumbnailMulti { border-radius: 50%; }
/* multi-page: one page at a time, chosen with the buttons below (the engine offsets them in a stack) */
.smReview .templateThumbnailMulti {
	display: none;
	position: absolute;
	top: 0 !important;
	left: 0 !important;
	right: 0;
	bottom: 0;
	margin: auto;
}
.smReview .templateThumbnailMulti.smReviewShown { display: block; }

.smReview .smReviewPages {
	flex: none;
	display: inline-flex;
	padding: 0;
	border-radius: 8px;
	background: rgb(255 255 255);
	box-shadow: inset 0 0 0 1px rgb(176 181 190);
}
#previewDiv.smReview .smReviewPages a {
	min-width: 72px;
	padding: 9px 16px;
	border-radius: 8px;
	color: var(--sm-ink, rgb(4 0 0));
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
#previewDiv.smReview .smReviewPages a:hover { background-color: rgb(16 24 40 / 0.05); color: var(--sm-ink, rgb(4 0 0)); }
#previewDiv.smReview .smReviewPages a[aria-pressed="true"] {
	background-color: var(--sm-red-tint, rgb(234 0 41 / 0.06));
	box-shadow: inset 0 0 0 2px var(--sm-red, rgb(234 0 41));
	color: var(--sm-red-press, rgb(176 0 31));
}
#previewDiv.smReview .smReviewPages a:focus-visible { outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 2px; }

/* ---- Right: the review ---- */
.smReview .smReviewPanel {
	position: relative;
	min-width: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.smReview .smReviewClose {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: none;
	color: var(--sm-ink, rgb(4 0 0));
	cursor: pointer;
}
.smReview .smReviewClose:hover { background-color: rgb(16 24 40 / 0.06); }
.smReview .smReviewClose:active { background-color: rgb(16 24 40 / 0.10); }
.smReview .smReviewClose:focus-visible { outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 0; }

.smReview .smReviewBody {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 44px 32px 24px;
}
#previewDiv.smReview h1 {
	margin: 0 44px 10px 0;
	color: var(--sm-ink, rgb(4 0 0));
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-align: left;
}
.smReview .smReviewLead {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.5;
}
.smReview .smReviewList {
	margin: 0;
	padding: 0 0 0 20px;
	list-style: disc;
}
.smReview .smReviewList li {
	margin: 8px 0 0;
	padding-left: 4px;
	font-size: 15px;
	line-height: 1.45;
}
.smReview .smReviewList li::marker { color: var(--sm-ink-3, rgb(84 87 92)); }
/* the safe-area notice: something reaches past the product's margin */
.smReview .smReviewWarn { margin: 0 0 14px; padding: 10px 12px 8px; border: 1px solid rgb(240 200 90); border-radius: 8px; background: rgb(255 246 220); color: var(--sm-ink-2, rgb(31 28 28)); font-size: 13px; line-height: 18px; }
.smReview .smReviewWarn strong { color: var(--sm-ink, rgb(4 0 0)); }
.smReview .smReviewWarnList { margin: 6px 0 6px 18px; padding: 0; }
.smReview .smReviewWarnList li { margin: 0 0 2px; }
.smReview .smReviewWarnEnd { margin: 0; }
@media (forced-colors: active) { .smReview .smReviewWarn { border-color: CanvasText; } }

.smReview .smReviewFooter {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 32px 24px;
	border-top: 1px solid var(--sm-hairline, rgb(228 230 234));
}
/* the one approval checkbox (#confirm1; #confirm2 is hidden and follows it) */
#previewDiv.smReview .previewDisclaimerContainer {
	width: auto;
	float: none;
	margin: 0 -12px;
	padding: 10px 12px;
	border-radius: 8px;
	text-align: left;
	background-color: transparent !important;   /* the engine tints it on a refused click; .smReviewMissing shows that */
	box-shadow: none;
}
#previewDiv.smReview .previewDisclaimer {
	max-width: none;
	padding: 0;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	color: var(--sm-ink, rgb(4 0 0));
	font-size: 15px;
	line-height: 1.45;
}
#previewDiv.smReview .previewDisclaimer[hidden] { display: none; }
#previewDiv.smReview .previewDisclaimer input[type="checkbox"] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--sm-red, rgb(234 0 41));
	cursor: pointer;
}
#previewDiv.smReview .previewDisclaimer input[type="checkbox"]:focus-visible { outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 2px; }
#previewDiv.smReview .previewDisclaimer label { padding: 0; cursor: pointer; }
#previewDiv.smReview.smReviewMissing .previewDisclaimerContainer {
	background-color: var(--sm-red-tint, rgb(234 0 41 / 0.06)) !important;
	box-shadow: inset 0 0 0 1px rgb(234 0 41 / 0.45);
}
.smReview .smReviewNeeded {
	margin: -4px 0 0;
	color: var(--sm-red-text, rgb(207 0 36));
	font-size: 14px;
	line-height: 1.4;
}
.smReview .smReviewNeeded[hidden] { display: none; }

/* Add To Cart (the engine's button): full width, icon and words on one line */
#previewDiv.smReview .previewAddToCartButton {
	width: 100%;
	height: 48px;
	min-width: 0;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-image: none;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background-color: var(--sm-red, rgb(234 0 41));
	background-image: none;
	box-shadow: none;
	color: var(--sm-on-red, rgb(255 255 255));
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
}
#previewDiv.smReview .previewAddToCartButton:hover { background-color: var(--sm-red-hover, rgb(207 0 36)); }
#previewDiv.smReview .previewAddToCartButton:active { background-color: var(--sm-red-press, rgb(176 0 31)); }
#previewDiv.smReview .previewAddToCartButton:focus-visible { border-image: none; outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 2px; }
#previewDiv.smReview .previewAddToCartButton br { display: none; }
#previewDiv.smReview .previewAddToCartButton .material-icons { flex: none; width: 22px; height: 22px; font-size: 0; background-size: 22px 22px; }
#previewDiv.smReview .previewAddToCartButton .mui-btn__ripple-container { border-radius: 8px; }

/* Edit my design (the engine's Close button): white with a thin grey outline */
#previewDiv.smReview .smReviewEdit {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-image: none;
	border-radius: 8px;
	background-color: rgb(255 255 255);
	background-image: none;
	box-shadow: inset 0 0 0 1px rgb(176 181 190);
	color: var(--sm-ink, rgb(4 0 0));
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
}
#previewDiv.smReview .smReviewEdit:hover { background-color: rgb(16 24 40 / 0.04); box-shadow: inset 0 0 0 1px rgb(134 140 150); }
#previewDiv.smReview .smReviewEdit:active { background-color: rgb(16 24 40 / 0.08); }
#previewDiv.smReview .smReviewEdit:focus-visible { outline: 2px solid var(--sm-ink, rgb(4 0 0)); outline-offset: 2px; }
#previewDiv.smReview .smReviewEdit .mui-btn__ripple-container { border-radius: 8px; }

/* ---- Narrow screens: the design above the review, the window scrolls ---- */
@media (max-width: 760px) {
	#previewDiv.smReview {
		inset: 12px;
		width: auto;
		height: auto;
		overflow: auto;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(180px, 36vh) auto;
	}
	.smReview .smReviewStage { padding: 24px 16px; gap: 16px; }
	.smReview .smReviewBody { flex: none; overflow: visible; padding: 28px 20px 16px; }
	.smReview .smReviewFooter { padding: 16px 20px 20px; }
	#previewDiv.smReview h1 { font-size: 24px; }
	.smReview .smReviewClose { top: 8px; right: 8px; }
	/* the close button sits over the design on a phone: give it a white disc, and keep it above the
	   pages of a two-sided design (the engine raises the shown page with an inline z-index of 3) */
	.smReview .smReviewPanel { position: static; }
	.smReview .smReviewClose { z-index: 4; background-color: rgb(255 255 255); box-shadow: 0 1px 3px rgb(16 24 40 / 0.2); }
}

/* ---- Windows High Contrast ---- */
@media (forced-colors: active) {
	#previewDiv.smReview { border: 1px solid CanvasText; }
	.smReview .smReviewStage { background: Canvas; border-right: 1px solid CanvasText; }
	.smReview .smReviewPages,
	#previewDiv.smReview .smReviewEdit,
	#previewDiv.smReview .previewAddToCartButton,
	.smReview .smReviewClose { border: 1px solid ButtonText; }
	#previewDiv.smReview .smReviewPages a[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
	#previewDiv.smReview .previewAddToCartButton .material-icons { background-image: none; font-size: 22px; color: ButtonText; }
	#previewDiv.smReview.smReviewMissing .previewDisclaimerContainer { border: 2px solid Mark; }
}
