.cc-fs-dialog:not([open]):not(:target),
.cc-fs-dialog [hidden] {
	display: none !important;
}

body.cc-fs-product-page .wp-block-woocommerce-product-image-gallery {
	aspect-ratio: 1 / 1 !important;
}

.cc-fs-launch {
	width: 100%;
	grid-column: 1 / -1;
}

.cc-fs-form {
	min-height: 0;
	gap: 0;
	border: 0;
	background: #fff;
}

.cc-fs-dialog > p:empty,
.cc-fs-form > p:empty,
.cc-fs-form > header > p:empty,
.cc-fs-form > br,
.cc-fs-form > header > br {
	display: none;
}

.cc-fs-native-purchase {
	position: fixed !important;
	inset: auto !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	overflow: hidden !important;
	opacity: 0 !important;
}

.cc-fs-preview {
	justify-content: center;
	touch-action: auto;
}

.cc-fs-preview-tools {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.cc-fs-stage {
	position: relative;
	display: flex;
	width: 280px;
	height: 560px;
	max-width: 100%;
	max-height: none;
	aspect-ratio: 1 / 2;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid #cfd9d5;
	background: #fff;
	box-shadow: 0 4px 22px rgb(30 41 37 / 12%);
	isolation: isolate;
	flex: 0 0 auto;
	touch-action: auto;
}

.cc-fs-stage.has-artwork {
	touch-action: none;
}

.cc-fs-stage[data-size="half"] {
	aspect-ratio: 1 / 1;
}

.cc-fs-stage::after {
	position: absolute;
	z-index: 5;
	inset: 0;
	border: 1px solid rgb(47 125 113 / 18%);
	box-shadow: inset 0 0 24px rgb(30 41 37 / 4%);
	pointer-events: none;
	content: "";
}

.cc-fs-preview-empty {
	position: relative;
	z-index: 1;
	display: flex;
	width: min(220px, calc(100% - 30px));
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 8px;
	color: #68716e;
	text-align: center;
}

.cc-fs-preview-empty .dashicons {
	width: 32px;
	height: 32px;
	color: #2f7d71;
	font-size: 32px;
}

.cc-fs-preview-empty strong {
	font-size: 13px;
	font-weight: 550;
}

.cc-fs-dimension {
	position: absolute;
	z-index: 8;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #49534f;
	font-size: 10px;
	pointer-events: none;
}

.cc-fs-dimension b {
	position: relative;
	z-index: 1;
	padding: 1px 5px;
	background: rgb(255 255 255 / 94%);
	font-weight: 550;
	white-space: nowrap;
}

.cc-fs-width {
	top: 6px;
	left: 8%;
	right: 8%;
	border-top: 1px solid #7d8985;
}

.cc-fs-width::before,
.cc-fs-width::after {
	position: absolute;
	top: -3px;
	width: 5px;
	height: 5px;
	border-top: 1px solid #7d8985;
	content: "";
}

.cc-fs-width::before {
	left: 0;
	transform: rotate(-45deg);
}

.cc-fs-width::after {
	right: 0;
	transform: rotate(45deg);
}

.cc-fs-height {
	top: 8%;
	right: 7px;
	bottom: 8%;
	border-right: 1px solid #7d8985;
}

.cc-fs-height b {
	transform: rotate(90deg);
}

.cc-fs-height::before,
.cc-fs-height::after {
	position: absolute;
	right: -3px;
	width: 5px;
	height: 5px;
	border-right: 1px solid #7d8985;
	content: "";
}

.cc-fs-height::before {
	top: 0;
	transform: rotate(-45deg);
}

.cc-fs-height::after {
	bottom: 0;
	transform: rotate(45deg);
}

.cc-fs-photo-layer {
	--photo-x: 50%;
	--photo-y: 50%;
	--photo-scale: 1;
	position: absolute;
	z-index: 2;
	left: var(--photo-x);
	top: var(--photo-y);
	width: 80%;
	height: auto;
	transform: translate(-50%, -50%) scale(var(--photo-scale));
	transform-origin: center;
	border: 1px solid #2f7d71;
	cursor: move;
	outline: 0;
	touch-action: none;
	user-select: none;
}

.cc-fs-photo-layer:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2f7d71;
}

.cc-fs-photo-preview {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	pointer-events: none;
	user-select: none;
}

.cc-fs-photo-resize {
	position: absolute;
	z-index: 5;
	width: 15px;
	height: 15px;
	padding: 0;
	border: 1px solid #fff;
	border-radius: 2px;
	background: #2f7d71;
	box-shadow: 0 1px 3px rgb(30 41 37 / 22%);
	cursor: nwse-resize;
	touch-action: none;
}

.cc-fs-photo-resize.is-top-left { top: -8px; left: -8px; }
.cc-fs-photo-resize.is-top-right { top: -8px; right: -8px; cursor: nesw-resize; }
.cc-fs-photo-resize.is-bottom-left { bottom: -8px; left: -8px; cursor: nesw-resize; }
.cc-fs-photo-resize.is-bottom-right { right: -8px; bottom: -8px; }

.cc-fs-safe-frame {
	position: absolute;
	z-index: 4;
	inset: 5%;
	border: 1px dashed #7d8985;
	pointer-events: none;
}

.cc-fs-dialog.is-contour-cut .cc-fs-safe-frame {
	inset: 8%;
	border-width: 2px;
	border-color: #2f7d71;
	border-radius: 22% 14% 20% 16% / 10% 22% 14% 24%;
}

.cc-fs-cut-label {
	position: absolute;
	z-index: 7;
	left: 50%;
	bottom: 10px;
	max-width: calc(100% - 28px);
	padding: 3px 7px;
	transform: translateX(-50%);
	border-radius: 3px;
	background: rgb(255 255 255 / 94%);
	color: #59635f;
	font-size: 10px;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	pointer-events: none;
}

.cc-fs-reset-photo {
	position: absolute;
	z-index: 9;
	right: 10px;
	top: 25px;
	display: inline-flex;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid #dce4e0;
	border-radius: 5px;
	background: rgb(255 255 255 / 94%);
	color: #303735;
	cursor: pointer;
}

.cc-fs-reset-photo .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.cc-fs-preview-file {
	position: fixed !important;
	inset: auto !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	overflow: hidden !important;
	opacity: 0 !important;
}

.cc-fs-preview-note {
	max-width: 460px;
	line-height: 1.45;
	text-align: center;
}

.cc-fs-controls > fieldset,
.cc-fs-controls > section {
	margin: 0 0 18px;
	padding: 0 0 18px;
	border-bottom: 1px solid #dce4e0;
}

.cc-fs-controls > :last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.cc-fs-dialog fieldset > legend small {
	margin-left: 4px;
	color: #68716e;
	font-size: 12px;
	font-weight: 400;
}

.cc-fs-size select {
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 38px 0 12px;
	border: 1px solid #dce4e0;
	border-radius: 5px;
	background-color: #fff;
	color: #303735;
	box-shadow: none;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.cc-fs-size select:focus,
.cc-fs-contact input:focus,
.cc-fs-notes textarea:focus {
	border-color: #2f7d71 !important;
	outline: 0;
	box-shadow: 0 0 0 2px rgb(47 125 113 / 12%);
}

.cc-fs-upload > p,
.cc-fs-contact > p {
	margin: 8px 0 0;
	color: #68716e;
	font-size: 11px;
	line-height: 1.45;
}

.cc-fs-drop {
	min-height: 132px;
}

.cc-fs-file-name {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-top: 9px;
	padding: 10px 12px;
	border: 1px solid #b9d7cf;
	border-radius: 5px;
	background: #eff6f3;
	color: #303735;
}

.cc-fs-file-name > .dashicons { color: #2f7d71; }
.cc-fs-file-name span:last-child { display: grid; min-width: 0; }
.cc-fs-file-name strong,
.cc-fs-file-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-fs-file-name strong { font-size: 13px; font-weight: 550; }
.cc-fs-file-name small { color: #68716e; font-size: 11px; }

.cc-fs-choice-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px;
}

.cc-fs-choice-grid label {
	position: relative;
	display: flex;
	min-height: 92px;
	gap: 10px;
	padding: 12px;
	border: 1px solid #dce4e0;
	border-radius: 6px;
	cursor: pointer;
}

.cc-fs-choice-grid label:has(:checked) {
	border-color: #2f7d71;
	background: #eff6f3;
	box-shadow: inset 0 0 0 1px #2f7d71;
}

.cc-fs-choice-grid input {
	margin: 3px 0 0;
	accent-color: #2f7d71;
}

.cc-fs-choice-grid span { display: grid; align-content: start; gap: 4px; }
.cc-fs-choice-grid strong { font-size: 13px; font-weight: 550; }
.cc-fs-choice-grid small { color: #68716e; font-size: 11px; line-height: 1.4; }

.cc-fs-contact h3 { margin-bottom: 4px; }
.cc-fs-contact > p { margin: 0 0 11px; }
.cc-fs-contact > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cc-fs-contact label { display: grid; gap: 5px; color: #303735; font-size: 12px; font-weight: 500; }
.cc-fs-contact b { color: #b44335; font-weight: 500; }
.cc-fs-contact input {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 7px 10px;
	border: 1px solid #a8b5af !important;
	border-radius: 5px;
	background-color: #f8faf9 !important;
	color: #303735 !important;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.cc-fs-quantity legend,
.cc-fs-notes legend { margin-bottom: 7px; }
.cc-fs-quantity label,
.cc-fs-quantity > p > label { margin: 0; }
.cc-fs-notes textarea {
	display: block;
	width: 100%;
	min-height: 92px;
	margin: 0;
	padding: 10px 12px;
	resize: vertical;
	border: 1px solid #dce4e0;
	border-radius: 5px;
	background: #fff;
	color: #303735;
	box-shadow: none;
	font: inherit;
}

.cc-fs-total { display: flex; align-items: baseline; }

.cc-fs-touch-zoom {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.cc-fs-touch-zoom button,
.cc-fs-preview-toggle {
	min-width: 44px;
	height: 44px;
	padding: 0 10px;
	border: 1px solid #a8b5af;
	border-radius: 5px;
	background: #fff;
	color: #2f7d71;
	cursor: pointer;
}

.cc-fs-touch-zoom button { padding: 0; font-size: 24px !important; }
.cc-fs-touch-zoom output { min-width: 42px; text-align: center; font-size: 12px; }
.cc-fs-preview-toggle { font-size: 13px !important; font-weight: 550; }

@media (max-width: 760px) {
	.cc-fs-dialog { height: 100vh; height: 100dvh; }
	.cc-fs-body {
		display: block;
		min-height: 0;
		flex: 1 1 auto;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior-y: contain;
		-webkit-overflow-scrolling: touch;
	}
	.cc-fs-preview {
		min-height: 0;
		height: auto;
		flex: 0 0 auto;
		padding: 12px;
		border-right: 0;
		border-bottom: 1px solid #dce4e0;
	}
	.cc-fs-stage { width: calc(100vw - 48px); height: calc((100vw - 48px) * 2); max-width: 100%; }
	.cc-fs-stage[data-size="half"] { height: calc(100vw - 48px); }
	.cc-fs-preview-tools { display: flex; flex: 0 0 auto; }
	.cc-fs-controls {
		position: relative;
		min-height: 0;
		flex: 0 0 auto;
		padding: 16px;
		overflow: visible;
	}
	.cc-fs-dialog .cc-fs-upload { margin-bottom: 12px; padding-bottom: 12px; }
	.cc-fs-dialog .cc-fs-upload > legend { margin-bottom: 6px; font-size: 15px; }
	.cc-fs-dialog .cc-fs-drop {
		display: flex;
		min-height: 44px;
		height: auto;
		padding: 8px 12px;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 4px 8px;
	}
	.cc-fs-dialog .cc-fs-drop .cc-yard-drop-icon { width: 20px; height: 20px; margin: 0; font-size: 20px; }
	.cc-fs-dialog .cc-fs-drop .cc-yard-drop-title { font-size: 14px; }
	.cc-fs-dialog .cc-fs-drop .cc-yard-drop-hint { font-size: 10px; }
	.cc-fs-dialog .cc-fs-file-name { margin-top: 5px; padding: 5px 8px; }
	.cc-fs-dialog .cc-fs-upload > p { margin-top: 5px; font-size: 10px; }
	.cc-fs-preview-note { font-size: 10px !important; }
	.cc-fs-contact > div,
	.cc-fs-choice-grid { grid-template-columns: 1fr; }
	.cc-fs-contact input { font-size: 16px; }
	.cc-fs-cut-label { display: none; }
	.cc-fs-dialog.is-preview-expanded .cc-fs-controls,
	.cc-fs-dialog.is-preview-expanded .cc-fs-form > footer { display: none; }
	.cc-fs-dialog.is-preview-expanded .cc-fs-preview { min-height: 100%; height: auto; border-bottom: 0; }
}
