/* ==========================================================================
   namule.com — 4" x 7" Interactive Sticker Sheet Designer
   ========================================================================== */

.nm-designer {
  --nm-ink: #1A1826;
  --nm-muted: #5C5772;
  --nm-border: #E4DCFF;
  --nm-surface: #F7F4FF;
  --nm-purple: #7C4DFF;
  --nm-purple-dark: #6030EB;
  --nm-pink: #FF7A9C;
  --nm-gold: #FFC234;
  --nm-green: #30B866;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--nm-ink);
  background: #FFFFFF;
  border: 2px solid var(--nm-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(36, 23, 68, 0.08);
}

.nm-designer *,
.nm-designer *::before,
.nm-designer *::after {
  box-sizing: border-box;
}

.nm-d-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--nm-border);
}

.nm-d-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nm-d-badge {
  background: #EFE9FF;
  color: var(--nm-purple);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.nm-d-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.nm-d-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--nm-muted);
  background: var(--nm-surface);
  padding: 6px 12px;
  border-radius: 999px;
}

.nm-d-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: 18px;
  align-items: start;
}

/* Sheet Stage (Left) */
.nm-d-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(#E3DAFF 1px, transparent 1px) 0 0 / 16px 16px,
    #FBF9FF;
  border: 2px dashed #CFC0FF;
  border-radius: 20px;
  padding: 18px 14px 16px;
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.nm-d-stage-wrap.is-dragover {
  border-color: var(--nm-purple);
  background-color: #F0E9FF;
}

.nm-d-ruler-top {
  width: 100%;
  max-width: 340px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--nm-purple);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.nm-d-canvas-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 7;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(36, 23, 68, 0.16), 0 0 0 1px rgba(124, 77, 255, 0.14);
  overflow: hidden;
  touch-action: none;
}

.nm-d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.nm-d-empty-hint {
  position: absolute;
  inset: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 20px;
  color: var(--nm-muted);
}

.nm-d-empty-hint strong {
  color: var(--nm-ink);
  font-size: 15px;
  margin-bottom: 6px;
}

.nm-d-empty-hint span {
  font-size: 13px;
  max-width: 220px;
}

.nm-d-stage-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--nm-muted);
  text-align: center;
}

/* Controls Panel (Right) */
.nm-d-controls {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.nm-d-card {
  background: #FFFFFF;
  border: 1px solid var(--nm-border);
  border-radius: 16px;
  padding: 12px 14px;
}

.nm-d-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nm-muted);
  margin-bottom: 10px;
}

.nm-d-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nm-d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1.5px solid var(--nm-border);
  background: #FFFFFF;
  color: var(--nm-ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.nm-d-btn:hover:not(:disabled) {
  border-color: var(--nm-purple);
  background: var(--nm-surface);
}

.nm-d-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.nm-d-btn-primary {
  background: var(--nm-purple);
  border-color: var(--nm-purple);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.25);
}

.nm-d-btn-primary:hover:not(:disabled) {
  background: var(--nm-purple-dark);
  border-color: var(--nm-purple-dark);
}

.nm-d-btn-danger {
  color: #C92A4C;
  border-color: #FFD2DC;
  background: #FFF6F8;
}

.nm-d-btn-danger:hover:not(:disabled) {
  background: #FFE8EE;
  border-color: #FF8AA2;
}

/* Pill Groups */
.nm-d-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nm-d-pill {
  border: 1.5px solid var(--nm-border);
  background: #FFFFFF;
  color: var(--nm-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.nm-d-pill:hover {
  border-color: var(--nm-purple);
}

.nm-d-pill.is-active {
  background: var(--nm-purple);
  border-color: var(--nm-purple);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.25);
}

/* Segmented Border Toggle */
.nm-d-seg {
  display: inline-flex;
  background: var(--nm-surface);
  border: 1.5px solid var(--nm-border);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}

.nm-d-seg button {
  border: 0;
  background: transparent;
  color: var(--nm-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.nm-d-seg button.is-active {
  background: #FFFFFF;
  color: var(--nm-purple-dark);
  box-shadow: 0 2px 8px rgba(36, 23, 68, 0.12);
}

.nm-d-help {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--nm-muted);
  line-height: 1.45;
}

.nm-d-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nm-d-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nm-d-status {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--nm-green);
}

.nm-d-json-box {
  margin-top: 10px;
  background: #1B162B;
  color: #E7DEFF;
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  max-height: 150px;
  overflow: auto;
  display: none;
}

.nm-d-json-box.is-open {
  display: block;
}

@media (max-width: 820px) {
  .nm-d-layout {
    grid-template-columns: 1fr;
  }
  .nm-d-canvas-frame {
    max-width: 300px;
  }
}

/* Conflict banner */
.nm-d-conflict {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #FFF1F3;
  border: 1.5px solid #FFC1CB;
  color: #B01532;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  max-width: 340px;
}
.nm-d-conflict.is-visible {
  display: block;
}
.nm-d-status.is-error {
  color: #B01532;
}

/* Colour swatches */
.nm-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.nm-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #E4DCFF;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(36, 23, 68, 0.12);
}
.nm-swatch.is-active {
  box-shadow: 0 0 0 3px #7C4DFF;
  border-color: #FFFFFF;
}
.nm-swatch-picker {
  position: relative;
  overflow: hidden;
  background: conic-gradient(#ff5a5a, #ffc234, #3ecf6e, #5fb3ff, #7c4dff, #ff5a5a);
}
.nm-swatch-picker input[type="color"] {
  position: absolute;
  inset: -4px;
  width: 36px;
  height: 36px;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

/* Quality bar */
.nm-quality-track {
  height: 8px;
  border-radius: 999px;
  background: #EDE8FF;
  overflow: hidden;
  margin-top: 6px;
}
.nm-quality-fill {
  height: 100%;
  border-radius: 999px;
}
.nm-quality-fill.is-good { background: #30B866; }
.nm-quality-fill.is-ok { background: #FFC234; }
.nm-quality-fill.is-low { background: #E11D3C; }

/* Consent checkbox (buy box + product page) */
.nm-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1.5px solid #E4DCFF;
  border-radius: 14px;
  background: #FBF9FF;
  font-size: 12.5px;
  line-height: 1.45;
  color: #3E3954;
  cursor: pointer;
}
.nm-consent input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #7C4DFF;
}
.nm-consent a {
  color: #7C4DFF;
  font-weight: 800;
  text-decoration: underline;
}

/* Disabled Add to Cart */
.demo-cta:disabled,
.demo-cta.is-disabled,
.single-product.woocommerce div.product form.cart .single_add_to_cart_button:disabled,
.single-product.woocommerce div.product form.cart .single_add_to_cart_button.is-disabled {
  background: #C9C3D8 !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

.nm-d-btn:disabled,
.nm-d-btn-primary:disabled {
  opacity: 1;
  background: #C9C3D8 !important;
  border-color: #C9C3D8 !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.nm-d-photo-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: #4A2DB3;
  line-height: 1.35;
}
.nm-d-stage-wrap .nm-d-photo-hint {
  margin: 8px 0 0;
  text-align: center;
}
.nm-d-seg button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.nm-d-canvas {
  touch-action: none;
}

/* 1.0.8: honour [hidden] on designer buttons (Replace photo) */
.nm-d-btn[hidden] { display: none !important; }
