/* Customization studio */
.studio { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.studio-preview { position: sticky; top: calc(var(--header-h) + 16px); }
.stage { position: relative; aspect-ratio: 1; background: var(--bg-soft); border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.stage-obj { position: relative; }
.stage-obj > img { width: 100%; height: 100%; display: block; user-select: none; }
.design-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.design-layer img { position: absolute; max-width: none; height: auto; user-select: none; pointer-events: auto; touch-action: none; cursor: grab; }
.design-layer img.dragging { cursor: grabbing; }
.stage-empty { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; margin: 0; font-size: .9rem; color: var(--muted); }
.stage-hint { text-align: center; font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

.studio-panel { display: grid; gap: 18px; }
.step-card { padding: 22px 24px; }
.step-card h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-card .n { width: 28px; height: 28px; border-radius: 50%; background: var(--magenta); color: #fff; font-size: .9rem; display: grid; place-items: center; }
.product-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.pick { background: var(--bg-soft); border: 2px solid transparent; border-radius: 10px; padding: 10px 6px 8px; cursor: pointer; display: grid; gap: 6px; justify-items: center; font-weight: 600; font-size: .85rem; color: var(--ink); }
.pick img { height: 54px; width: 100%; object-fit: contain; }
.pick:hover { border-color: #c9ccd3; }
.pick.active { border-color: var(--magenta); background: #fff; box-shadow: 0 0 0 3px rgba(229, 24, 139, .12); }

.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 16px; border: 2px dashed #b9bcc4; border-radius: 12px; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--magenta); background: #fff5fa; }
.dropzone svg { width: 34px; height: 34px; color: var(--magenta); }
.dropzone small { color: var(--muted); }
.file-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 14px; background: var(--bg-soft); border-radius: 8px; font-size: .92rem; word-break: break-all; }
.link-btn { background: none; border: 0; padding: 0; color: var(--magenta); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.file-row .link-btn { white-space: nowrap; }
#use-sample { margin-top: 12px; }
.warn { margin: 10px 0 0; padding: 10px 14px; border-radius: 8px; background: #fff4dc; color: #7a5200; font-size: .88rem; }
[hidden] { display: none !important; }

.slider-row { display: grid; grid-template-columns: 80px 1fr 52px; align-items: center; gap: 12px; margin-bottom: 14px; }
.slider-row input { accent-color: var(--magenta); width: 100%; }
.slider-row output { text-align: right; color: var(--muted); font-size: .9rem; }
.btn-row { display: flex; gap: 10px; }
.btn-outline { background: #fff; border-color: #b9bcc4; color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--magenta); }
.qty { display: grid; grid-template-columns: 44px 1fr 44px; }
.qty button { border: 1px solid #b9bcc4; background: #fff; font-size: 1.2rem; cursor: pointer; }
.qty button:first-child { border-radius: 8px 0 0 8px; }
.qty button:last-child { border-radius: 0 8px 8px 0; }
.qty input { text-align: center; border: 1px solid #b9bcc4; border-left: 0; border-right: 0; border-radius: 0; padding: 12px 4px; width: 100%; }

@media (max-width: 960px) {
  /* Single column: steps 1-3, then the preview, then step 4 (options) */
  .studio { display: flex; flex-direction: column; gap: 18px; }
  .studio-panel { display: contents; }
  .studio-panel > .step-card { width: 100%; min-width: 0; }
  .studio-panel > .step-card:nth-child(1) { order: 1; }
  .studio-panel > .step-card:nth-child(2) { order: 2; }
  .studio-panel > .step-card:nth-child(3) { order: 3; }
  .studio-preview { order: 4; position: static; max-width: 560px; margin: 0 auto; width: 100%; }
  .studio-panel > .step-card:nth-child(4) { order: 5; }
}
@media (max-width: 480px) {
  .step-card { padding: 18px 16px; }
  .slider-row { grid-template-columns: 64px 1fr 48px; gap: 8px; }
  .pick { font-size: .78rem; }
}

.studio-price { margin: 4px 0 10px; font-weight: 800; font-size: 1.1rem; }
.form-error { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #b42318; font-weight: 600; font-size: .92rem; }
