/* Inkloom 3D Packaging Studio — navy & gold theme */
.pk-root {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  flex-direction: column;
  background: radial-gradient(120% 120% at 50% 0%, #0e2340 0%, #081627 60%, #050f1c 100%);
  color: #f4ede0;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}
.pk-root.is-open {
  display: flex;
}

.pk-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(201, 166, 85, 0.22);
  background: rgba(6, 16, 28, 0.7);
  backdrop-filter: blur(8px);
}
.pk-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.pk-brand strong {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.pk-brand span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c9a655;
}
.pk-spacer {
  flex: 1;
}
.pk-icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(201, 166, 85, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #f4ede0;
  cursor: pointer;
}
.pk-icon-btn:hover {
  background: rgba(201, 166, 85, 0.18);
}
.pk-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.pk-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(201, 166, 85, 0.4);
  background: transparent;
  color: #f4ede0;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.pk-btn:hover {
  background: rgba(201, 166, 85, 0.14);
}
.pk-btn.is-primary {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}
.pk-btn.is-primary:hover {
  background: #d9b96a;
}
.pk-btn.is-on {
  background: rgba(201, 166, 85, 0.28);
  border-color: #c9a655;
}

.pk-body {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  min-height: 0;
}
.pk-panel {
  overflow-y: auto;
  padding: 18px 16px;
  background: rgba(8, 18, 32, 0.55);
}
.pk-panel.pk-left {
  border-right: 1px solid rgba(201, 166, 85, 0.16);
}
.pk-panel.pk-right {
  border-left: 1px solid rgba(201, 166, 85, 0.16);
}
.pk-section {
  margin-bottom: 22px;
}
.pk-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c9a655;
  margin: 0 0 10px;
}
.pk-hint {
  font-size: 12.5px;
  line-height: 1.6;
  color: #cfc7b6;
  margin: 0;
}

.pk-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.pk-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.pk-stage canvas:active {
  cursor: grabbing;
}
.pk-stage-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(6, 16, 28, 0.72);
  border: 1px solid rgba(201, 166, 85, 0.28);
  font-size: 12px;
  color: #d8d2c4;
  pointer-events: none;
}

.pk-fold {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(6, 16, 28, 0.78);
  border: 1px solid rgba(201, 166, 85, 0.32);
  backdrop-filter: blur(6px);
  z-index: 3;
}
.pk-fold-btn {
  border: 1px solid rgba(201, 166, 85, 0.5);
  background: rgba(201, 166, 85, 0.16);
  color: #f2e6c9;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.pk-fold-btn:hover {
  background: rgba(201, 166, 85, 0.28);
}
.pk-fold-range {
  width: 180px;
  accent-color: #c9a655;
  cursor: pointer;
}
.pk-fold-labels {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 10px;
  color: rgba(216, 210, 196, 0.7);
}
.pk-fold-labels span:first-child {
  margin-bottom: 1px;
}
@media (max-width: 720px) {
  .pk-fold-range {
    width: 110px;
  }
  .pk-fold-labels {
    display: none;
  }
}

.pk-field {
  margin-bottom: 12px;
}
.pk-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #d8d2c4;
  margin-bottom: 5px;
}
.pk-field input[type="number"],
.pk-field input[type="text"],
.pk-field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(201, 166, 85, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
}
.pk-field select option {
  color: #17212b;
}
.pk-dims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pk-dims .pk-field {
  margin-bottom: 0;
}

.pk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pk-chip {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(201, 166, 85, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #e8e1d2;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pk-chip.is-active {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}

.pk-title-note {
  font-weight: 500;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: #9c9482;
  margin-left: 6px;
}

.pk-unit-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 166, 85, 0.3);
  color: #e8e1d2;
  border-radius: 6px;
  font-size: 10px;
  padding: 1px 4px;
  margin-left: 2px;
}

/* 3D <-> Dieline segmented toggle overlaid on the stage */
.pk-viewmode {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  background: rgba(10, 22, 38, 0.72);
  border: 1px solid rgba(201, 166, 85, 0.35);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  backdrop-filter: blur(6px);
  z-index: 3;
}
.pk-viewmode button {
  border: 0;
  background: transparent;
  color: #cfc6b4;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.pk-viewmode button.is-active {
  background: #c9a655;
  color: #0a1626;
}

/* Visual template swatches */
.pk-chips[data-pk-templates] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  max-height: 232px;
  overflow-y: auto;
  padding-right: 4px;
}
.pk-tpl {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
}
.pk-tpl-swatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border-radius: 10px;
  border: 1px solid rgba(201, 166, 85, 0.25);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.pk-tpl:hover .pk-tpl-swatch {
  transform: translateY(-2px);
  border-color: rgba(201, 166, 85, 0.7);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.pk-tpl.is-active .pk-tpl-swatch {
  border-color: #c9a655;
  box-shadow: 0 0 0 2px #c9a655;
}
.pk-tpl-brand {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  padding: 0 4px;
}
.pk-tpl-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 2px;
}
.pk-tpl-name {
  font-size: 11px;
  font-weight: 600;
  color: #cfc6b4;
}
.pk-tpl:hover .pk-tpl-name {
  color: #fff;
}

.pk-materials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pk-mat {
  border: 1px solid rgba(201, 166, 85, 0.3);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #e8e1d2;
  background: rgba(255, 255, 255, 0.04);
}
.pk-mat .pk-mat-sw {
  height: 26px;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.pk-mat.is-active {
  outline: 2px solid #c9a655;
  outline-offset: 1px;
}

.pk-price {
  border: 1px solid rgba(201, 166, 85, 0.28);
  border-radius: 12px;
  padding: 14px;
  background: rgba(201, 166, 85, 0.08);
}
.pk-price-amount {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}
.pk-price-unit {
  font-size: 12px;
  color: #cfc7b6;
  margin-top: 2px;
}
.pk-price small {
  display: block;
  font-size: 11px;
  color: #b7ae9c;
  margin-top: 8px;
}

/* Face tabs + 2D face editor */
.pk-face-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.pk-face-tab {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(201, 166, 85, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #e8e1d2;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pk-face-tab.is-active {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}

.pk-face-wrap {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(201, 166, 85, 0.22);
  background: #11223a;
  margin-bottom: 12px;
}
.pk-face-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}
.pk-face-canvas:active {
  cursor: grabbing;
}

.pk-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pk-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
}
.pk-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #c9a655;
}

.pk-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pk-row .pk-btn {
  flex: 1 1 auto;
  text-align: center;
}
.pk-range {
  width: 100%;
}

.pk-btn.is-danger {
  border-color: rgba(220, 90, 90, 0.55);
  color: #ffb4b4;
}
.pk-btn.is-danger:hover {
  background: rgba(220, 90, 90, 0.18);
}

.pk-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pk-layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #e8edf3;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pk-layer:hover {
  background: rgba(255, 255, 255, 0.07);
}
.pk-layer.is-active {
  border-color: #c9a655;
  background: rgba(201, 166, 85, 0.14);
}
.pk-layer-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
  flex: none;
}
.pk-layer-tx {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pk-empty {
  font-size: 12.5px;
  color: rgba(232, 237, 243, 0.6);
  margin: 0;
}

.pk-onboard {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 18, 0.66);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.pk-onboard[hidden] {
  display: none;
}
.pk-onboard-card {
  max-width: 440px;
  background: linear-gradient(180deg, #101d30, #0b1626);
  border: 1px solid rgba(201, 166, 85, 0.4);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.pk-onboard-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9a655;
  margin-bottom: 8px;
}
.pk-onboard-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
  color: #f4efe3;
}
.pk-onboard-card ol {
  margin: 0 0 20px;
  padding-left: 20px;
  color: #d8d2c4;
  font-size: 14px;
  line-height: 1.5;
}
.pk-onboard-card ol li {
  margin-bottom: 10px;
}
.pk-onboard-card ol li b {
  color: #f4efe3;
}
.pk-onboard-card .pk-btn.is-primary {
  width: 100%;
  text-align: center;
  padding: 11px;
  font-size: 14px;
}

.pk-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  border-radius: 8px;
  background: #c9a655;
  color: #0a1626;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1500;
}
.pk-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pk-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #cfc7b6;
}

@media (max-width: 1040px) {
  .pk-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 46vh auto;
  }
  .pk-panel {
    max-height: 30vh;
  }
}
