/* ==========================================================================
   CHILL & PRINT — Custom Design Studio Redesign
   Ivory luxury aesthetic matching Cormorant Garamond & Manrope tokens
   ========================================================================== */

.studio-container {
  display: grid;
  grid-template-columns: 340px 1fr 300px;
  gap: 28px;
  padding: 30px 0 60px;
  min-height: calc(100vh - 180px);
  align-items: start;
}

/* LEFT CONTROLS PANEL */
.studio-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: fit-content;
  box-shadow: var(--shadow-subtle);
}

.studio-panel-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

/* CANVAS STAGE (CENTER - VISUAL FOCAL POINT) */
.stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #F3EFE8;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 36px 24px;
  box-shadow: var(--shadow-subtle);
}

.stage-view-toggles {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  z-index: 10;
}

.view-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 9px 20px;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-btn.active, .view-btn:hover {
  background: #262522;
  color: #F8F6F1;
  border-color: #262522;
}

.canvas-viewport {
  position: relative;
  width: 500px;
  height: 500px;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: #FFFFFF;
  border: 1px solid var(--border-subtle);
}

/* Garment backdrop image layer */
.canvas-backdrop-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: contain;
  padding: 20px;
  user-select: none;
}

/* Printable Area Boundary (Chest bounding box) */
.printable-boundary {
  position: absolute;
  top: 130px;
  left: 140px;
  width: 220px;
  height: 250px;
  border: 1px dashed var(--accent-sage);
  pointer-events: none;
  z-index: 5;
  box-sizing: border-box;
}

.printable-boundary-label {
  position: absolute;
  top: -20px;
  left: 0;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--accent-sage);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* HTML5 Interactive Design Canvas */
#design-canvas {
  position: absolute;
  top: 130px;
  left: 140px;
  width: 220px;
  height: 250px;
  z-index: 6;
  cursor: crosshair;
}

/* RIGHT SUMMARY PANEL */
.studio-summary-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: fit-content;
  box-shadow: var(--shadow-subtle);
}

/* TOOL TABS */
.tool-pill-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.tool-pill.active {
  background: #262522;
  color: #F8F6F1;
  border-color: #262522;
}

.upload-dropzone {
  border: 1.5px dashed var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: var(--bg-primary);
}

.upload-dropzone:hover {
  border-color: var(--text-main);
  background: var(--bg-secondary);
}

/* RESPONSIVE LAYOUT */
@media (max-width: 1200px) {
  .studio-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .stage-wrapper {
    order: -1; /* Keep garment visually prominent at top on tablets & mobile */
  }
}

@media (max-width: 600px) {
  .canvas-viewport {
    width: 320px;
    height: 320px;
  }
  .printable-boundary {
    top: 75px;
    left: 80px;
    width: 160px;
    height: 180px;
  }
  #design-canvas {
    top: 75px;
    left: 80px;
    width: 160px;
    height: 180px;
  }
}
