/* 3D designer page (sits under the site nav). */
.designer-page { overflow: hidden; }
.app { display: grid; grid-template-columns: 1fr 400px; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); }

.stage { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #f5f5f7 55%, #e8e8ed 100%); }
.viewport { position: absolute; inset: 0; cursor: grab; }
.viewport:active { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; transition: opacity .4s; background: var(--bg-2); }
.loading.done { opacity: 0; pointer-events: none; }
.tip { position: absolute; pointer-events: none; background: rgba(29,29,31,.9); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 8px; transform: translate(14px, 14px); white-space: nowrap; }

.viewbar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-radius: 980px; box-shadow: 0 2px 12px rgba(0,0,0,.08); max-width: calc(100% - 24px); overflow-x: auto; }
.viewbar button { border: 0; background: transparent; padding: 6px 14px; border-radius: 980px; font-size: 12px; color: var(--ink); white-space: nowrap; }
.viewbar button:hover { background: rgba(0,0,0,.06); }

.rotbar { position: absolute; left: 16px; bottom: 16px; display: grid; gap: 6px; padding: 10px; background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.axis, .zoom { display: grid; grid-template-columns: 40px 32px 52px 32px; gap: 4px; align-items: center; }
.zoom { grid-template-columns: 32px 1fr 32px; margin-top: 2px; }
.axis span { font-size: 11px; color: var(--ink-2); font-weight: 500; }
.rotbar button { height: 30px; border: 0; background: rgba(0,0,0,.05); border-radius: 8px; font-size: 14px; color: var(--ink); }
.rotbar button:hover { background: rgba(0,0,0,.1); }
.rotbar .spin { font-size: 11px; font-weight: 500; }
.rotbar .spin.on { background: var(--ink); color: #fff; }
.hint { position: absolute; right: 18px; bottom: 14px; margin: 0; font-size: 12px; color: var(--ink-3); }

.panel { background: #fff; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 20px 4px; }
.panel-title { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.panel-head p { margin: 2px 0 0; }
.head-actions { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg-2); font-size: 16px; color: var(--ink); }
.icon-btn:hover { background: var(--line-2); }
.preset { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-size: 13px; color: var(--ink-2); }
.preset .input { min-height: 36px; padding: 6px 10px; font-size: 14px; flex: 1; }
.tabs { margin: 8px 20px 0; display: flex; }
.tabs button { flex: 1; }
.tab { padding: 14px 20px 20px; overflow-y: auto; flex: 1; min-height: 0; }

.editor { background: var(--bg-2); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.editor h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.editor .note { margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }
.sidetoggle { display: flex; gap: 2px; margin-bottom: 12px; background: rgba(0,0,0,.05); border-radius: 9px; padding: 2px; }
.sidetoggle button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.sidetoggle button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 500; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-bottom: 12px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); padding: 0; position: relative; }
.sw.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--blue); }
.custom { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--ink-2); }
.custom input[type=color] { width: 36px; height: 30px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.custom input[type=text] { width: 92px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.finishes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 980px; padding: 5px 12px; font-size: 12px; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.seglist h4 { margin: 16px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.seg { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px; border-radius: 10px; text-align: left; font-size: 14px; color: var(--ink); }
.seg:hover { background: var(--bg-2); }
.seg.on { background: #e8f1fd; }
.seg .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.12); overflow: hidden; display: flex; }
.seg .dot i { flex: 1; }
.seg .nm { flex: 1; }
.seg .fn { color: var(--ink-3); font-size: 12px; }
.check { margin-top: 14px; }

.textfield { background: var(--bg-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.textfield h4 { margin: 0; font-size: 14px; font-weight: 600; }
.textfield .r { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.textfield input[type=text], .textfield select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; font-size: 15px; }
.textfield input[type=color] { height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.pattern svg { width: 100%; height: auto; display: block; background: var(--bg-2); border-radius: 14px; }
.pattern .fill { stroke: none; }
.pattern .outline { fill: none; stroke: #c7c7cc; stroke-width: 2.5; }
.pattern .piece { cursor: pointer; }
.pattern .piece:hover .outline, .pattern .piece.sel .outline { stroke: var(--blue); stroke-width: 6; }
.pattern .label { font-size: 38px; font-weight: 500; fill: var(--ink-2); font-family: var(--font); pointer-events: none; }
.pattern .label.halo { fill: var(--ink); stroke: var(--bg-2); stroke-width: 10px; stroke-linejoin: round; }
.pattern .centerline { stroke: #c7c7cc; stroke-width: 2; }

.buybar { border-top: 1px solid var(--line-2); padding: 14px 20px 16px; background: rgba(255,255,255,.96); }
.buy-row { display: grid; grid-template-columns: 1fr 76px auto; gap: 10px; align-items: end; }
.buy-row .field { margin: 0; }
.buy-row .input { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.buy-price { display: grid; gap: 4px; text-align: right; }
.buy-price strong { font-size: 21px; font-weight: 600; line-height: 40px; }
.price-detail { margin: 8px 0 12px; font-size: 12px; color: var(--ink-2); }
.price-detail summary { cursor: pointer; color: var(--link); }
.price-detail table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.price-detail td { padding: 3px 0; }
.price-detail td:last-child { text-align: right; color: var(--ink); white-space: nowrap; }
.buy-links { display: flex; justify-content: center; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); font-size: 13px; }
.linklike:hover { text-decoration: underline; }
#buyMsg { text-align: center; margin: 6px 0 0; min-height: 15px; }

@media (max-width: 900px) {
  .designer-page { overflow: auto; }
  .app { grid-template-columns: 1fr; grid-template-rows: 56vh auto; height: auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line-2); }
  .tab { max-height: none; overflow: visible; }
  .buybar { position: sticky; bottom: 0; box-shadow: 0 -4px 20px rgba(0,0,0,.08); padding: 10px 16px 12px; z-index: 5; }
  .buybar .label { display: none; }
  .buy-row { grid-template-columns: 1fr 64px auto; }
  .buy-price strong { font-size: 19px; }
  .price-detail { display: none; }
  #addToBag { margin-top: 10px; }
  .buy-links { margin-top: 6px; gap: 14px; }
  .rotbar { left: 8px; bottom: 8px; padding: 6px; transform-origin: left bottom; transform: scale(.85); }
  .hint { display: none; }
}

/* factory spec sheet overlay (staff) */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: grid; grid-template-rows: auto 1fr; padding: 16px; backdrop-filter: blur(6px); }
.sheet-bar { display: flex; align-items: center; gap: 8px; background: #fff; padding: 10px 14px; border-radius: 14px 14px 0 0; }
.sheet-bar span { flex: 1; }
.sheet-bar .primary, .sheet-bar .ghost { border-radius: 980px; padding: 7px 16px; border: 0; font-size: 14px; }
.sheet-bar .primary { background: var(--blue); color: #fff; } .sheet-bar .ghost { background: var(--bg-2); }
.sheet-overlay iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 0 0 14px 14px; }

/* skate plate picker */
.plate-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plate-opt { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: var(--bg-2); border: 2px solid transparent; border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; color: inherit; }
.plate-opt:hover { border-color: var(--line, #d2d2d7); }
.plate-opt.on { border-color: var(--blue, #0071e3); background: #fff; }
.plate-sw { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid rgba(0,0,0,.1);
  display: grid; place-items: center; color: #86868b; font-weight: 600; box-shadow: inset 0 8px 14px rgba(255,255,255,.35), inset 0 -8px 12px rgba(0,0,0,.25); }
.plate-opt:first-child .plate-sw { box-shadow: none; }
.plate-name { font-weight: 600; font-size: 15px; }
.plate-price { font-size: 13px; color: #6e6e73; }
.opt-head { margin: 22px 0 2px; font-size: 17px; font-weight: 600; }
.wheel-sw { border-radius: 50%; position: relative; }
.wheel-sw[style]::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle, #d8d9dc 0 28%, #111 30% 100%); }
.plate-name small { font-weight: 500; color: #6e6e73; font-size: 12px; }

/* build parts: Boot · Plate · Wheels (Boot has its own Colours / Personalize / Pattern tabs) */
.parts { display: flex; gap: 4px; margin: 10px 20px 0; border-bottom: 1px solid var(--line-2, #e8e8ed); }
.parts button { flex: 1; position: relative; border: 0; background: none; padding: 10px 6px 11px; font-size: 16px; font-weight: 500; color: var(--ink-2, #6e6e73); cursor: pointer; }
.parts button:hover { color: var(--ink, #1d1d1f); }
.parts button[aria-selected="true"] { color: var(--ink, #1d1d1f); font-weight: 600; }
.parts button[aria-selected="true"]::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink, #1d1d1f); }
.part-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue, #0071e3); margin-left: 6px; vertical-align: middle; }
.part-dot[hidden] { display: none; }
#bootTabs[hidden] { display: none; }
.next-step { margin-top: 14px; }
/* factory chart leathers: swatch photo + exact chart name */
.lea-cur { font-weight: 600; margin: 4px 0 10px; }
.leathers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin-bottom: 12px; }
.lea { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; font: inherit; font-size: 12.5px; line-height: 1.2; color: inherit; cursor: pointer; min-width: 0; }
.lea:hover { background: rgba(0,0,0,.04); }
.lea.on { border-color: var(--blue); background: rgba(0,113,227,.06); }
.lea-sw { flex: none; width: 30px; height: 30px; border-radius: 50%; background-size: cover; background-position: center; border: 1px solid rgba(0,0,0,.12); }
.lea-nm { overflow: hidden; text-overflow: ellipsis; }
