/* TG-MI2-1120: mobile Studio round 2. Preview ?tgmi2=p1120.
   Free maximum canvas: chrome in the header, product fills the stage.
   Phones/tablets only. Desktop (>=1024px) is not restyled. */
@media (max-width: 1023px) {
#tees-studio.tgst-m.tgmi2 {
  --mi2-ink: #16243E;
  --mi2-line: #e3e5ea;
  --mi2-grid: #e6e6e6;
  --mi2-shadow: 0 2px 8px rgba(22, 36, 62, .10);
  background-color: var(--mi2-grid) !important;
  background-image: radial-gradient(circle, rgba(20, 30, 50, .17) 1.1px, transparent 1.5px) !important;
  background-size: 20px 20px !important;
  background-position: 10px 10px !important;
  grid-template-rows: 48px minmax(0, 1fr) !important;
}

/* Continuous grid: chrome and the stage must not paint their own slab / second grid */
#tees-studio.tgst-m.tgmi2 .ts-top,
#tees-studio.tgst-m.tgmi2 .ts-design,
#tees-studio.tgst-m.tgmi2 .ts-views,
#tees-studio.tgst-m.tgmi2 .ts-colors,
#tees-studio.tgst-m.tgmi2 .ts-stage,
#tees-studio.tgst-m.tgmi2 .ts-tools,
#tees-studio.tgst-m.tgmi2 .ts-scr,
#tees-studio.tgst-m.tgmi2 .tgmi2-bar {
  background-color: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* ---- Header: Close, Save, Share | compact qty | Add to cart unchanged ---- */
#tees-studio.tgst-m.tgmi2 .ts-top {
  display: flex !important;
  align-items: center;
  gap: 6px;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 8px 0 6px !important;
  border-bottom: 0 !important;
}
#tees-studio.tgst-m.tgmi2 .ts-top .ts-close {
  flex: none;
  width: 36px;
  height: 36px;
}
#tees-studio.tgst-m.tgmi2 .ts-top .ts-prev { display: none !important; }
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgsv-btn,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgst-share-m,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgst-share {
  position: static !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0 !important;
  border: 1px solid var(--mi2-line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  color: var(--mi2-ink) !important;
  box-shadow: var(--mi2-shadow) !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgsv-btn span,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgst-share-m span,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .tgst-share span {
  display: none !important;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts svg {
  width: 16px;
  height: 16px;
  flex: none;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .ts-ur {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  display: flex !important;
  gap: 4px;
  margin-left: 2px;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .ts-ur .ts-ib,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .ts-undo,
#tees-studio.tgst-m.tgmi2 .ts-top .tgmi2-acts .ts-redo {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 16px !important;
  border: 1px solid var(--mi2-line) !important;
  background: #fff !important;
  box-shadow: var(--mi2-shadow) !important;
  color: var(--mi2-ink) !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2-oneview .tgmi2-bar {
  display: flex !important;
  justify-content: flex-end;
  padding: 0 8px 2px;
  min-height: 32px;
}
#tees-studio.tgst-m.tgmi2.tgmi2-oneview .tgmi2-bar .ts-views { display: none !important; }

/* Qty/price stays in the header, compact, so the stage stays free */
#tees-studio.tgst-m.tgmi2 .ts-top .ts-steps,
#tees-studio.tgst-m.tgmi2 .ts-top .tsf-qc {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
#tees-studio.tgst-m.tgmi2 .ts-top .tsf-qbtn,
#tees-studio.tgst-m.tgmi2 .ts-top .ts-steps > li:not(.tsf-qc) {
  height: 28px;
  padding: 0 8px;
  border-radius: 14px;
  font-size: 11px !important;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#tees-studio.tgst-m.tgmi2 .ts-top .ts-steps > li:not(.tsf-qc) { display: none; }
/* Add to cart / Next: keep look, pin to the right */
#tees-studio.tgst-m.tgmi2 .ts-top .ts-next {
  flex: none;
  margin-left: auto;
}

/* 1-view products: hide the non-switching Wrap / Front bar and current-side thumb */
#tees-studio.tgst-m.tgmi2.tgmi2-oneview .ts-views,
#tees-studio.tgst-m.tgmi2 .ts-views:not(:has(.ts-vw:nth-child(2))) {
  display: none !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2-oneview .tgf-live,
#tees-studio.tgst-m.tgmi2 .ts-design:not(:has(.ts-views .ts-vw:nth-child(2))) .tgf-live {
  display: none !important;
}

/* Compact chip + undo row, directly under the header */
#tees-studio.tgst-m.tgmi2 .tgmi2-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 0 8px 4px;
  min-height: 0;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-views {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 !important;
  display: flex !important;
  gap: 4px;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-views::-webkit-scrollbar { display: none; }
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-vw {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  box-shadow: var(--mi2-shadow);
  flex: 1 1 0;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-ur {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  display: flex !important;
  gap: 4px;
  flex: none;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-ur .ts-ib,
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-undo,
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-redo {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 16px !important;
  border: 1px solid var(--mi2-line) !important;
  background: #fff !important;
  box-shadow: var(--mi2-shadow) !important;
  color: var(--mi2-ink) !important;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-bar .ts-ur svg {
  width: 15px;
  height: 15px;
}

/* Slim colour dots, still off the stage */
#tees-studio.tgst-m.tgmi2 .ts-colors {
  padding: 0 8px 4px !important;
  border-bottom: 0 !important;
  min-height: 0;
  gap: 7px !important;
}
#tees-studio.tgst-m.tgmi2 .ts-colors .ts-dot {
  width: 18px !important;
  height: 18px !important;
}

/* ---- Stage: only product, design, other-side thumb, one small zoom ---- */
#tees-studio.tgst-m.tgmi2 .ts-stage {
  padding: 4px 8px 8px !important;
  overflow: hidden;
}
#tees-studio.tgst-m.tgmi2 .ts-stage .tgsv-btn,
#tees-studio.tgst-m.tgmi2 .ts-stage .tgst-share-m,
#tees-studio.tgst-m.tgmi2 .ts-stage .tgst-share,
#tees-studio.tgst-m.tgmi2 .ts-stage .ts-ur,
#tees-studio.tgst-m.tgmi2 .ts-stage .ts-auto,
#tees-studio.tgst-m.tgmi2 .ts-stage .ts-zm,
#tees-studio.tgst-m.tgmi2 .ts-stage .tg3d-btn,
#tees-studio.tgst-m.tgmi2 .ts-stage .tgpa-btn {
  display: none !important;
}
#tees-studio.tgst-m.tgmi2 .tgf-live {
  top: 8px !important;
  right: 8px !important;
  width: 56px !important;
  height: 56px !important;
  z-index: 8;
  border-width: 2px !important;
  box-shadow: var(--mi2-shadow) !important;
}
#tees-studio.tgst-m.tgmi2 .tgf-live-lbl {
  font-size: 8px !important;
  padding: 1px 0 !important;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-zoom {
  position: absolute;
  z-index: 8;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--mi2-line);
  border-radius: 18px;
  background: #fff;
  color: var(--mi2-ink);
  box-shadow: var(--mi2-shadow);
  padding: 0;
  cursor: pointer;
}
#tees-studio.tgst-m.tgmi2 .tgmi2-zoom svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bottom dock: floating pills stay */
#tees-studio.tgst-m.tgmi2 .ts-tools {
  height: auto !important;
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom)) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-add > button,
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-add .tgf-url {
  border: 1px solid var(--mi2-line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--mi2-shadow) !important;
  height: 60px !important;
  min-height: 60px !important;
}
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-tab,
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-tabs .ts-ok {
  box-shadow: var(--mi2-shadow) !important;
  border-radius: 16px !important;
}
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-tab.is-on,
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-tabs .ts-ok {
  box-shadow: 0 4px 12px rgba(22, 36, 62, .22) !important;
}
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-panel {
  margin-top: 4px;
  padding: 8px 10px;
  max-height: 18vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--mi2-line);
  border-radius: 16px;
  box-shadow: var(--mi2-shadow);
}
#tees-studio.tgst-m.tgmi2 .ts-tools .ts-hint {
  color: #5b6474;
}
}
