/* Editor dresa i upit — boje dolaze iz teme (theme.json), s rezervnim vrijednostima. */
.nt-dres {
	--d-ink: var(--wp--preset--color--ink, #061A40);
	--d-accent: var(--wp--preset--color--accent, #1559D6);
	--d-paper: var(--wp--preset--color--paper, #EEF3FA);
	--d-line: var(--wp--preset--color--line, #D9E2EF);
	--d-muted: var(--wp--preset--color--muted, #52617A);
	--d-radius: 18px;
	color: var(--d-ink);
}
.nt-dres [hidden] { display: none !important; }

/* Tabovi */
/* Tabovi su u ljepljivom dijelu iznad pregleda, pa kupac uvijek vidi obje opcije */
.nt-dres-tabs { display: flex; padding: 5px; gap: 4px; background: var(--d-paper); border-radius: 8px; margin-bottom: .75rem; }
.nt-dres-tabs button { flex: 1; }
.nt-dres-tabs button {
	font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
	border: 0; background: transparent; color: var(--d-muted);
	padding: .7rem 1.35rem; border-radius: 5px;
	transition: background-color .25s, color .25s, box-shadow .25s;
}
.nt-dres-tabs button[aria-selected="true"] { background: #fff; color: var(--d-ink); box-shadow: 0 2px 10px rgba(6,26,64,.08); }

.nt-dres-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }

/* Pozornica s pregledom */
.nt-dres-stage { position: sticky; top: 110px; }
.nt-dres-preview, .nt-dres-drop {
	background: var(--d-paper); border-radius: var(--d-radius);
	padding: clamp(1rem, 3vw, 2rem); text-align: center;
}
.nt-dres-side { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border-radius: 8px; }
.nt-dres-side button {
	font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; border: 0;
	background: transparent; color: var(--d-muted); padding: .45rem 1rem; border-radius: 5px;
}
.nt-dres-side button.is-active { background: var(--d-ink); color: #fff; }
.nt-dres-canvas { max-width: 420px; margin: 1rem auto 0; perspective: 900px; }
.nt-dres-canvas svg { width: 100%; height: auto; max-height: max(300px, calc(100vh - 420px)); margin-inline: auto; display: block; overflow: visible; filter: drop-shadow(0 22px 26px rgba(6,26,64,.16)); }
.nt-dres-canvas.is-flip svg { animation: nt-dres-flip .55s cubic-bezier(.2,.7,.2,1); }
@keyframes nt-dres-flip { from { transform: rotateY(-70deg) scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
.nt-dres-note { margin: .75rem 0 0; font-size: .8rem; color: var(--d-muted); }

/* Upload */
.nt-drop {
	display: grid; justify-items: center; gap: .5rem; cursor: pointer;
	padding: clamp(2rem, 6vw, 4rem) 1rem; border: 2px dashed #B9C7DC; border-radius: 14px; background: #fff;
	transition: border-color .2s, background-color .2s;
}
.nt-drop:hover, .nt-drop.is-over { border-color: var(--d-accent); background: #F7FAFF; }
.nt-drop svg { width: 44px; height: 44px; color: var(--d-accent); }
.nt-drop strong { font-size: 1.05rem; }
.nt-drop span { font-size: .82rem; color: var(--d-muted); }
.nt-drop-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; text-align: left; }
.nt-drop-list li { display: flex; align-items: center; gap: .75rem; background: #fff; border-radius: 10px; padding: .5rem .75rem; font-size: .9rem; }
.nt-drop-list img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.nt-drop-list span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-drop-list button { font: inherit; font-size: .8rem; border: 0; background: none; color: var(--d-accent); cursor: pointer; text-decoration: underline; }

/* Kontrole */
.nt-dres-controls { display: grid; gap: 1.5rem; }
.nt-dres-editor-fields { display: grid; gap: 1.5rem; }
.nt-dres-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.nt-dres-set legend {
	padding: 0; margin-bottom: .75rem;
	font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--d-muted);
}

.nt-dres-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.nt-pattern { position: relative; cursor: pointer; }
.nt-pattern input { position: absolute; opacity: 0; pointer-events: none; }
.nt-pattern-icon {
	display: block; aspect-ratio: 1; padding: 10px; border-radius: 12px; background: var(--d-paper);
	color: var(--d-accent); --nt-ic2: #8EC5FF; border: 2px solid transparent;
	transition: border-color .2s, transform .2s;
}
.nt-pattern-icon svg { width: 100%; height: 100%; display: block; }
.nt-pattern em { display: block; margin-top: .3rem; font-style: normal; font-size: .75rem; text-align: center; color: var(--d-muted); }
.nt-pattern:hover .nt-pattern-icon { transform: translateY(-2px); }
.nt-pattern input:checked + .nt-pattern-icon { border-color: var(--d-ink); background: #fff; }
.nt-pattern input:checked ~ em { color: var(--d-ink); font-weight: 600; }
.nt-pattern input:focus-visible + .nt-pattern-icon { outline: 2px solid var(--d-accent); outline-offset: 2px; }

.nt-dres-colors { display: grid; gap: .85rem; }
.nt-color { display: grid; grid-template-columns: 9.5rem 1fr; align-items: center; gap: .75rem; }
.nt-color-label { font-size: .9rem; font-weight: 500; }
.nt-color-row { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-sw {
	position: relative; width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
	background: var(--sw); border: 1px solid rgba(6,26,64,.18);
	transition: transform .15s, box-shadow .15s;
}
.nt-sw:hover { transform: scale(1.12); }
.nt-sw.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--d-ink); }
.nt-sw-custom {
	display: inline-block; overflow: hidden;
	background: conic-gradient(#f44 0 60deg, #fd3 0 120deg, #3c6 0 180deg, #3cf 0 240deg, #36f 0 300deg, #c3f 0 360deg);
}
.nt-sw-custom.is-active { background: var(--sw); }
.nt-sw-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

.nt-dres-texts { display: grid; grid-template-columns: 1fr 5.5rem; gap: .75rem; }

/* Blokovi teksta: natpis sprijeda i ime straga, svaki sa svojom bojom i podlogom */
.nt-dres-textblock { display: grid; gap: .9rem; padding: 1.1rem 1.2rem 1.2rem !important; border: 1px solid var(--d-line) !important; border-radius: var(--d-radius); }
.nt-dres-textblock legend { padding: 0 .4rem; margin: 0 0 0 -.4rem; }
.nt-dres .nt-dres-textblock > .nt-field { margin: 0; }
.nt-toggle { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; font-size: .88rem; color: var(--d-muted); line-height: 1.45; }
.nt-toggle strong { display: block; color: var(--d-ink); font-size: .92rem; }
.nt-toggle input {
	appearance: none; -webkit-appearance: none; flex: none; margin: .1rem 0 0; cursor: pointer;
	width: 2.5rem; height: 1.45rem; border-radius: 999px; background: #C9D3E3; position: relative; transition: background-color .2s;
}
.nt-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.45rem - 6px); aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(6,26,64,.25); transition: transform .2s; }
.nt-toggle input:checked { background: var(--d-accent); }
.nt-toggle input:checked::after { transform: translateX(1.05rem); }
.nt-toggle input:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; }

/* Polja (ista kao kontakt obrazac) */
.nt-dres .nt-field { display: grid; gap: .35rem; margin: 0 0 .75rem; }
.nt-dres .nt-dres-texts .nt-field { margin: 0; }
.nt-dres .nt-field label { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.nt-dres .nt-field label span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--d-muted); }
.nt-dres .nt-field input, .nt-dres .nt-field textarea, .nt-dres .nt-field select {
	font: inherit; width: 100%; box-sizing: border-box; padding: .8rem 1rem; color: var(--d-ink);
	border: 1px solid var(--d-line); border-radius: 12px; background: #fff;
	transition: border-color .2s, box-shadow .2s;
}
.nt-dres .nt-field input:focus, .nt-dres .nt-field textarea:focus, .nt-dres .nt-field select:focus {
	outline: none; border-color: var(--d-accent); box-shadow: 0 0 0 3px rgba(21,89,214,.15);
}
.nt-dres .nt-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.nt-dres .nt-check label { display: block; position: relative; padding-left: 1.7rem; font-size: .9rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.nt-dres .nt-check input { position: absolute; left: 0; top: .2rem; width: auto; margin: 0; }
.nt-dres .nt-hp { position: absolute !important; left: -9999px !important; }
.nt-file { font: inherit; font-size: .9rem; max-width: 100%; }
.nt-dres.is-slika [data-upload-set] .nt-file { display: none; } /* u načinu "slika" koristi se veliko polje za ispuštanje */
.nt-hint { margin: .4rem 0 0; font-size: .82rem; color: var(--d-muted); }

.nt-dres-errors { border-left: 3px solid #D8342B; padding: .75rem 1rem; background: #FDF1F0; border-radius: 0 10px 10px 0; }
.nt-dres-errors p { margin: .15rem 0; }
.nt-dres-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.nt-dres-submit button { cursor: pointer; }
.nt-dres-submit button:disabled { opacity: .6; cursor: progress; }
.nt-dres-submit p { margin: 0; font-size: .85rem; color: var(--d-muted); max-width: 30ch; }
.nt-dres-alt { margin: 0; padding-top: 1rem; border-top: 1px solid var(--d-line); font-size: .92rem; }
.nt-dres-alt a { font-weight: 600; }

.nt-dres-success { background: var(--d-paper); border-radius: var(--d-radius); padding: clamp(1.5rem, 4vw, 3rem); text-align: center; }
.nt-dres-success h3 { margin-top: 0; }

@media (max-width: 900px) {
	.nt-dres-grid { grid-template-columns: 1fr; }
	.nt-dres-stage { position: static; }
	.nt-dres-canvas { max-width: 300px; }
}
@media (max-width: 560px) {
	.nt-color { grid-template-columns: 1fr; gap: .4rem; }
	.nt-dres-texts { grid-template-columns: 1fr 5rem; }
	.nt-dres .nt-field-row { grid-template-columns: 1fr; }
	.nt-dres-tabs button { flex: 1; padding: .7rem .5rem; }
}
@media (prefers-reduced-motion: reduce) {
	.nt-dres-canvas.is-flip svg { animation: none; }
}
