/* Forma studio editor */
:root {
	--forma-ink: #101828;
	--forma-muted: #667085;
	--forma-line: #e4e7ec;
	--forma-paper: #eef1f4;
	--forma-panel: #ffffff;
	--forma-rail: #1d2939;
	--forma-header: #0f766e;
	--forma-accent: #0f766e;
	--forma-accent-hover: #0d9488;
	--forma-font: "Manrope", system-ui, sans-serif;
	--forma-display: "Fraunces", Georgia, serif;
	--forma-rail-w: 78px;
	--forma-panel-w: 300px;
	--forma-top: 56px;
	--forma-save: 40px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body.forma-editor-body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	font-family: var(--forma-font);
	color: var(--forma-ink);
	background: var(--forma-paper);
	-webkit-font-smoothing: antialiased;
}

.forma-app {
	display: grid;
	grid-template-columns: var(--forma-rail-w) var(--forma-panel-w) 1fr;
	grid-template-rows: var(--forma-top) var(--forma-save) 1fr;
	height: 100vh;
	height: 100dvh;
}

.forma-topbar {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 16px 0 12px;
	background: var(--forma-header);
	color: #fff;
	z-index: 30;
}

.forma-topbar-left {
	display: flex;
	align-items: center;
	gap: 18px;
}

.forma-brand {
	text-decoration: none;
	color: inherit;
}

.forma-brand-mark {
	font-family: var(--forma-display);
	font-size: 1.45rem;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.forma-menu button {
	border: 0;
	background: transparent;
	color: rgba(255,255,255,.9);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.forma-menu button:hover { background: rgba(255,255,255,.12); }

.forma-topbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.forma-price {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	min-width: 4.2rem;
	text-align: right;
}

.forma-btn {
	appearance: none;
	border: 0;
	font: inherit;
	font-weight: 700;
	font-size: 0.82rem;
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.forma-btn-primary {
	background: #111827;
	color: #fff;
}

.forma-btn-primary:hover { background: #000; }

.forma-btn-shop {
	background: #115e59;
	color: #fff;
	border: 1px solid rgba(255,255,255,.18);
}

.forma-btn-change {
	width: 100%;
	background: #111827;
	color: #fff;
	margin: 4px 0 16px;
}

.forma-savebar {
	grid-column: 2 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 18px;
	background: #f8fafc;
	border-bottom: 1px solid var(--forma-line);
	font-size: 0.8rem;
	color: var(--forma-muted);
	z-index: 12;
}

.forma-savebar p { margin: 0; }

.forma-link {
	border: 0;
	background: none;
	color: var(--forma-accent);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
}

.forma-save-status { color: var(--forma-accent); font-weight: 700; }

.forma-rail {
	grid-row: 2 / -1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 6px;
	background: var(--forma-rail);
	color: #98a2b3;
	overflow: auto;
}

.forma-rail-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	padding: 10px 4px;
	border-radius: 10px;
	cursor: pointer;
}

.forma-rail-ico { font-size: 1.05rem; line-height: 1; }

.forma-rail-btn:hover,
.forma-rail-btn.is-active {
	background: #344054;
	color: #fff;
}

.forma-panel {
	grid-row: 3;
	background: var(--forma-panel);
	border-right: 1px solid var(--forma-line);
	padding: 18px 16px;
	overflow: auto;
}

.forma-panel-section { display: none; animation: formaIn .22s ease; }
.forma-panel-section.is-active { display: block; }

@keyframes formaIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.forma-panel h2 {
	font-family: var(--forma-display);
	font-size: 1.2rem;
	margin: 0 0 8px;
}

.forma-product-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.forma-chip {
	background: #ecfdf5;
	color: #067647;
	font-size: 0.75rem;
	font-weight: 800;
	padding: 4px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

.forma-panel-desc,
.forma-kicker {
	margin: 0 0 10px;
	font-size: 0.8rem;
	color: var(--forma-muted);
}

.forma-kicker {
	margin-top: 14px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: 0.68rem;
}

.forma-color-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 8px;
}

.forma-swatch {
	aspect-ratio: 1;
	border-radius: 50%;
	border: 2px solid transparent;
	box-shadow: inset 0 0 0 1px rgba(16,24,40,.15);
	cursor: pointer;
	padding: 0;
}

.forma-swatch.is-active {
	border-color: var(--forma-accent);
	box-shadow: 0 0 0 3px rgba(15,118,110,.2);
}

.forma-qty-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.forma-qty-grid label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.72rem;
	font-weight: 800;
	color: var(--forma-muted);
}

.forma-qty-grid input {
	width: 100%;
	border: 1px solid var(--forma-line);
	border-radius: 8px;
	padding: 8px;
	font: inherit;
}

.forma-formula {
	margin: 16px 0 0;
	font-size: 0.75rem;
	color: var(--forma-muted);
}

.forma-subtabs {
	display: flex;
	gap: 4px;
	margin-bottom: 12px;
}

.forma-subtabs button {
	flex: 1;
	border: 0;
	background: #f2f4f7;
	border-radius: 8px;
	padding: 8px;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
}

.forma-subtabs button.is-active {
	background: #111827;
	color: #fff;
}

.forma-media-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.forma-media-grid button,
.forma-clip-card,
.forma-shape-card,
.forma-tpl {
	border: 1px solid var(--forma-line);
	border-radius: 10px;
	background: #f8fafc;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	min-height: 84px;
	font: inherit;
}

.forma-media-grid img {
	width: 100%;
	height: 84px;
	object-fit: cover;
	display: block;
}

.forma-clip-grid,
.forma-shape-grid {
	grid-template-columns: repeat(3, 1fr);
}

.forma-clip-card,
.forma-shape-card {
	min-height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
	background: #fff;
}

.forma-tpl {
	padding: 12px 8px;
	text-align: center;
	font-weight: 800;
	font-size: 0.78rem;
	line-height: 1.2;
}

.forma-text-presets {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.forma-text-presets button {
	border: 1px solid var(--forma-line);
	background: #fff;
	border-radius: 10px;
	padding: 12px;
	cursor: pointer;
	text-align: center;
}

.forma-field { margin-bottom: 12px; }
.forma-field label {
	display: block;
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--forma-muted);
	margin-bottom: 6px;
}
.forma-field input[type="range"] { width: 100%; }
.forma-field input[type="color"] {
	width: 100%;
	height: 40px;
	border: 1px solid var(--forma-line);
	border-radius: 8px;
	background: #fff;
}

.forma-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 140px;
	padding: 16px;
	border: 1.5px dashed #c5cdd6;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	text-align: center;
}
.forma-drop.is-drag,
.forma-drop:hover { border-color: var(--forma-accent); background: #f0fdfa; }
.forma-drop-title { font-weight: 800; }
.forma-drop-hint { font-size: 0.75rem; color: var(--forma-muted); }

.forma-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.forma-layers li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid var(--forma-line);
	border-radius: 10px;
	font-size: 0.85rem;
	cursor: pointer;
}
.forma-layers li.is-active { border-color: var(--forma-accent); background: #f0fdfa; }
.forma-layers .forma-empty { justify-content: center; color: var(--forma-muted); cursor: default; border-style: dashed; }
.forma-layers button { border: 0; background: none; color: #b42318; cursor: pointer; font-weight: 700; }

.forma-stage {
	grid-row: 3;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-width: 0;
}

.forma-stage-atmosphere {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 50% at 50% 42%, #fff 0%, transparent 70%),
		linear-gradient(180deg, #e8ecf0, #dfe4ea);
	pointer-events: none;
}

.forma-canvas-shell {
	position: relative;
	z-index: 1;
	width: min(78%, 480px);
}

.forma-mockup {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	filter: drop-shadow(0 28px 50px rgba(16,24,40,.14));
}

.forma-mockup-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	z-index: 2;
	/* Don't use blend mode here; it makes dark/transparent mockups look incorrect when recoloring. */
	mix-blend-mode: normal;
}

.forma-mockup-tint {
	position: absolute;
	/* Cover the full mockup so the selected shirt color fills transparent parts. */
	inset: 0;
	display: none !important;
	border-radius: 0;
	background: #f5f5f3;
	z-index: 1;
	transition: background .3s ease;
	/* Optional: apply stage.mask as a CSS mask for true dye recoloring. */
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	-webkit-mask-position: center;
	-webkit-mask-mode: alpha;
	mask-repeat: no-repeat;
	mask-size: contain;
	mask-position: center;
	mask-mode: alpha;
}

.forma-print-area {
	position: absolute;
	z-index: 3;
	overflow: visible;
	outline: 1px dashed rgba(15,118,110,.32);
}
.forma-print-area .canvas-container {
	margin: 0 auto;
}
.forma-print-area canvas { display: block; }

.forma-stage-rail {
	position: absolute;
	right: 18px;
	top: 18px;
	bottom: 18px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-end;
}

.forma-thumbs { display: flex; flex-direction: column; gap: 8px; }

.forma-thumbs button {
	width: 56px;
	height: 68px;
	border: 2px solid transparent;
	border-radius: 8px;
	padding: 0;
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(16,24,40,.12);
}

.forma-thumbs button.is-active { border-color: var(--forma-accent); }

.forma-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.forma-zoom {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border-radius: 999px;
	padding: 4px 8px;
	box-shadow: 0 8px 20px rgba(16,24,40,.12);
	font-size: 0.75rem;
	font-weight: 800;
}

.forma-zoom button {
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: #f2f4f7;
	cursor: pointer;
	font-size: 1rem;
}

.forma-mobile-bar { display: none; }

@media (max-width: 900px) {
	.forma-app {
		grid-template-columns: 1fr;
		grid-template-rows: var(--forma-top) var(--forma-save) 1fr auto auto;
	}
	.forma-rail { display: none; }
	.forma-savebar { grid-column: 1; }
	.forma-panel {
		grid-row: 4;
		border-right: 0;
		border-top: 1px solid var(--forma-line);
		max-height: 34vh;
	}
	.forma-stage { grid-row: 3; }
	.forma-mobile-bar {
		grid-row: 5;
		display: flex;
		overflow: auto;
		border-top: 1px solid var(--forma-line);
		background: #fff;
	}
	.forma-mobile-bar button {
		flex: 1 0 auto;
		border: 0;
		background: none;
		padding: 12px 10px;
		font: inherit;
		font-size: 0.68rem;
		font-weight: 800;
		color: var(--forma-muted);
	}
	.forma-mobile-bar button.is-active { color: var(--forma-accent); }
	.forma-btn-shop { display: none; }
	.forma-canvas-shell { width: min(72%, 320px); }
	.forma-stage-rail { right: 8px; }
}
