/* Alphabelle homepage picker. Markup is built by /home/picker.js inside #picker. Tokens come from /shared/ab.css. */
@property --pk-glow {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(232, 211, 166, .46);
}

.picker {
  --pk-muted: #6B625A;
  position: relative;
  padding: clamp(104px, 10vw, 148px) 0 clamp(88px, 10vw, 136px);
}
.picker [hidden] { display: none !important; }

.pk-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--ab-pad);
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
  grid-template-areas: "head head" "pick stage" "panel stage";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(40px, 5.5vw, 96px);
}

.pk-head { grid-area: head; margin-bottom: clamp(28px, 3.4vw, 48px); }
.pk-head h2 {
  margin: 0;
  font: 300 clamp(40px, 5.2vw, 72px)/1 var(--ab-serif);
  letter-spacing: -.01em;
}

/* Product cards: a radio group */
.pk-pick { grid-area: pick; min-width: 0; container: pk-pick / inline-size; }
.pk-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.pk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pk-card-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pk-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ab-ivory);
  outline: 1px solid transparent;
  outline-offset: 4px;
  transition: outline-color .5s var(--ab-ease);
}
.pk-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--zoom, 1.3));
  transform-origin: var(--fx, 50%) var(--fy, 55%);
  filter: saturate(.82) brightness(.98);
  transition: transform 1.4s var(--ab-ease), filter .6s var(--ab-ease);
}
.pk-card:hover .pk-card-media img { transform: scale(calc(var(--zoom, 1.3) * 1.05)); }
.pk-card-input:checked ~ .pk-card-media { outline-color: var(--ab-ink); }
.pk-card-input:checked ~ .pk-card-media img { filter: none; }
.pk-card-input:focus-visible ~ .pk-card-media { outline: 2px solid var(--ab-gold); outline-offset: 4px; }
.pk-card-name {
  display: block;
  margin-top: 14px;
  font: 400 clamp(16px, 1.45vw, 21px)/1.15 var(--ab-serif);
  color: var(--pk-muted);
  transition: color .4s var(--ab-ease);
}
.pk-card-input:checked ~ .pk-card-name, .pk-card:hover .pk-card-name { color: var(--ab-ink); }
.pk-card-line { display: block; margin-top: 7px; font: 400 12.5px/1.5 var(--ab-sans); color: var(--pk-muted); }
.pk-pick-line { display: none; margin: 16px 0 0; font: 400 13px/1.55 var(--ab-sans); color: var(--pk-muted); }
@container pk-pick (max-width: 480px) {
  .pk-card-line { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pk-pick-line { display: block; }
}

/* Live 3D preview */
.pk-stage-col { grid-area: stage; min-width: 0; }
.pk-stage {
  --pk-glow: rgba(232, 211, 166, .46);
  --m1: #8F6B35; --m2: #F4E4C1; --m3: #C9A46A;
  /* Fits below the section header on arrival, then sticks centred in the space under the nav. */
  --pk-h: clamp(440px, calc(100vh - 272px), 700px);
  position: sticky;
  top: calc(36px + (100vh - var(--pk-h)) / 2);
  height: var(--pk-h);
  overflow: hidden;
  border-radius: 6px;
  isolation: isolate;
  background:
    radial-gradient(56% 44% at 50% 62%, var(--pk-glow), rgba(246, 241, 233, 0) 74%),
    linear-gradient(108deg, rgba(255, 253, 248, .85) 0%, rgba(255, 253, 248, 0) 48%),
    linear-gradient(180deg, #F7F2EA 0%, #EEE7DB 100%);
  transition: --pk-glow .9s var(--ab-ease);
}
@supports (height: 100svh) {
  .pk-stage { --pk-h: clamp(440px, calc(100svh - 272px), 700px); top: calc(36px + (100svh - var(--pk-h)) / 2); }
}
.pk-stage[data-metal="rose"] { --pk-glow: rgba(231, 179, 158, .36); --m1: #9A5F4E; --m2: #F7DDD3; --m3: #DDA793; }
.pk-stage[data-metal="silver"] { --pk-glow: rgba(206, 209, 218, .55); --m1: #767982; --m2: #F5F6F8; --m3: #C2C5CD; }
.pk-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.pk-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
  opacity: 0;
  transition: opacity 1.4s var(--ab-ease);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
}
.pk-stage.is-ready .pk-canvas { opacity: 1; }
.pk-stage.is-dragging .pk-canvas { cursor: grabbing; }
.pk-stage.is-static .pk-canvas { cursor: default; }
.pk-fallback {
  position: absolute;
  left: 0; right: 0; top: 58%;
  z-index: 1;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 20px;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  font: 400 clamp(56px, 7vw, 112px)/1.3 var(--ab-script);
  background: linear-gradient(100deg, var(--m1) 0%, var(--m2) 44%, var(--m3) 58%, var(--m1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  transition: opacity .9s var(--ab-ease);
}
.pk-fallback.is-serif { font: 500 clamp(48px, 5.6vw, 92px)/1.3 var(--ab-serif); }
.pk-fallback.is-letters { font: 500 clamp(40px, 4.4vw, 64px)/1.3 var(--ab-serif); letter-spacing: .14em; }
.pk-fallback.is-initial { font: 500 clamp(120px, 12vw, 190px)/1.1 var(--ab-serif); }
.pk-stage.is-ready .pk-fallback { opacity: 0; }
.pk-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 500 10.5px/1 var(--ab-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--pk-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s var(--ab-ease) .8s;
}
.pk-hint svg { width: 22px; height: 10px; }
.pk-stage.is-ready .pk-hint { opacity: .85; }

/* Personalisation controls */
.pk-panel {
  grid-area: panel;
  min-width: 0;
  container: pk-panel / inline-size;
  margin-top: clamp(36px, 4vw, 56px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--ab-line);
}
.pk-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.pk-label, .pk-opt legend {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  font: 500 11px/1 var(--ab-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pk-muted);
}
.pk-row { position: relative; }
.pk-row::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ab-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s var(--ab-ease);
}
.pk-row:focus-within::after { transform: scaleX(1); }
.pk-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 64px 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ab-line);
  border-radius: 0;
  background: transparent;
  color: var(--ab-ink);
  font: 400 48px/1.3 var(--ab-script);
  caret-color: var(--ab-gold-deep);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.pk-input.is-serif { font: 500 42px/1.3 var(--ab-serif); letter-spacing: .01em; }
.pk-input.is-caps { font: 500 38px/1.3 var(--ab-serif); letter-spacing: .16em; text-transform: uppercase; }
.pk-input::placeholder { color: var(--ab-stone); opacity: .45; }
.pk-count {
  position: absolute;
  right: 0;
  bottom: 18px;
  font: 500 11px/1 var(--ab-sans);
  letter-spacing: .12em;
  color: var(--pk-muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.pk-msg { min-height: 20px; margin: 8px 0 0; font: 400 13px/1.5 var(--ab-sans); color: #8A5A44; }

.pk-az-field { margin-bottom: 20px; }
.pk-az-field .pk-label { margin-bottom: 14px; }
.pk-az { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; }
.pk-key { position: relative; display: block; cursor: pointer; }
.pk-key input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pk-key span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 34px;
  border: 1px solid var(--ab-line);
  border-radius: 4px;
  font: 500 19px/1 var(--ab-serif);
  color: var(--ab-ink);
  transition: background .3s var(--ab-ease), color .3s var(--ab-ease), border-color .3s var(--ab-ease);
}
.pk-key:hover span { border-color: rgba(14, 13, 12, .34); }
.pk-key input:checked + span { background: var(--ab-ink); border-color: var(--ab-ink); color: var(--ab-ivory); }
.pk-key input:focus-visible + span { outline: 2px solid var(--ab-gold); outline-offset: 2px; }
@container pk-panel (max-width: 470px) {
  .pk-az { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
  .pk-key span { font-size: 20px; }
}

.pk-confirm-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 18px;
  margin: 6px 0 0;
  font: 500 11px/1.5 var(--ab-sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pk-muted);
}
.pk-confirm, .pk-size { margin: 0; }
.pk-confirm b { font-weight: 600; color: var(--ab-ink); }

.pk-options { display: grid; gap: 24px; margin: 32px 0 36px; }
.pk-opt { min-width: 0; margin: 0; padding: 0; border: 0; }
.pk-opt legend { margin-bottom: 12px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-chip { position: relative; display: inline-flex; cursor: pointer; }
.pk-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pk-chip-face {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ab-line);
  border-radius: 999px;
  font: 400 13px/1 var(--ab-sans);
  white-space: nowrap;
  color: var(--ab-ink);
  transition: border-color .35s var(--ab-ease), background .35s var(--ab-ease), box-shadow .35s var(--ab-ease);
}
.pk-chip:hover .pk-chip-face { border-color: rgba(14, 13, 12, .32); }
.pk-chip input:checked + .pk-chip-face { border-color: var(--ab-ink); background: #fff; box-shadow: 0 8px 20px -12px rgba(14, 13, 12, .45); }
.pk-chip input:focus-visible + .pk-chip-face { outline: 2px solid var(--ab-gold); outline-offset: 3px; }
.pk-sw { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(14, 13, 12, .1); }
.pk-sw-gold { background: radial-gradient(circle at 32% 28%, #FFF6DD 0, #E6C07A 46%, #9C7A43 100%); }
.pk-sw-rose { background: radial-gradient(circle at 32% 28%, #FFEDE6 0, #E7B39E 46%, #A86F5E 100%); }
.pk-sw-silver { background: radial-gradient(circle at 32% 28%, #FFFFFF 0, #DADBE0 46%, #8E9098 100%); }
.pk-f-script { font: 400 22px/1 var(--ab-script); }
.pk-f-serif { font: 500 17px/1 var(--ab-serif); letter-spacing: .02em; }

.pk-bag { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.pk-add { gap: 0; min-width: 230px; padding: 18px 34px; }
.pk-add:focus-visible { outline: 2px solid var(--ab-gold); outline-offset: 3px; }
.pk-check { flex: none; width: 0; height: 10px; margin-right: 0; opacity: 0; transition: width .4s var(--ab-ease), margin .4s var(--ab-ease), opacity .3s var(--ab-ease); }
.pk-add.is-added .pk-check { width: 14px; margin-right: 10px; opacity: 1; }
.pk-status { min-height: 20px; margin: 0; font: 400 13px/1.5 var(--ab-sans); color: var(--pk-muted); }

@keyframes pk-bag-pulse { 0% { color: var(--ab-gold-deep); } }
.ab-nav a.pk-bag-pulse { animation: pk-bag-pulse 1.6s var(--ab-ease); }

/* Entrance and product switch */
.picker.pk-anim .pk-stage-col, .picker.pk-anim .pk-panel {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s var(--ab-ease), transform 1.1s var(--ab-ease);
}
.picker.pk-anim .pk-panel { transition-delay: .08s; }
.picker.pk-anim .pk-in { opacity: 1; transform: none; }
@keyframes pk-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pk-block.pk-enter { animation: pk-enter .55s var(--ab-ease) both; }

/* Stacked layout */
@media (max-width: 980px) {
  .pk-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "pick" "stage" "panel";
    grid-template-rows: auto;
  }
  .pk-stage-col { margin-top: clamp(28px, 5vw, 44px); }
  .pk-stage { position: relative; top: auto; height: clamp(340px, 62vw, 540px); min-height: 0; }
}

@media (max-width: 640px) {
  .pk-stage-col { margin-right: calc(var(--ab-pad) * -1); margin-left: calc(var(--ab-pad) * -1); }
  .pk-stage { height: clamp(300px, 92vw, 420px); border-radius: 0; }
  .pk-input { font-size: 44px; }
  .pk-input.is-serif { font-size: 38px; }
  .pk-input.is-caps { font-size: 34px; }
  .pk-add { width: 100%; }
}
