/* ------------------------------------------------------------------ *
 * T-Shirt Designer — self-contained styles.
 * Control rules are prefixed with #tsd-app so they out-specify BOTH the
 * theme's global <button> styling and our own #tsd-app button reset.
 * ------------------------------------------------------------------ */

#tsd-app.tsd-app {
	flex: 1 0 100% !important;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 22px;
	margin: 8px 0 26px;
	box-sizing: border-box;
	font-size: 14px;
	color: #2b2b2b;
}

/* WooCommerce add-to-cart form is usually display:flex; wrap it so the
   designer takes a full row and the canvas isn't squeezed to 0 width. */
form.cart {
	flex-wrap: wrap !important;
}

/* Base reset — neutralise the theme's global button styling. */
#tsd-app button {
	font: inherit !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	text-shadow: none !important;
	margin: 0 !important;
	cursor: pointer;
	transition: none !important;
}

/* ---- Canvas stage --------------------------------------------------- */
#tsd-app .tsd-stage {
	position: relative;
	background: #f6f7f8;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	padding: 14px;
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	box-sizing: border-box;
}

#tsd-app .tsd-stage .canvas-container {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 900 / 1000;
	margin: 0 auto;
}

#tsd-app .tsd-stage .canvas-container canvas {
	width: 100% !important;
	height: 100% !important;
}

#tsd-app .tsd-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 14px;
}

/* ---- Controls ------------------------------------------------------- */
#tsd-app .tsd-controls {
	display: flex;
	flex-direction: column;
	gap: 18px;
	max-width: 560px;
}

#tsd-app .tsd-row {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tsd-app .tsd-label {
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #8a8f98;
	margin: 0;
}

/* ---- Shirt type: segmented toggle ---------------------------------- */
#tsd-app .tsd-types {
	display: inline-flex;
	gap: 0;
	background: #eef0f2;
	border-radius: 10px;
	padding: 4px;
	width: fit-content;
}

#tsd-app .tsd-type {
	background: transparent !important;
	color: #4a4f57 !important;
	border: 0 !important;
	border-radius: 8px !important;
	padding: 9px 22px !important;
	min-height: 0 !important;
	width: auto !important;
	font-size: 14px !important;
	font-weight: 600 !important;
}

#tsd-app .tsd-type.is-active {
	background: #ffffff !important;
	color: #111 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12) !important;
}

/* ---- Color swatches ------------------------------------------------- */
#tsd-app .tsd-swatches {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

#tsd-app .tsd-swatch {
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	flex: 0 0 auto !important;
	padding: 0 !important;
	border-radius: 50% !important;
	border: 2px solid #d7d9dd !important;
	background-clip: padding-box;
	outline: none !important;
}

#tsd-app .tsd-swatch.is-active {
	border-color: #111 !important;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111 !important;
}

#tsd-app .tsd-freeform {
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	padding: 0 !important;
	border: 1px solid #d7d9dd !important;
	border-radius: 8px !important;
	background: none !important;
}

/* ---- Design gallery ------------------------------------------------- */
#tsd-app .tsd-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, 74px);
	gap: 10px;
}

#tsd-app .tsd-design {
	background: #fff !important;
	border: 1px solid #e2e4e8 !important;
	border-radius: 10px !important;
	padding: 8px !important;
	width: 74px !important;
	height: 74px !important;
	min-height: 0 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

#tsd-app .tsd-design:hover {
	border-color: #111 !important;
}

#tsd-app .tsd-design img {
	max-width: 100% !important;
	max-height: 100% !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
}

/* ---- Upload --------------------------------------------------------- */
#tsd-app .tsd-upload {
	display: inline-block;
}

#tsd-app .tsd-upload input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

#tsd-app .tsd-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border: 1px dashed #111;
	border-radius: 8px;
	color: #111;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	background: #fff;
}

#tsd-app .tsd-upload-btn:hover {
	background: #fafafa;
}

#tsd-app .tsd-note {
	font-size: 12px;
	color: #6b7280;
	margin: 8px 0 0;
}

/* ---- Toolbar -------------------------------------------------------- */
#tsd-app .tsd-toolbar {
	flex-direction: row;
	gap: 8px;
	flex-wrap: wrap;
}

#tsd-app .tsd-tool {
	background: #f4f5f6 !important;
	color: #333 !important;
	border: 1px solid #dfe1e5 !important;
	border-radius: 8px !important;
	padding: 8px 14px !important;
	min-height: 0 !important;
	width: auto !important;
	font-size: 13px !important;
	font-weight: 500 !important;
}

#tsd-app .tsd-tool:hover {
	background: #ebedef !important;
}

#tsd-app .tsd-status {
	min-height: 18px;
	font-size: 13px;
	color: #b23b3b;
	margin: 0;
}

@media ( max-width: 600px ) {
	#tsd-app .tsd-swatch {
		width: 36px !important;
		height: 36px !important;
		min-width: 36px !important;
		min-height: 36px !important;
	}
}
