/* Crop & Wall Preview: the crop panel. Scoped under the modal so theme styles don't win. */

#sunshine--modal .sunshine-crop-wall {
	font-size: 15px;
	margin: 15px 0;
	text-align: left;
}

/* Many photos at once get the automatic crop, so the panel stays out of the way. */
#sunshine--image--add-to-cart[data-bulk-mode] .sunshine-crop-wall {
	display: none;
}

#sunshine--modal .sunshine-crop-wall [hidden] {
	display: none !important;
}

/* Tabs */
#sunshine--modal .sunshine-crop-wall--tabs {
	display: flex;
	gap: 4px;
	margin: 0 0 10px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

#sunshine--modal .sunshine-crop-wall--tabs button.sunshine-crop-wall--tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	letter-spacing: normal;
	line-height: 1.4;
	margin: 0 0 -1px;
	opacity: 0.7;
	padding: 8px 12px;
	text-decoration: none;
	text-transform: none;
	width: auto;
}

#sunshine--modal .sunshine-crop-wall--tabs button.sunshine-crop-wall--tab:hover,
#sunshine--modal .sunshine-crop-wall--tabs button.sunshine-crop-wall--tab:focus-visible {
	background: none;
	opacity: 1;
}

#sunshine--modal .sunshine-crop-wall--tabs button.sunshine-crop-wall--tab-active {
	border-bottom-color: currentColor;
	font-weight: bold;
	opacity: 1;
}

/* Crop area */
#sunshine--modal .sunshine-crop-wall--stage {
	background: rgba(0, 0, 0, 0.05);
	height: 340px;
	/* Shorter on short screens, so Add to cart still shows without scrolling. The product
	   window is 80% of the screen tall; the title, choices and button take about 440px, more
	   with a theme's bigger text, so leave some extra. */
	max-height: max(160px, calc(80vh - 460px));
	overflow: hidden;
	position: relative;
	width: 100%;
}

/* A swipe on the photo scrolls the window. Only the crop box and its handles keep the touch. */
#sunshine--modal .sunshine-crop-wall--stage .cropper-container,
#sunshine--modal .sunshine-crop-wall--stage .cropper-drag-box,
#sunshine--modal .sunshine-crop-wall--stage .cropper-canvas {
	touch-action: pan-y;
}

#sunshine--modal .sunshine-crop-wall--stage .cropper-crop-box {
	touch-action: none;
}

/* Leave room to scroll down to Add to cart on a phone. */
@media (max-width: 600px) {
	#sunshine--modal .sunshine-crop-wall--stage {
		height: 260px;
		max-height: 40vh;
	}
}

#sunshine--modal .sunshine-crop-wall--stage img.sunshine-crop-wall--image {
	display: block;
	height: auto;
	max-width: 100%;
}

/* A row of choices, like Portrait / Landscape or the rooms. One look for all of them. */
#sunshine--modal .sunshine-crop-wall--choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
}

#sunshine--modal .sunshine-crop-wall--choices button.sunshine-crop-wall--choice {
	align-items: center;
	appearance: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 3px;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	flex-direction: column;
	font-family: inherit;
	font-size: 15px;
	font-weight: normal;
	letter-spacing: normal;
	line-height: 1.3;
	margin: 0;
	min-width: 110px;
	padding: 8px 14px;
	text-decoration: none;
	text-shadow: none;
	text-transform: none;
	width: auto;
}

#sunshine--modal .sunshine-crop-wall--choices button.sunshine-crop-wall--choice:hover,
#sunshine--modal .sunshine-crop-wall--choices button.sunshine-crop-wall--choice:focus-visible {
	background: #fff;
	border-color: currentColor;
	color: inherit;
}

#sunshine--modal .sunshine-crop-wall--choices button.sunshine-crop-wall--choice-active {
	border: 2px solid currentColor;
	font-weight: bold;
	padding: 7px 13px;
}

#sunshine--modal .sunshine-crop-wall--choice-detail {
	font-size: 13px;
	font-weight: normal;
	opacity: 0.7;
}

#sunshine--modal .sunshine-crop-wall--size {
	font-size: 15px;
	margin: 10px 0 0;
	opacity: 0.7;
}

#sunshine--modal .sunshine-crop-wall--note {
	font-size: 13px;
	line-height: 1.4;
	margin: 8px 0 0;
	opacity: 0.8;
}

#sunshine--modal .sunshine-crop-wall--soft {
	font-weight: bold;
}

/* Photo wrap: the front is the dashed box, the sides around it are shaded. */
#sunshine--modal .sunshine-crop-wall--edges {
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
}

#sunshine--modal .sunshine-crop-wall--face {
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
	outline: 2px dashed rgba(255, 255, 255, 0.9);
	outline-offset: -1px;
	position: absolute;
}

/* Cart: each crop shows a picture of what prints, its label and Adjust crop. */
#sunshine--cart--items .sunshine-crop-wall--cart .sunshine-crop-wall--cart-part {
	margin: 8px 0 0;
}

#sunshine--cart--items .sunshine-crop-wall--cart .sunshine-crop-wall--cart-part-name {
	font-weight: bold;
}

#sunshine--cart--items .sunshine-crop-wall--cart .sunshine-crop-wall--thumb {
	border: 0;
	display: block;
	margin: 4px 0;
	overflow: hidden;
	padding: 0;
}

/* The picture is placed by its inline size and margins, so anything a theme adds to images
   (padding, borders, rounded corners) would shift it off the crop. */
#sunshine--cart--items .sunshine-crop-wall--cart .sunshine-crop-wall--thumb img {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	display: block;
	padding: 0;
}

/* Buttons don't take the page's font on their own, so match the theme's text around it. */
#sunshine--cart--items .sunshine-crop-wall--cart button.sunshine--button-link {
	font-family: inherit;
	font-size: inherit;
	margin-left: 4px;
	text-decoration: underline;
}

/* Same look as core's product title, not the theme's heading color or caps. */
#sunshine--modal .sunshine-crop-wall--adjust h2 {
	color: var(--sunshine--dark);
	text-transform: none;
	font-size: 20px;
	font-weight: bold;
	line-height: 1.3;
	margin: 0 0 10px;
}

#sunshine--modal .sunshine-crop-wall--adjust-actions {
	margin: 15px 0 0;
}
