.w2i-popdsgn-open {
  cursor: pointer;
}

body.w2i-popdsgn-open {
  overflow: hidden;
}

#w2i-popdsgn {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: #fff;
}

/* Above the designer's full-page boot overlay (z-index 1000002 on body). */
#w2i-popdsgn.is-open {
  z-index: 2147483000;
}

/* Background load must not cover the page or eat clicks (color swatches, etc.). */
body:not(.w2i-popdsgn-open) > #w2i-boot-loader,
body:not(.w2i-popdsgn-open) > div.w2i-spinner,
body:not(.w2i-popdsgn-open) > div.spinner,
body:not(.w2i-popdsgn-open) > .messagebox {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Keep a real viewport size for the designer's breakpoint check, but stay off the page. */
#w2i-popdsgn:not(.is-open),
#w2i-popdsgn[hidden] {
  display: block !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
  transform: translate3d(-120vw, 0, 0) !important;
  clip-path: inset(100%) !important;
}

#w2i-popdsgn.is-open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 2147483646 !important;
}

#w2i-popdsgn:not(.is-open),
#w2i-popdsgn:not(.is-open) * {
  pointer-events: none !important;
}

#w2i-popdsgn .w2i-popdsgn-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: auto;
  background: #fff;
}

#w2i-popdsgn .w2i-popdsgn-stage #web2ink {
  min-height: 100%;
}

#w2i-popdsgn > .w2i-popdsgn-x {
  display: none !important;
}

#w2i-popdsgn #web2inkdesigner .w2i-canvas-rail > #w2i-popdsgn-close {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin: 0 0 0 8px;
  padding: 0 !important;
  border: 0;
  border-radius: 8px;
  background: #dc3545 !important;
  color: #fff !important;
  z-index: 3;
  pointer-events: auto !important;
}

#web2inkdesigner.w2i-large .w2i-canvas-rail > #w2i-popdsgn-close,
#web2inkdesigner.w2i-medium .w2i-canvas-rail > #w2i-popdsgn-close,
#web2inkdesigner.w2i-small .w2i-canvas-rail > #w2i-popdsgn-close {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0 !important;
}

#w2i-popdsgn-close[hidden] {
  display: none !important;
}

#w2i-popdsgn.is-qty {
  background: rgba(15, 23, 42, 0.55);
}

#w2i-popdsgn.is-qty .w2i-popdsgn-stage,
#w2i-popdsgn.is-qty > .w2i-popdsgn-x {
  visibility: hidden;
  pointer-events: none;
}

#w2i-popdsgn .w2i-popdsgn-qty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
  pointer-events: none;
}

#w2i-popdsgn .w2i-popdsgn-dialog,
#w2i-popdsgn .w2i-popdsgn-dialog .w2i-popdsgn-x {
  pointer-events: auto;
}

#w2i-popdsgn .w2i-popdsgn-qty[hidden] {
  display: none !important;
}

#w2i-popdsgn .w2i-popdsgn-dialog {
  position: relative;
  display: flex;
  gap: 24px;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 24px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

#w2i-popdsgn .w2i-popdsgn-dialog > .w2i-popdsgn-x {
  position: absolute;
  top: 8px;
  right: 8px;
}

#w2i-popdsgn .w2i-popdsgn-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#w2i-popdsgn .w2i-popdsgn-preview {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 240px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
}

#w2i-popdsgn .w2i-popdsgn-preview img.w2i-popdsgn-shot {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

#w2i-popdsgn .w2i-popdsgn-sides {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#w2i-popdsgn .w2i-popdsgn-sides button {
  width: 56px;
  height: 56px;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

#w2i-popdsgn .w2i-popdsgn-sides button.is-selected {
  border-color: #0f172a;
}

#w2i-popdsgn .w2i-popdsgn-sides img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#w2i-popdsgn .w2i-popdsgn-sizes {
  flex: 1 1 auto;
  min-width: 0;
}

#w2i-popdsgn .w2i-popdsgn-sizes table {
  width: 100%;
  border-collapse: collapse;
}

#w2i-popdsgn .w2i-popdsgn-sizes th,
#w2i-popdsgn .w2i-popdsgn-sizes td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

#w2i-popdsgn .w2i-popdsgn-sizes input[type="number"],
#w2i-popdsgn .w2i-popdsgn-sizes select {
  width: 96px;
  max-width: 100%;
}

#w2i-popdsgn .w2i-popdsgn-min,
#w2i-popdsgn .w2i-popdsgn-msg {
  margin: 12px 0 0;
  font-size: 14px;
}

#w2i-popdsgn .w2i-popdsgn-msg {
  color: #b91c1c;
}

#w2i-popdsgn .w2i-popdsgn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

#w2i-popdsgn .w2i-popdsgn-status {
  margin: 0;
  color: #64748b;
}

@media (max-width: 720px) {
  #w2i-popdsgn .w2i-popdsgn-dialog {
    flex-direction: column;
  }
  #w2i-popdsgn .w2i-popdsgn-preview {
    flex-basis: auto;
  }
}
