/* ==========================================================================
   NobleNeedle — Embroidery Configurator (integrated build)
   Adapted from the studio prototype to live inside the storefront.
   ========================================================================== */
.nn-config { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.nn-config-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); }
.nn-config-head .h-title { font-family: var(--serif); font-size: 1.4rem; color: var(--cream); }
.nn-config-head .h-badge { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(201,168,76,.3); border-radius: 999px; padding: 6px 14px; }
.nn-3d-toggle { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(201,168,76,.45); border-radius: 999px; padding: 7px 15px; cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.nn-3d-toggle:hover { background: rgba(201,168,76,.12); }
.nn-3d-toggle[data-loading] { opacity: .55; pointer-events: none; }

.nn-body { display: grid; grid-template-columns: 1fr 360px; min-height: 600px; }

/* Canvas */
.nn-canvas { background: radial-gradient(120% 100% at 50% 10%, rgba(201,168,76,.06), transparent 60%), var(--bg-2); display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; border-right: 1px solid var(--line); }
.nn-garment-wrap { position: relative; width: 300px; height: 346px; transition: transform var(--t) var(--ease); }
.nn-3d { position: relative; width: 100%; max-width: 460px; height: 380px; cursor: grab; touch-action: none; }
.nn-3d:active { cursor: grabbing; }
/* canvas fills the host absolutely so it never forces the layout wider than the screen */
.nn-3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; border-radius: 14px; }
@media (max-width: 860px) { .nn-3d { height: 320px; } }
.nn-color-dot-active { filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }

.nn-patch-zone { position: absolute; border: 1.5px dashed rgba(201,168,76,.3); border-radius: 5px; cursor: pointer; transition: border-color var(--t), background var(--t); display: flex; align-items: center; justify-content: center; }
.nn-patch-zone:hover, .nn-patch-zone.active { border-color: var(--gold); background: rgba(201,168,76,.09); }
.nn-patch-zone .zone-label { font-size: 9px; color: rgba(201,168,76,.55); letter-spacing: .12em; text-transform: uppercase; text-align: center; line-height: 1.3; pointer-events: none; }
.nn-patch-zone.active .zone-label { color: var(--gold); }

.nn-emblem { position: absolute; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity var(--t); overflow: hidden; }
.nn-emblem.visible { opacity: 1; }
.nn-emblem img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }

.nn-canvas-hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--text-5); letter-spacing: .1em; text-transform: uppercase; }

/* Panel */
.nn-panel { background: var(--bg-1); padding: 26px 22px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; max-height: 720px; }
.nn-section-title { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-4); margin-bottom: 12px; display:flex; align-items:center; justify-content:space-between; }
.nn-section-title .hint { color: var(--text-5); letter-spacing: .04em; }

.nn-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.nn-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }

.nn-opt-btn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 6px; cursor: pointer; text-align: center; transition: border-color var(--t), background var(--t); color: var(--text); }
.nn-opt-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.nn-opt-btn.active { border-color: var(--gold); background: rgba(201,168,76,.07); }
.nn-opt-btn .g-icon { display: grid; place-items: center; margin-bottom: 5px; color: var(--text-2); }
.nn-opt-btn .g-icon svg { width: 22px; height: 22px; }
.nn-opt-btn.active .g-icon { color: var(--gold); }
.nn-opt-btn .g-name { font-size: 10px; color: var(--text-3); letter-spacing: .04em; }
.nn-opt-btn.active .g-name { color: var(--gold); }

/* Color swatches */
.nn-colors { display: flex; gap: 9px; flex-wrap: wrap; }
.nn-color { width: 34px; height: 34px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-2); position: relative; transition: transform var(--t); }
.nn-color:hover { transform: scale(1.1); }
.nn-color.active { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 3px var(--gold); }

/* Upload */
.nn-upload-btn { background: var(--surface); border: 1px dashed rgba(201,168,76,.4); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color var(--t), background var(--t); width: 100%; color: var(--text); }
.nn-upload-btn:hover { border-color: var(--gold); background: rgba(201,168,76,.05); }
.nn-upload-btn .u-icon { color: var(--gold); display:grid; place-items:center; }
.nn-upload-btn .u-icon svg { width: 22px; height: 22px; }
.nn-upload-btn .u-title { font-size: 12px; color: var(--gold); font-weight: 500; text-align: left; }
.nn-upload-btn .u-sub { font-size: 10px; color: var(--text-4); margin-top: 2px; text-align: left; }
.nn-upload-clear { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; font-size: 11px; color: var(--danger); width: 100%; transition: border-color var(--t); margin-top: 8px; display:flex; align-items:center; justify-content:center; gap:6px; }
.nn-upload-clear:hover { border-color: var(--danger); }
.nn-upload-clear svg { width: 14px; height: 14px; }

/* Size / zone buttons */
.nn-size-btn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 10px; cursor: pointer; transition: border-color var(--t), background var(--t); text-align: left; }
.nn-size-btn:hover { border-color: var(--line-2); }
.nn-size-btn.active { border-color: var(--gold); background: rgba(201,168,76,.07); }
.nn-size-btn .s-dim { font-size: 13px; font-weight: 400; color: var(--cream); }
.nn-size-btn.active .s-dim { color: var(--gold); }
.nn-size-btn .s-price { font-size: 11px; color: var(--text-4); margin-top: 2px; }
.nn-size-btn.active .s-price { color: var(--gold-deep); }

.nn-zones-list { display: flex; flex-direction: column; gap: 7px; }
.nn-zone-btn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: border-color var(--t), background var(--t); }
.nn-zone-btn:hover { border-color: var(--line-2); }
.nn-zone-btn.active { border-color: var(--gold); background: rgba(201,168,76,.07); }
.nn-zone-btn .z-name { font-size: 12px; color: var(--text-2); }
.nn-zone-btn.active .z-name { color: var(--gold); }
.nn-zone-btn .z-hint { font-size: 10px; color: var(--text-5); }
.nn-zone-btn.active .z-hint { color: var(--gold-deep); }

.nn-divider { height: 1px; background: var(--line); }

/* Total + qty */
.nn-total { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.nn-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nn-total-label { font-size: 11px; color: var(--text-4); letter-spacing: .06em; }
.nn-total-val { font-size: 13px; color: var(--text-2); text-align: right; }
.nn-qty-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.nn-total-price { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--gold); text-align: right; margin-top: 6px; }
.nn-total-price .per { font-family: var(--sans); font-size: 11px; color: var(--text-4); letter-spacing: .06em; }

.nn-footer-note { font-size: 10px; color: var(--text-5); text-align: center; letter-spacing: .06em; }
.nn-price-from { font-size: 11px; color: var(--gold-deep); text-align: right; margin-top: 4px; letter-spacing: .04em; }

@media (max-width: 860px) {
  .nn-body { grid-template-columns: 1fr; }
  .nn-canvas { border-right: none; border-bottom: 1px solid var(--line); padding: 30px; }
  .nn-panel { max-height: none; }
}
