/* create-a-kid.css — Create a Kid builder, Nov 2026 redesign.
   Depends on site-assets/site.css (tokens, .pr-btn, .pr-badge, fonts).
   Desktop: preview card + side panel (options grid / colour grid) per the mockup.
   Phone:   stacked, options + colours become arrow carousels.
*/

.pr-cak-builder {
  max-width: 900px; margin: 0 auto; padding: 0 var(--pr-gutter, 20px) clamp(40px, 6vw, 90px);
  box-sizing: border-box; color: var(--pr-navy); font-family: var(--pr-body);
}
.pr-cak-builder *, .pr-cak-builder *::before, .pr-cak-builder *::after { box-sizing: border-box; }
.pr-cak-builder [hidden] { display: none !important; }
.pr-cak-builder.is-loading .pr-cak-controls { min-height: 340px; }

/* ---------- Step 1a: choose a list ---------- */
.pr-cak-choose { text-align: center; padding: clamp(10px, 2vw, 30px) 0 clamp(30px, 5vw, 70px); }
.pr-cak-choose__buttons { display: flex; flex-direction: column; align-items: center; gap: clamp(18px, 2.4vw, 30px); }
.pr-cak-choose__buttons .pr-btn { min-width: 0; }

/* ---------- Progress tracker ---------- */
.pr-cak-track {
  list-style: none; margin: 0 auto clamp(28px, 4vw, 46px) !important; padding: 0 !important;
  display: flex; align-items: center; justify-content: center; max-width: 900px;
}
.pr-cak-track li { position: relative; display: flex; align-items: center; flex: 0 1 auto; margin: 0 !important; }
.pr-cak-track li + li::before { content: ""; width: clamp(14px, 6vw, 56px); height: 2px; background: var(--pr-ink); display: block; }
.pr-cak-track a {
  position: relative; isolation: isolate; display: inline-block; white-space: nowrap;
  font-family: var(--pr-display); text-transform: uppercase; letter-spacing: .02em; line-height: 1;
  font-size: clamp(.9rem, .6rem + 1.3vw, 1.95rem); padding: .42em .55em .36em;
  color: var(--pr-white) !important; text-decoration: none !important;
}
.pr-cak-track a::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pr-navy);
  border: var(--pr-outline, 3px) solid var(--pr-ink); border-radius: 7px 10px 8px 11px / 11px 7px 10px 8px; filter: url(#pr-rough);
}
.pr-cak-track .is-current a::before { background: var(--pr-green-ui); }
.pr-cak-track .is-done a::before { background: var(--pr-green-ui); opacity: .75; }
.pr-cak-track a:hover::before { filter: url(#pr-rough) brightness(1.12); }

/* ---------- Stage: preview card + side panels ---------- */
.pr-cak-stage {
  display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr);
  gap: clamp(16px, 2vw, 26px); align-items: start;
}
.pr-cak-preview-card {
  position: relative; background: var(--pr-white);
  border: 2px solid #e2e2e2; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 0 rgba(0,0,0,.04);
}
.pr-cak-preview { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.pr-stack { position: absolute; inset: 0; }
.pr-layer-wrap { position: absolute; inset: 0; isolation: isolate; }
.pr-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .15s ease-in;
}
.pr-layer.loaded { opacity: 1; }
.pr-layer.error { opacity: .25; filter: grayscale(1); }
/* Colour: a flat fill masked to the part's shape, multiplied onto it */
.pr-tint {
  position: absolute; inset: 0; mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.pr-cak-type-badge {
  position: absolute; top: clamp(10px, 1.6vw, 16px); left: clamp(10px, 1.6vw, 16px); z-index: 5;
  cursor: pointer; font-size: clamp(1rem, .85rem + .5vw, 1.35rem);
}
.pr-cak-type-badge:hover { filter: brightness(1.08); }
.pr-cak-reset {
  position: absolute; top: clamp(8px, 1.4vw, 14px); right: clamp(8px, 1.4vw, 14px); z-index: 5;
  width: 44px; height: 44px; display: grid; place-items: center; padding: 6px;
  background: transparent; border: 0; border-radius: 10px; color: #555; cursor: pointer;
}
.pr-cak-reset svg { width: 32px; height: 32px; }
.pr-cak-reset:hover { color: var(--pr-ink); background: #f2f2f2; }
.pr-cak-reset.is-armed { color: var(--pr-white); background: var(--pr-red-2); animation: pr-wiggle .4s ease 2; }
@keyframes pr-wiggle { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .pr-cak-reset.is-armed { animation: none; } }

.pr-cak-controls { display: grid; gap: clamp(16px, 2vw, 22px); }
.pr-cak-panel { background: var(--pr-panel); border-radius: 14px; padding: clamp(12px, 1.5vw, 18px); }
.pr-cak-empty { margin: 1em 0; font-size: .95rem; }

/* Category navigator:  < HAIR   FACE   EYES > */
.pr-cak-catnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 14px; }
.pr-cak-catnav__current {
  position: relative; isolation: isolate; margin: 0 !important; text-align: center; white-space: nowrap;
  font-size: clamp(1.3rem, 1rem + 1vw, 2rem) !important; color: var(--pr-white) !important; padding: .32em .5em .26em;
}
.pr-cak-catnav__current::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pr-green-ui);
  border: 2px solid var(--pr-ink); border-radius: 6px; filter: url(#pr-rough);
}
.pr-cak-catnav__side {
  display: inline-flex; align-items: center; gap: 2px; justify-self: start; white-space: nowrap;
  font-family: var(--pr-display); text-transform: uppercase; font-size: clamp(.7rem, .6rem + .35vw, .95rem); line-height: 1;
  color: var(--pr-white); background: var(--pr-navy); border: 2px solid var(--pr-ink); border-radius: 6px;
  padding: .35em .45em .3em; cursor: pointer;
}
.pr-cak-catnav__side:last-child { justify-self: end; }
.pr-cak-catnav__side:hover { background: #0b5677; }
.pr-chev { width: 1.1em; height: 1.1em; flex: 0 0 auto; }

/* Scroller: grid on desktop, swipe row with arrows on phones */
.pr-cak-scroller { position: relative; }
.pr-cak-arrow { display: none; }
.pr-cak-track-x {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  max-height: 252px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 2px 2px;
  scrollbar-width: thin; scrollbar-color: var(--pr-navy) transparent;
}
.pr-cak-track-x::-webkit-scrollbar { width: 6px; }
.pr-cak-track-x::-webkit-scrollbar-thumb { background: var(--pr-navy); border-radius: 6px; }
.pr-cak-scroller--colors .pr-cak-track-x { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: none; overflow: visible; gap: 12px; }

/* Option tiles */
.pr-option {
  position: relative; aspect-ratio: 1 / 1; padding: 0; margin: 0; cursor: pointer;
  background: var(--pr-white); border: 2px solid transparent; border-radius: 4px; overflow: hidden;
  transition: border-color .12s ease, transform .12s ease;
}
.pr-option:hover { border-color: #b9c9cf; }
.pr-option.selected { border-color: var(--pr-green-ui); box-shadow: 0 0 0 1px var(--pr-green-ui); }
.pr-option:focus-visible { outline: 3px solid var(--pr-navy); outline-offset: 2px; }
.pr-option__thumb { position: absolute; inset: 6%; overflow: hidden; }
.pr-option__inner { position: absolute; inset: 0; transition: transform .2s ease; }

/* Colour swatches */
.pr-swatch {
  --swatch: #fff;
  position: relative; aspect-ratio: 1 / 1; width: 100%; padding: 0; margin: 0; cursor: pointer;
  background: var(--swatch); border: 2px solid transparent; border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  transition: transform .12s ease;
}
.pr-swatch:hover { transform: scale(1.06); }
.pr-swatch.selected { border-color: var(--pr-green-ui); box-shadow: 0 0 0 2px var(--pr-white), 0 0 0 4px var(--pr-green-ui); }
.pr-swatch:focus-visible, .pr-swatch:focus-within { outline: 3px solid var(--pr-navy); outline-offset: 2px; }
.pr-swatch--custom {
  display: block; overflow: hidden;
  background: conic-gradient(from 210deg, #ff3b3b, #ffd23b, #3bd16f, #3bc6ff, #6b5bff, #ff4fd8, #ff3b3b);
}
.pr-swatch--custom[style*="--custom: #"]::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--custom); border: 2px solid var(--pr-white); }
.pr-swatch__picker { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* ---------- Step 2 (You) / Step 3 (Confirm) panels ---------- */
.pr-cak-panel--form, .pr-cak-panel--summary { padding: clamp(16px, 2vw, 24px); }
.pr-form { display: grid; gap: 8px; }
.pr-label {
  font-family: var(--pr-display); text-transform: uppercase; font-size: 1.25rem; line-height: 1; color: var(--pr-navy); margin-top: 6px;
}
.pr-input, .pr-textarea {
  width: 100%; font: 600 1.05rem/1.4 var(--pr-body); color: var(--pr-navy);
  background: var(--pr-white); border: 2px solid var(--pr-ink); border-radius: 10px; padding: 10px 12px;
}
.pr-input:focus, .pr-textarea:focus { outline: 3px solid var(--pr-green-ui); outline-offset: 1px; }
.pr-textarea { min-height: 150px; resize: vertical; }
.pr-counter { text-align: right; font-size: .85rem; font-weight: 700; opacity: .75; }
.pr-prompts { margin-top: 8px; font-size: .95rem; }
.pr-prompts summary { cursor: pointer; font-weight: 700; color: var(--pr-red-2); }
.pr-prompts ul { margin: .5em 0 0; padding-left: 1.2em; }
.pr-cak-panel--summary { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pr-cak-summary__name { margin: .1em 0 0 !important; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem) !important; word-break: break-word; }
.pr-cak-summary__about { margin: 0 !important; white-space: pre-wrap; line-height: 1.5; font-size: 1rem; }
.pr-cak-summary__edit { margin: 6px 0 0 !important; font-weight: 700; font-size: .95rem; }

/* ---------- Footer nav ---------- */
.pr-cak-footer { margin-top: clamp(22px, 3vw, 34px); }
.pr-cak-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pr-cak-nav #pr-cak-next { margin-left: auto; }
.pr-cak-status { min-height: 1.4em; margin-top: 10px; text-align: center; font-weight: 700; color: var(--pr-red-2); }

/* ---------- Checkout form (/kid-checkout) + thanks ---------- */
.pr-cak-form {
  max-width: 640px; margin: 0 auto; display: grid; gap: 14px;
  background: var(--pr-panel); border-radius: 18px; padding: clamp(20px, 3vw, 34px);
}
.pr-cak-form label { display: grid; gap: 6px; font-family: var(--pr-display); text-transform: uppercase; font-size: 1.2rem; line-height: 1; color: var(--pr-navy); }
.pr-cak-form .pr-input, .pr-cak-form input[type="text"], .pr-cak-form input[type="email"], .pr-cak-form select {
  width: 100%; font: 600 1.05rem/1.3 var(--pr-body); text-transform: none; color: var(--pr-navy);
  background: var(--pr-white); border: 2px solid var(--pr-ink); border-radius: 10px; padding: 10px 12px;
}
.pr-cak-form__actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.pr-cak-errors {
  max-width: 640px; margin: 0 auto 16px; padding: 12px 16px; border-radius: 12px;
  background: #fff1f0; color: var(--pr-red-2); border: 2px solid var(--pr-red-2); font-weight: 700;
}
.pr-cak-thanks { text-align: center; }
.pr-cak-thanks h2 { margin: 0 0 .3em; }
.pr-cak-thanks p { margin: 0 auto 1.2em; }

/* ---------- Tablet ---------- */
@media (max-width: 820px) {
  .pr-cak-stage { grid-template-columns: 1fr; }
  .pr-cak-preview-card { max-width: 560px; width: 100%; margin: 0 auto; }
  .pr-cak-controls { max-width: 560px; width: 100%; margin: 0 auto; }
  .pr-cak-track a { font-size: clamp(.8rem, .55rem + 1.6vw, 1.2rem); }
}

/* ---------- Phone: carousels with arrows (as in the phone mockup) ---------- */
@media (max-width: 700px) {
  .pr-cak-track { display: none; }   /* the phone mockup uses the STEP button instead */
  .pr-cak-panel { padding: 12px 8px; }
  .pr-cak-catnav { grid-template-columns: auto auto auto; justify-content: center; }
  .pr-cak-scroller { padding: 0 34px; }
  .pr-cak-arrow {
    display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; padding: 0; color: var(--pr-white); background: var(--pr-navy);
    border: 2px solid var(--pr-ink); border-radius: 9px; cursor: pointer;
  }
  .pr-cak-arrow .pr-chev { width: 26px; height: 26px; }
  .pr-cak-arrow--prev { left: -6px; }
  .pr-cak-arrow--next { right: -6px; }
  .pr-cak-track-x, .pr-cak-scroller--colors .pr-cak-track-x {
    display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; gap: 10px;
    scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px;
  }
  .pr-cak-track-x::-webkit-scrollbar { display: none; }
  .pr-cak-track-x > * { flex: 0 0 calc((100% - 30px) / 4); scroll-snap-align: start; }
  .pr-cak-nav { justify-content: center; }
  .pr-cak-nav #pr-cak-next { margin-left: 0; }
}

/* the site's readable-width rule for section paragraphs shouldn't centre builder text */
.pr-cak-builder p { max-width: none; margin-inline: 0; }

/* "None" tile for optional parts (details, accessories) */
.pr-option--none .pr-option__inner { display: grid; place-items: center; }
.pr-option__none {
  font-family: var(--pr-display); text-transform: uppercase; font-size: clamp(.8rem, .7rem + .3vw, 1rem); color: #7b8a90;
  display: grid; place-items: center; width: 70%; aspect-ratio: 1; border: 2px dashed #c3ccd0; border-radius: 50%;
}

/* Start-over confirmation, shown over the preview card */
.pr-cak-confirm {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6;
  background: var(--pr-white); border: var(--pr-outline, 3px) solid var(--pr-ink); border-radius: 14px;
  padding: 16px; text-align: center; box-shadow: 0 14px 30px rgba(0,0,0,.18);
}
.pr-cak-confirm__msg { margin: 0 0 12px !important; font-weight: 700; font-size: 1rem; }
.pr-cak-confirm__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Layered parts library (Dec 2026) ---------- */
/* A COLOR layer: a solid fill seen through the part's mask (the mask's alpha is the shape). */
.pr-fill {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.pr-option__art { position: absolute; inset: 0; display: block; }
.pr-option__art .pr-layer { transition: none; }


/* Shown only while previewing the new parts before they go live */
.pr-cak-preview-note {
  max-width: 900px !important; margin: 0 auto clamp(16px, 2vw, 24px) !important; padding: 10px 16px;
  box-sizing: border-box; text-align: center; font: 500 .95rem/1.4 var(--pr-body); color: var(--pr-navy);
  background: #fff6d6; border: 2px dashed #d9b84a; border-radius: 12px;
}
.pr-cak-preview-note a { margin-left: .5em; font-weight: 700; color: var(--pr-navy); }
.pr-cak-colorslot:empty { display: none; }
.pr-cak-preview-note--edit { background: #e8f3ff; border-color: #2f80ed; }

/* A locked part's colour panel: just a note */
.pr-cak-note { margin: 0; font-size: .95rem; line-height: 1.35; }
