/* ============================================================
   3D print i modeliranje: prikazi
   (A od skice do dijela, B orijentacija, C ispuna)
   Okvir .viz, kontrole i status su zajednički, u usluge.css.
   ============================================================ */

/* ---------- A: od skice do dijela ---------- */
.p3-sketch-fig { max-width: 760px; }
/* gumb za pauzu / ponovi stoji u kutu crteža, ne u zasebnom redu */
.viz[data-viz="sketch"] > .viz-controls, .viz[data-viz="orient"] > .viz-controls { position: absolute; top: 0.75rem; right: 0.75rem; margin: 0; z-index: 2; }
.p3-pencil { fill: none; stroke: var(--text-muted); stroke-width: 1.6; stroke-dasharray: 7 5; stroke-linecap: round; }
.p3-pencil--dim { stroke-width: 1.1; opacity: 0.65; stroke-dasharray: 4 4; }
.p3-dim { fill: var(--text-muted); font-size: 15px; font-weight: 600; }
.p3-wire path { fill: none; stroke: var(--electric-blue); stroke-width: 1.4; stroke-linejoin: round; }
.p3-face { stroke: rgba(212, 175, 55, 0.85); stroke-width: 1; stroke-linejoin: round; }
.p3-face--z { fill: rgba(212, 175, 55, 0.5); }
.p3-face--x { fill: rgba(212, 175, 55, 0.28); }
.p3-face--y { fill: rgba(212, 175, 55, 0.38); }
.p3-face.is-done { stroke: rgba(26, 26, 26, 0.35); }
.p3-face--z.is-done { fill: #e6c763; }
.p3-face--x.is-done { fill: #9d7d26; }
.p3-face--y.is-done { fill: #bf9a33; }
.p3-hole { fill: #161616; stroke: rgba(26, 26, 26, 0.5); }
.p3-layers { fill: none; stroke: rgba(26, 26, 26, 0.5); stroke-width: 0.8; }
.p3-nozzle path:first-child { fill: #d8d3c4; stroke: #1a1a1a; stroke-width: 1; }
.p3-nozzle__heat { stroke: var(--vlan-99, #ff8c42); stroke-width: 2; }
.p3-phase { fill: var(--text-light); font-size: 16px; font-weight: 700; }
.p3-steps { list-style: none; counter-reset: p3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; padding: 0; margin: 0.8rem 0 0; }
.p3-steps li {
  counter-increment: p3;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 3px solid rgba(212, 175, 55, 0.18);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.p3-steps li::before { content: counter(p3) " · "; font-weight: 700; }
.p3-steps li.is-done { border-top-color: rgba(212, 175, 55, 0.5); }
.p3-steps li.is-active { border-top-color: var(--electric-blue); color: var(--text-light); font-weight: 600; }
.is-strip .p3-steps li { border-top-color: rgba(212, 175, 55, 0.5); }

/* ---------- B: orijentacija je čvrstoća ---------- */
.p3-or-wall { fill: url(#p3-hatch); stroke: rgba(233, 202, 165, 0.35); }
.p3-or-body { fill: #c9a43a; }
.p3-or-screw { fill: #1a1a1a; stroke: rgba(255, 255, 255, 0.25); }
.p3-or-arm, .p3-or-arrow, .p3-or-crack, .p3-or-mark {
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}
.p3-or-arm { transform-box: fill-box; transform-origin: 0% 100%; }
.p3-or-arrow { transform: translateY(-26px); opacity: 0; }
.p3-or-arrow path { fill: none; stroke: var(--text-light); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.p3-or-arrow text { fill: var(--text-light); font-size: 16px; font-weight: 700; }
.p3-or-crack { opacity: 0; stroke: var(--bad, #ff5a4f); stroke-width: 2.5; stroke-dasharray: 4 3; fill: none; }
.p3-or-mark { opacity: 0; }
/* strelica se spusti i prati kraj kraka dok se savija */
.is-run .p3-or-arrow--ok { animation: p3-arrow-ok 1.3s ease forwards; }
.is-run .p3-or-arrow--bad { animation: p3-arrow-bad 1.3s ease forwards; }
@keyframes p3-arrow-ok { 0% { transform: translateY(-26px); opacity: 0; } 38% { transform: none; opacity: 1; } 100% { transform: translateY(5px); opacity: 1; } }
@keyframes p3-arrow-bad { 0% { transform: translateY(-26px); opacity: 0; } 38% { transform: none; opacity: 1; } 100% { transform: translateY(23px); opacity: 1; } }
.is-run .p3-or-arm--ok { transform: rotate(1.5deg); transition-delay: 0.5s; }
.is-run .p3-or-arm--bad { transform: rotate(7deg); transition-delay: 0.5s; }
.is-run .p3-or-crack { opacity: 1; transition-delay: 1s; }
.is-run .p3-or-mark { opacity: 1; transition-delay: 1.3s; }
.is-instant .p3-or-arm, .is-instant .p3-or-arrow, .is-instant .p3-or-crack, .is-instant .p3-or-mark { transition: none !important; }
.is-instant.is-run .p3-or-arrow { animation: none; opacity: 1; }
.is-instant.is-run .p3-or-arrow--ok { transform: translateY(5px); }
.is-instant.is-run .p3-or-arrow--bad { transform: translateY(23px); }
.p3-or-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.4rem; text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.p3-or-caps strong { display: block; color: var(--text-light); }
.p3-or-caps .is-ok strong { color: var(--ok, #3ecf6e); }
.p3-or-caps .is-bad strong { color: var(--bad, #ff5a4f); }

/* ---------- C: ispuna ---------- */
.p3-infill-grid { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 1.5rem; align-items: center; }
.p3-infill-svg { max-width: 280px; margin: 0 auto; }
.p3-part-bg { fill: #141414; }
.p3-walls rect { fill: none; stroke: var(--electric-blue); stroke-width: 5; }
.p3-inner { fill: #141414; }
.p3-infill { fill: none; stroke: rgba(212, 175, 55, 0.7); stroke-linecap: square; }
.p3-infill.is-solid { fill: rgba(212, 175, 55, 0.7); stroke: none; }
.p3-range-row { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.4rem; }
.p3-range-row label { font-size: 0.82rem; color: var(--text-muted); min-width: 4.8rem; }
.p3-range-row output { font-weight: 700; color: var(--text-light); min-width: 3.5rem; text-align: right; }
.p3-range { flex: 1; min-height: 44px; accent-color: var(--electric-blue); cursor: pointer; }
.p3-infill-hint { font-size: 1.05rem; font-weight: 650; color: var(--text-light); margin: 0.2rem 0 1rem; min-height: 1.6em; }
@media (max-width: 575.98px) { .p3-infill-grid { grid-template-columns: 1fr; } }

/* projekt s vodoravnom slikom (3D model police) */
.p3-media--contain { background: #2a2f36; }
.p3-media--contain img { object-fit: contain; }

/* ---------- smanjeno kretanje ---------- */
@media (prefers-reduced-motion: reduce) {
  .p3-steps li { transition: none; }
}
