/* ==========================================================================
   Janković — narudžba: live cake on a stand + the choices that build it,
   then the order slip and the ways to send it
   ========================================================================== */

.build-hero { padding-bottom: var(--space-m); }

.builder { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 5vw, 6rem); padding: 0 var(--gutter) var(--space-xl); max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; }
.builder__stage { position: relative; }
.stage { position: sticky; top: calc(var(--nav-h) + 1rem); display: grid; justify-items: center; gap: 0.75rem; }
.stage__svg { width: 100%; max-height: calc(100vh - var(--nav-h) - 6rem); overflow: visible; }
.stage__caption { min-height: 3em; text-align: center; font-family: var(--f-display); font-style: italic; font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: 1.1rem; color: var(--muted); max-width: 34ch; }

/* Cake parts (colours come from gradients in <defs>, so changes glide) */
.stage stop { transition: stop-color 600ms var(--ease-out); }
.cake-tier { transform-box: fill-box; }
.cake-tier.is-new { animation: tierDrop 900ms cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes tierDrop { 0% { transform: translateY(-240px); opacity: 0; } 40% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.cake-decor { transform-box: fill-box; transform-origin: 50% 100%; animation: decorIn 600ms var(--ease-out) both; }
@keyframes decorIn { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.cake-topper { transform-box: fill-box; transform-origin: 50% 100%; animation: topperIn 800ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes topperIn { from { transform: translateY(-80px) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
.piping path { fill-opacity: 0; stroke-linecap: round; stroke-linejoin: round; }
.piping.is-piped path { animation: pipe var(--pipe-ms, 1600ms) linear forwards, pipeFill 500ms ease forwards; animation-delay: var(--pd, 0ms), calc(var(--pd, 0ms) + var(--pipe-ms, 1600ms) - 200ms); }
@keyframes pipe { to { stroke-dashoffset: 0; } }
@keyframes pipeFill { to { fill-opacity: 1; } }

/* ---------- Form ---------- */
.builder__form { display: grid; gap: 0.5rem; padding-top: 0.5rem; }
.step { border: 0; padding: 1.5rem 0 1.75rem; margin: 0; border-top: 1px solid var(--line); min-width: 0; }
.step__title { float: left; width: 100%; margin-bottom: 1rem; padding: 0; font-family: var(--f-display); font-variation-settings: 'SOFT' 100; font-weight: 380; font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.7rem); line-height: 1.1; }
.step__title .opt { font-family: var(--f-sans); font-size: 0.8rem; margin-left: 0.4rem; }
.step__title + * { clear: both; }
.step--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.step--grid .step__title, .step--grid .step__msg { grid-column: 1 / -1; }
.step__stack { display: grid; gap: 1rem; }
.step__extra { margin-top: 1rem; }
.step__hint { margin-top: 0.5rem; font-size: var(--fs-small); color: var(--muted); }
.step__msg { min-height: 1.2em; font-size: var(--fs-small); color: var(--malina); font-weight: 500; }
.input--short { width: 10rem; }
.input--script { font-family: 'Fraunces', serif; font-style: italic; font-size: 1.3rem; }

.picks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pick span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0.55rem 1.1rem; border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 0.93rem; font-weight: 500;
  transition: background-color 300ms var(--ease-out), color 300ms, box-shadow 300ms, transform var(--t-fast);
}
.pick:hover span { box-shadow: inset 0 0 0 1px var(--fg); }
.pick input:checked + span { background: var(--ganache); color: var(--cream); box-shadow: none; }
.pick input:focus-visible + span { outline: 2px solid var(--malina); outline-offset: 3px; }
.pick input:active + span { transform: scale(0.97); }
.pick--num span { justify-content: center; min-width: 58px; font-family: var(--f-display); font-size: 1.2rem; }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.swatch { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.75rem 0.5rem 0.5rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow 300ms; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch__dot { flex: none; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 45%), var(--sw); box-shadow: inset 0 0 0 1px rgba(42, 20, 13, 0.15); transition: transform 400ms var(--ease-out); }
.swatch__name { font-size: 0.88rem; font-weight: 500; line-height: 1.2; }
.swatch:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.swatch:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ganache); }
.swatch input:checked ~ .swatch__dot { transform: scale(1.12); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--malina); outline-offset: 3px; }

@media (max-width: 960px) {
  /* The live cake sticks under the nav, so the nav stays put on this page */
  body[data-page="narudzba"] .nav.is-hidden { transform: none; }
  html:has(body[data-page="narudzba"]) { scroll-padding-top: calc(var(--nav-h) + 30vh + 1.5rem); }
  .builder { grid-template-columns: 1fr; }
  .builder__stage { position: sticky; top: calc(var(--nav-h) - 8px); z-index: 5; margin-inline: calc(-1 * var(--gutter)); padding: 0.25rem var(--gutter) 0.5rem; background: var(--bg); box-shadow: 0 18px 24px -18px rgba(42, 20, 13, 0.25); }
  .stage { position: static; grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 0.75rem; }
  .stage__svg { width: auto; height: 30vh; max-height: 260px; }
  .stage__caption { text-align: left; font-size: 0.95rem; min-height: 0; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .step--grid { grid-template-columns: 1fr; }
  .stage__svg { height: 26vh; }
}

/* ---------- Order slip + send ---------- */
.send { padding: var(--space-xl) 0; }
.send__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 7rem); align-items: start; }
.ticket {
  position: relative; padding: 2.2rem 1.8rem 2rem; color: var(--ganache); transform: rotate(-1.2deg);
  background:
    radial-gradient(circle at 10px -2px, transparent 7px, #FFFBF5 7.5px) 0 0 / 20px 100% repeat-x;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.6);
}
.ticket::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: radial-gradient(circle at 10px 12px, transparent 7px, #FFFBF5 7.5px) 0 0 / 20px 10px repeat-x;
}
.ticket__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px dashed rgba(42, 20, 13, 0.3); color: var(--malina); }
.wordmark--ticket { width: 120px; }
.ticket__head span { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(42, 20, 13, 0.6); }
.ticket__text { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--f-sans); font-size: 0.95rem; line-height: 1.65; }
.send__actions { display: grid; justify-items: start; gap: 1.2rem; }
.send__msg { min-height: 1.4em; color: var(--karamel-hi); font-weight: 500; }
.send__btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.send__call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; color: var(--muted); }
.send__phones { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.send__phones a { color: var(--cream); font-weight: 600; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
@media (max-width: 860px) { .send__grid { grid-template-columns: 1fr; } .ticket { transform: none; } }
