/* CPTN T-shirt Designer – matches captainsdesign.cz (Montserrat, #23232d, pink gradient). Mobile first. */
.cptn-tsd {
	--cptn-ink: #23232d;
	--cptn-text: #3e3e4b;
	--cptn-muted: #6b6b7a;
	--cptn-line: #dcdce3;
	--cptn-accent: #e9435a;
	--cptn-grad: linear-gradient(120deg, #e96199, #e9435a);
	color: var(--cptn-text);
	font-family: Montserrat, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	max-width: 1140px;
	margin: 0 auto;
	box-sizing: border-box;
	container-type: inline-size; /* Layout follows the Oxygen column width, not the viewport. */
}

.cptn-tsd *,
.cptn-tsd *::before,
.cptn-tsd *::after {
	box-sizing: inherit;
}

.cptn-tsd [hidden] {
	display: none !important;
}

.cptn-tsd__workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* Wide size chart scrolls instead of widening the page. */
	gap: 24px;
}

.cptn-tsd__stage {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	aspect-ratio: 640 / 560;
	background: #f4f4f6;
	border-radius: 16px;
	overflow: hidden;
}

.cptn-tsd__garment {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.cptn-tsd__area {
	position: absolute;
	outline: 2px dashed rgba(35, 35, 45, 0.45);
	outline-offset: 0;
}

.cptn-tsd__stage.is-dark .cptn-tsd__area {
	outline-color: rgba(255, 255, 255, 0.6);
}

.cptn-tsd__sides {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
}

.cptn-tsd__hint,
.cptn-tsd__small {
	font-size: 13px;
	color: var(--cptn-muted);
	margin: 8px 0 0;
}

.cptn-tsd__hint {
	text-align: center;
}

.cptn-tsd__group {
	border: 1px solid var(--cptn-line);
	border-radius: 16px;
	padding: 16px;
	margin: 0 0 16px;
	min-width: 0;
}

.cptn-tsd__form fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.cptn-tsd legend {
	font-weight: 900;
	color: var(--cptn-ink);
	padding: 0 6px;
	font-size: 17px;
}

.cptn-tsd__form legend {
	padding: 0 0 8px;
}

.cptn-tsd__label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	color: var(--cptn-ink);
	margin: 10px 0 4px;
}

.cptn-tsd input[type="text"],
.cptn-tsd input[type="email"],
.cptn-tsd input[type="tel"],
.cptn-tsd select,
.cptn-tsd textarea {
	width: 100%;
	font: inherit;
	color: var(--cptn-ink);
	background: #fff;
	border: 1px solid var(--cptn-line);
	border-radius: 10px;
	padding: 10px 12px;
	min-height: 44px;
}

.cptn-tsd input[type="color"] {
	width: 52px;
	height: 44px;
	padding: 2px;
	border: 1px solid var(--cptn-line);
	border-radius: 10px;
	background: #fff;
}

.cptn-tsd :focus-visible {
	outline: 3px solid var(--cptn-accent);
	outline-offset: 2px;
}

.cptn-tsd__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.cptn-tsd__row .cptn-tsd__label {
	margin: 0;
}

.cptn-tsd__row select {
	width: auto;
	flex: 1 1 140px;
}

.cptn-tsd__btn,
.cptn-tsd__side {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 1000px;
	border: 2px solid var(--cptn-ink);
	background: #fff;
	color: var(--cptn-ink);
	font: 800 14px/1.2 Montserrat, Arial, sans-serif;
	cursor: pointer;
	text-decoration: none;
}

.cptn-tsd__btn:hover,
.cptn-tsd__side:hover {
	border-color: var(--cptn-accent);
	color: var(--cptn-accent);
}

.cptn-tsd__side.is-active {
	background: var(--cptn-ink);
	color: #fff;
}

.cptn-tsd__btn--primary {
	border: 0;
	background: var(--cptn-grad);
	color: #fff;
	font-weight: 900;
	padding: 12px 24px;
}

.cptn-tsd__btn--primary:hover {
	color: #fff;
	filter: brightness(1.05);
}

.cptn-tsd__btn--primary:disabled {
	opacity: 0.6;
	cursor: progress;
}

.cptn-tsd__btn--ghost {
	border-color: var(--cptn-line);
	font-weight: 700;
}

.cptn-tsd__btn--file {
	position: relative;
}

.cptn-tsd__btn--file:focus-within {
	outline: 3px solid var(--cptn-accent);
	outline-offset: 2px;
}

.cptn-tsd .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.cptn-tsd__swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cptn-tsd__swatch {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid var(--cptn-line);
	cursor: pointer;
	padding: 0;
}

.cptn-tsd__swatch[aria-checked="true"] {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--cptn-accent);
}

.cptn-tsd__info,
.cptn-tsd__status {
	font-size: 14px;
	margin: 10px 0 0;
	min-height: 1.5em;
}

.cptn-tsd__info[data-type="warn"],
.cptn-tsd__status[data-type="error"] {
	color: #b3122b;
	font-weight: 700;
}

.cptn-tsd__status[data-type="ok"] {
	color: #17663a;
	font-weight: 700;
}

.cptn-tsd__check {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 14px;
	font-size: 14px;
}

.cptn-tsd__check input {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	flex: none;
}

.cptn-tsd__check a {
	color: var(--cptn-accent);
}

.cptn-tsd__hp {
	position: absolute;
	left: -9999px;
}

@container (min-width: 760px) {
	.cptn-tsd__workspace {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		align-items: start;
	}

	.cptn-tsd__stage-wrap {
		position: sticky;
		top: 100px;
	}
}

/* Print size per side + price from the price list. */
.cptn-tsd__sizes > span {
	flex: 1 1 12rem;
	display: flex;
	flex-direction: column;
}

.cptn-tsd__price {
	margin: 0.75rem 0 0;
	padding: 0.6rem 0.8rem;
	border-left: 4px solid var(--cptn-accent);
	background: rgba(233, 67, 90, 0.07);
	font-weight: 600;
}

.cptn-tsd__btn:disabled,
.cptn-tsd__btn--file:has(input:disabled) {
	opacity: 0.45;
	cursor: not-allowed;
}

.cptn-tsd__sizes select {
	flex: none;
}

/* 3D preview (button under the stage + modal appended to body, outside .cptn-tsd variables) */
.cptn-tsd__3d-btn {
	display: block;
	margin: 12px auto 0;
}

.cptn-tsd-3d {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(20, 20, 28, 0.72);
	font-family: Montserrat, Arial, sans-serif;
}

.cptn-tsd-3d__dialog {
	position: relative;
	width: min(900px, 100%);
	background: #fff;
	border-radius: 16px;
	padding: 12px;
}

.cptn-tsd-3d__view {
	height: min(70vh, 640px);
	border-radius: 12px;
	overflow: hidden;
	background: #f4f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cptn-tsd-3d__view canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

.cptn-tsd-3d__msg {
	color: #3e3e4b;
	padding: 16px;
	text-align: center;
}

.cptn-tsd-3d__hint {
	font-size: 13px;
	color: #6b6b7a;
	margin: 8px 4px 0;
	text-align: center;
}

.cptn-tsd-3d__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 1;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #23232d;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.cptn-tsd-3d__close:focus-visible {
	outline: 3px solid #e9435a;
	outline-offset: 2px;
}

.cptn-tsd__credit {
	font-size: 9px;
	line-height: 1.3;
	color: #c4c4cc;
	text-align: center;
	margin: 10px 0 0;
}

.cptn-tsd__credit a {
	color: inherit;
}

/* Colour name next to the label; long palettes (hoodie has 100 colours) scroll inside a short box. */
.cptn-tsd__color-name {
	font-weight: 600;
	color: var(--cptn-text);
}

.cptn-tsd__swatches {
	max-height: 168px;
	overflow-y: auto;
	padding: 6px;
	margin: 0 -6px;
}

/* Size chart under "Počet kusů a velikosti". */
.cptn-tsd__chart {
	margin-top: 10px;
	font-size: 14px;
}

.cptn-tsd__chart summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--cptn-accent);
	min-height: 32px;
	display: flex;
	align-items: center;
}

.cptn-tsd__chart-scroll {
	overflow-x: auto;
	margin-top: 6px;
}

.cptn-tsd__chart table {
	border-collapse: collapse;
	width: 100%;
	font-size: 13px;
}

.cptn-tsd__chart th,
.cptn-tsd__chart td {
	border: 1px solid var(--cptn-line);
	padding: 4px 6px;
	text-align: center;
	white-space: nowrap;
}

.cptn-tsd__chart tbody th {
	text-align: left;
	font-weight: 600;
	white-space: normal;
	min-width: 9rem;
}

/* Phones: less nesting padding, smaller swatches, full-width buttons. */
@container (max-width: 559px) {
	.cptn-tsd__workspace {
		gap: 16px;
	}

	.cptn-tsd__group {
		padding: 12px;
		border-radius: 12px;
	}

	.cptn-tsd legend {
		font-size: 16px;
	}

	.cptn-tsd__swatches {
		gap: 6px;
		max-height: 150px; /* A half-visible row hints that the palette scrolls. */
	}

	.cptn-tsd__swatch {
		width: 34px;
		height: 34px;
	}

	.cptn-tsd__price {
		font-size: 14px;
	}

	.cptn-tsd__row > .cptn-tsd__btn {
		flex: 1 1 100%;
	}

	.cptn-tsd__row[data-object-tools] > .cptn-tsd__btn {
		flex: 1 1 auto;
		padding: 10px 12px;
	}

	.cptn-tsd__sides .cptn-tsd__side {
		flex: 1;
		padding: 10px 8px;
	}
}
