/* ============================================================================
 * EVENTRO — SILKETRYKK: ARBEIDSFLATE OG KONTROLLER
 * Fil: engine/designer/screen-print-colors.css
 *
 * Eier kun visuell utforming for screen-print-colors.js.
 * Standardknappene .tbtn og .btn-primary kommer fra nettstedets styles.css.
 * ========================================================================== */

/* ===== INNGANGSKNAPP I DESIGNEREN ======================================== */
.sp-launch {
  min-width: 290px;
  min-height: 56px;
  padding: 8px 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-color: #78c6ee;
  background: #edf8ff;
  color: #075f91;
  text-align: center;
}

.sp-launch:hover {
  border-color: #25a7e6;
  background: #dff3ff;
}

.sp-launch strong {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
}

.sp-launch small {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--ink-soft, #6c7f92);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
}

.sp-launch.sp-tab {
  position: absolute;
  min-width: 250px;
  width: 250px;
  align-items: center;
  justify-content: center;
  text-align: center;
  right: 12px;
  z-index: 60;
}

.sp-launch-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 10px 10px;
}

/* Refleks: trekk hele bånd-/verktøyområdet nærmere knappen. */
.sp-launch-wrap.sp-refleks-wrap {
  margin-bottom: -46px;
}

/* Silikon: samme funksjon som kompakt kontroll i høyre plasseringsliste. */
.sp-launch.sp-silicone {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 8px 12px;
  flex: 0 0 auto;
}

/* ===== MODALRAMME OG OVERSKRIFT ========================================= */
.sp-modal {
  width: min(1580px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  color: var(--ink, #173249);
  font-family: "Sora", Arial, sans-serif;
  box-shadow: 0 24px 80px rgba(16, 36, 56, 0.4);
}

.sp-modal::backdrop {
  background: rgba(16, 36, 56, 0.6);
}

.spm-head,
.spm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.spm-head {
  border-bottom: 1px solid var(--line, #dbe5ee);
}

.spm-title strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.spm-title small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft, #6c7f92);
  font-size: 12px;
  line-height: 1.3;
}

.spm-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line, #d4dee8);
  border-radius: 50%;
  background: #fff;
  color: var(--ink, #173249);
  font-size: 21px;
  cursor: pointer;
}

/* ===== ELEMENTVELGER ===================================================== */
.spm-thumbs-wrap {
  padding: 12px 20px 9px;
  border-bottom: 1px solid var(--line, #dbe5ee);
}

.spm-label {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.spm-thumbs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 1px 1px 8px;
  scrollbar-color: #9fb9ce #e6eef4;
  scrollbar-width: thin;
}

.spm-thumb {
  flex: 0 0 128px;
  height: 82px;
  padding: 6px;
  border: 1px solid #cfdae5;
  border-radius: 8px;
  background: #fff;
  color: #536a80;
  font-size: 10px;
}

.spm-thumb.active {
  padding: 5px;
  border: 2px solid var(--accent, #13a8e0);
}

.spm-thumb canvas {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: contain;
}

.spm-thumb span {
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== HOVEDARBEIDSFLATE ================================================ */
.spm-work {
  display: grid;
  grid-template-columns: minmax(330px, 28%) minmax(0, 72%);
  gap: 14px;
  height: min(590px, 66vh);
  padding: 14px 20px;
  background: #f8fbfd;
}

.spm-left {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 0;
}

.spm-panel {
  min-height: 0;
  padding: 13px;
  border: 1px solid #cfdae5;
  border-radius: 10px;
  background: #fff;
}

.spm-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.spm-panel-heading h4,
.spm-panel h4 {
  margin: 0;
  font-size: 14px;
}

.spm-color-count {
  color: var(--ink-soft, #6c7f92);
  font-size: 11px;
  white-space: nowrap;
}

.spm-help {
  margin: 0 0 9px;
  color: var(--ink-soft, #6c7f92);
  font-size: 11px;
  line-height: 1.4;
}

.spm-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spm-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #b8c7d4;
  cursor: pointer;
}

.spm-swatch.active {
  box-shadow: 0 0 0 3px var(--accent, #13a8e0);
}

/* ===== LISTE OVER FARGENE I DESIGNET ==================================== */
.spm-selected {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spm-color-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  padding: 2px 3px 7px;
}

.spm-color-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #d6e0e9;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink, #173249);
  text-align: left;
  cursor: pointer;
}

.spm-color-row.active {
  border-color: var(--accent, #13a8e0);
  box-shadow: 0 0 0 1px var(--accent, #13a8e0);
}

.spm-color-chip {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.spm-color-row strong {
  display: block;
  font-size: 12px;
}

.spm-color-row small {
  display: block;
  margin-top: 2px;
  color: #526a81;
  font-size: 10px;
  line-height: 1.3;
}

.spm-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d4dee8;
  border-radius: 50%;
  background: #fff;
  color: #9b3b31;
  font-size: 17px;
  cursor: pointer;
}

.spm-empty-color {
  padding: 13px;
  border: 1px dashed #9dc8df;
  border-radius: 8px;
  color: #607a90;
  font-size: 11px;
  text-align: center;
}

/* ===== DESIGNVINDU OG LOKALE HANDLINGER ================================= */
.spm-right {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 9px;
  min-width: 0;
  min-height: 0;
}

.spm-canvas-panel {
  position: relative;
  min-width: 0;
  overflow: auto;
  border: 2px dashed #9fc4dc;
  border-radius: 10px;
  background: #fff;
}

.spm-canvas-help {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #60778d;
  font-size: 11px;
}

.spm-canvas-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: calc(100% - 38px);
}

.spm-canvas-center canvas {
  max-width: none;
  max-height: none;
  cursor: crosshair;
}

.spm-local-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.spm-local-actions .tbtn {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 12px;
}

/* ===== PRISFOT OG FERDIGKNAPP =========================================== */
.spm-foot {
  gap: 18px;
  border-top: 1px solid var(--line, #dbe5ee);
}

.spm-price {
  font-size: 13px;
  line-height: 1.45;
}

.spm-price strong {
  font-size: 14px;
}

.spm-done {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .sp-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .spm-work {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 68vh;
    overflow: auto;
  }

  .spm-canvas-panel {
    min-height: 350px;
  }

  .sp-launch.sp-tab {
    right: 8px;
  }
}
