/* IMH Design Studio — self-serve merch designer styles.
   DARK THEME: page #0b0b0d, panels #151517, stage backdrop neutral #1c1c1f, gold #d9b62c.
   Brand: black + gold. Mobile: panels stack vertically. */

.ds-wrap { max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; }
.ds-head { text-align: center; margin-bottom: 18px; }
.ds-head h1 { font-size: 1.7rem; margin-bottom: 4px; color: #f5f5f5; }
.ds-head p { color: #bdbdbd; font-size: 0.95rem; }

.ds-studio { display: grid; grid-template-columns: 250px 1fr 320px; gap: 16px; align-items: start; }
.ds-panel { background: #151517; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px; color: #f5f5f5; }
.ds-panel h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; color: #bdbdbd; margin-bottom: 10px; }
.ds-panel h4 { font-size: 0.95rem; margin: 14px 0 8px; color: #f5f5f5; }

.ds-garment { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px; margin-bottom: 8px;
  background: #1c1c1f; cursor: pointer; font-family: inherit; color: #f5f5f5; }
.ds-garment:hover { border-color: #d9b62c; }
.ds-garment.active { border-color: #d9b62c; box-shadow: 0 0 0 3px rgba(217,182,44,0.25); }
.ds-garment .ds-gthumb { width: 44px; height: 52px; flex: none; }
.ds-garment .ds-gname { font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
.ds-garment .ds-gprice { font-size: 0.75rem; color: #bdbdbd; }

.ds-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.28);
  cursor: pointer; padding: 0; }
.ds-swatch.active { border-color: #ffffff; box-shadow: 0 0 0 2px #d9b62c; }
.ds-colorname { font-size: 0.82rem; color: #bdbdbd; margin-top: 8px; }

/* Canvas stage: NEUTRAL mid-grey so garments read well (not pure black). */
.ds-stage-box { background: #1c1c1f; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px;
  position: relative; }
#dsSvg { width: 100%; height: auto; display: block; touch-action: none; cursor: default; border-radius: 8px; }
.ds-stage-hint { text-align: center; font-size: 0.8rem; color: #bdbdbd; margin-top: 8px; }
.ds-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: #bdbdbd;
  background: none; border: none; cursor: pointer; font-family: inherit; margin-top: 6px; }
.ds-toggle:hover { color: #d9b62c; }

.ds-tabs { display: flex; gap: 0; border-bottom: 2px solid rgba(255,255,255,0.1); margin-bottom: 14px; }
.ds-tab { flex: 1; background: none; border: none; border-bottom: 3px solid transparent;
  padding: 10px 4px; font-size: 0.85rem; font-weight: 700; cursor: pointer;
  font-family: inherit; color: #bdbdbd; }
.ds-tab.active { color: #f5f5f5; border-bottom-color: #d9b62c; }
.ds-tab:hover { color: #f5f5f5; }

.ds-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ds-toolbtn { border: 1.5px solid rgba(255,255,255,0.12); background: #1c1c1f; border-radius: 8px; padding: 8px 12px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit; color: #f5f5f5; }
.ds-toolbtn:hover { border-color: #d9b62c; }
.ds-toolbtn.danger { color: #ff7a7a; }

.ds-tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ds-tpl { border: 1.5px solid rgba(255,255,255,0.1); border-radius: 8px; background: #1c1c1f; cursor: pointer;
  padding: 6px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.ds-tpl:hover { border-color: #d9b62c; }
.ds-tpl svg { width: 100%; height: 100%; }
.ds-stock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ds-stock { border: 1.5px solid rgba(255,255,255,0.1); border-radius: 8px; background: #1c1c1f; cursor: pointer;
  padding: 8px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: #f5f5f5; }
.ds-stock:hover { border-color: #d9b62c; color: #d9b62c; }
.ds-stock svg { width: 100%; height: 100%; }

.ds-layer-row { display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; margin-bottom: 6px; font-size: 0.82rem; background: #1c1c1f; color: #f5f5f5; }
.ds-layer-row.selected { border-color: #d9b62c; box-shadow: 0 0 0 2px rgba(217,182,44,0.2); }
.ds-layer-row .ds-lname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-layer-row button { border: 1px solid rgba(255,255,255,0.12); background: #151517; color: #f5f5f5; border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 0.85rem; line-height: 1; flex: none; }
.ds-layer-row button:hover { border-color: #d9b62c; }

.ds-size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ds-size-grid .field { margin-bottom: 0; }
.ds-size-grid label { font-size: 0.75rem; font-weight: 700; display: block; margin-bottom: 4px; text-align: center; color: #bdbdbd; }
.ds-size-grid input { width: 100%; padding: 8px; text-align: center; border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: #1c1c1f; color: #f5f5f5; }
.ds-size-grid input:focus { outline: none; border-color: #d9b62c; }

.ds-tier-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin: 10px 0; color: #f5f5f5; }
.ds-tier-table th, .ds-tier-table td { border: 1px solid rgba(255,255,255,0.1); padding: 6px 8px; text-align: center; }
.ds-tier-table th { background: #0b0b0d; color: #fff; font-size: 0.72rem; text-transform: uppercase; }
.ds-tier-table tr.active td { background: rgba(217,182,44,0.15); font-weight: 700; }

.ds-total { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid rgba(255,255,255,0.15); padding-top: 10px; margin: 12px 0; color: #f5f5f5; }
.ds-total .ds-tlabel { font-weight: 700; }
.ds-total .ds-tval { font-size: 1.5rem; font-weight: 800; }
.ds-total .ds-tqty { font-size: 0.8rem; color: #bdbdbd; }

.ds-design-preview { border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px; margin-bottom: 16px;
  text-align: center; background: #1c1c1f; color: #f5f5f5; }
.ds-design-preview img { max-width: 100%; max-height: 300px; border-radius: 6px; }

@media (max-width: 1020px) {
  .ds-studio { grid-template-columns: 1fr 1fr; }
  .ds-right { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .ds-studio { grid-template-columns: 1fr; }
  .ds-stage-box { order: -1; }
}
