.image-preview--tshirt {
  padding-top: 0.5rem;
  padding-bottom: 0.75rem;
}

.image-preview--tshirt .tshirt-stage {
  width: min(100%, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
}

.mug-product-picker--shirt {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.image-preview--tshirt .prev-wrap,
.image-preview--tshirt #noPreview {
  display: none;
}

.image-preview--tshirt.tshirt-flat-fallback .tshirt-stage {
  display: none;
}

.image-preview--tshirt.tshirt-flat-fallback .prev-wrap,
.image-preview--tshirt.tshirt-flat-fallback #noPreview {
  display: flex;
}

.tshirt-stage-canvas-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  position: relative;
  background: transparent;
}

.tshirt-stage.is-updating .tshirt-stage-canvas-wrap {
  animation: tshirt-preview-build 2.6s ease-out forwards;
}

@keyframes tshirt-preview-build {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 162, 92, 0));
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 162, 92, 0.38));
  }
}

.tshirt-stage.is-revealing .tshirt-stage-canvas-wrap {
  animation: tshirt-preview-reveal-glow 1.05s ease forwards;
}

@keyframes tshirt-preview-reveal-glow {
  0% {
    filter: drop-shadow(0 0 30px rgba(255, 162, 92, 0.95));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 162, 92, 0));
  }
}

.tshirt-stage-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  background: transparent;
}

.tshirt-artwork-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 6;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tshirt-artwork-toggle[aria-pressed='true'] {
  background: #111;
  color: #fff;
  border-color: #111;
}

.tshirt-artwork-flat {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 3.2rem 1.25rem 1.25rem;
  box-sizing: border-box;
  background: var(--tshirt-shirt, #f3f0ea);
  border-radius: 18px;
}

.tshirt-stage.is-artwork-flat .tshirt-artwork-flat {
  display: flex;
}

.tshirt-stage.is-artwork-flat .tshirt-stage-canvas-wrap canvas,
.tshirt-stage.is-artwork-flat .tshirt-zoom,
.tshirt-stage.is-artwork-flat .tshirt-views,
.tshirt-stage.is-artwork-flat .tshirt-stage-note {
  display: none;
}

.tshirt-artwork-flat img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.tshirt-zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 3;
}

.tshirt-zoom-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 1.35rem;
  line-height: 1;
}

.tshirt-zoom-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tshirt-stage-status {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
}

.tshirt-stage-status:empty {
  display: none;
}

.tshirt-stage-status.is-error {
  color: #9b2c2c;
}

.tshirt-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 36rem;
}

.tshirt-colour {
  width: min(100%, 22rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tshirt-colour__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.6rem;
}

.tshirt-colour__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #242424;
  opacity: 0.55;
}

.tshirt-colour__choice {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.tshirt-colour__chip {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
  background: #111;
}

.tshirt-colour__chip.is-pale {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.tshirt-colour__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #161616;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tshirt-colour__name.is-preview {
  color: #6b6560;
}

.tshirt-swatches {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
}

.tshirt-swatch {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 999px;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  padding: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tshirt-swatch.is-pale {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.tshirt-swatch:hover,
.tshirt-swatch:focus-visible {
  transform: scale(1.12);
  z-index: 1;
}

.tshirt-swatch:focus-visible {
  outline: 2px solid var(--color, #ffa25c);
  outline-offset: 3px;
}

.tshirt-swatch.is-selected {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    0 0 0 2px #fff,
    0 0 0 3.5px #161616;
}

body:has(#tshirtSwatches:not(:empty)) .shirt-colour-select-field {
  display: none;
}

.tshirt-view-btn {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  padding: 0.35rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.tshirt-view-btn.is-selected {
  background: #111;
  color: #fff;
}

.tshirt-stage-note {
  max-width: 36rem;
  margin: 0.15rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.8;
}

.tshirt-size-guide {
  width: 100%;
  overflow-x: auto;
  margin-top: 1.25rem;
}

.tshirt-size-guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tshirt-size-guide th,
.tshirt-size-guide td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.tshirt-size-guide caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
