/* =====================================================================
   Design your own bracelet. Loaded only on /shop/design.
   The bracelet is a square stage with the beads placed around a circle;
   bead size comes from --bead, set by js/designer.js for 23, 24 or 25.
   ===================================================================== */

.bd { padding-block: 28px 96px; display: flex; flex-direction: column; gap: clamp(32px, 4vw, 48px); }
.bd__head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.bd__title { font-size: clamp(38px, 30px + 1.8vw, 56px); line-height: 1.04; font-weight: 500; }

.bd__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(32px, 4.4vw, 64px); align-items: start; }

/* ---------------------------------------------------------------- the bracelet */
.bd__stage { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.bd__ring {
  position: relative; width: 100%; max-width: 560px; aspect-ratio: 1;
  /* a soft pool of light rather than a hard disc, so the stones stay the subject */
  background: radial-gradient(circle at 50% 50%, var(--cream) 0 58%, rgba(239, 231, 218, .35) 72%, transparent 86%);
}
/* the cord the beads are strung on, running through their centres */
.bd__ring::before {
  content: ''; position: absolute; inset: 11%; border-radius: 50%;
  border: 1px solid rgba(34, 32, 30, .14);
}
.bd__bead {
  position: absolute; width: var(--bead, 10%); aspect-ratio: 1; transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.bd__bead::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px dashed rgba(34, 32, 30, .3); transition: border-color .25s, opacity .25s;
}
.bd__bead.is-filled::after { border: 0; box-shadow: inset 0 0 0 1px rgba(34, 32, 30, .1); }
.bd__bead img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.bd__bead:hover { transform: translate(-50%, -50%) scale(1.12); z-index: 2; }
.bd__bead:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; z-index: 3; }
/* the position being filled next */
.bd__bead.is-next::after { border-color: var(--rust); border-style: solid; border-width: 2px; }
.bd__bead.is-next { animation: bdPulse 1.8s ease-in-out infinite; }
@keyframes bdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(143, 63, 53, .3); }
  50% { box-shadow: 0 0 0 7px rgba(143, 63, 53, 0); }
}

.bd__count { font-size: 14px; font-weight: 600; color: var(--ink); }
.bd__stageacts { display: flex; gap: 24px; }
.bd__stageacts .tlink { min-height: 36px; font-size: 13px; }
.bd__stageacts .tlink[disabled] { opacity: .4; cursor: default; }
.bd__stageacts .tlink[disabled] span { background-image: none; }

/* ---------------------------------------------------------------- choices */
.bd__panel { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.bd__fs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bd__legend { font-size: 11.5px; letter-spacing: .22em; font-weight: 700; text-transform: uppercase; color: var(--rust); padding: 0 0 12px; width: 100%; border-bottom: 1px solid var(--hair); }
.bd__hint { font-size: 13.5px; line-height: 1.6; color: var(--muted); min-height: 1.6em; }

.bd__sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bd__size {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px;
  border: 1px solid var(--line-3); background: var(--ivory); color: var(--ink); cursor: pointer;
  border-radius: 2px; transition: border-color .3s, background-color .3s, color .3s;
}
.bd__size strong { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1; }
.bd__size span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.bd__size:hover { border-color: var(--rust); color: var(--rust); }
.bd__size.is-on { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.bd__size.is-on span { color: rgba(253, 252, 249, .7); }

.bd__stones { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.bd__stone {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px 12px;
  border: 1px solid transparent; background: none; cursor: pointer; border-radius: 3px;
  transition: border-color .25s, background-color .25s, transform .25s var(--ease);
}
.bd__stone img { width: 54px; height: 54px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(34, 32, 30, .1); transition: transform .3s var(--ease); }
.bd__stone span { font-size: 11.5px; line-height: 1.3; text-align: center; color: var(--body); }
.bd__stone:hover { border-color: var(--hair-2); background: var(--cream); }
.bd__stone:hover img { transform: scale(1.08); }
.bd__stone:active { transform: scale(.96); }
.bd__stone:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

/* ---------------------------------------------------------------- sending */
.bd__send { display: flex; flex-direction: column; gap: 12px; }
.bd__go.is-off { opacity: .45; pointer-events: auto; cursor: not-allowed; }
.bd__extra { display: flex; flex-wrap: wrap; gap: 20px; }
.bd__extra .tlink { min-height: 36px; font-size: 13px; }
.bd__extra .tlink[disabled] { opacity: .4; cursor: default; }
.bd__extra .tlink[disabled] span { background-image: none; }
.bd__note { font-size: 13px; line-height: 1.6; color: var(--muted); }
.bd__fine { font-size: 13px; color: var(--soft); max-width: 70ch; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1023px) {
  .bd__grid { grid-template-columns: minmax(0, 1fr); }
  .bd__stage { position: static; }
  .bd__ring { max-width: 460px; }
}
@media (max-width: 560px) {
  .bd__ring { max-width: 100%; }
  .bd__stones { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
  .bd__stone img { width: 46px; height: 46px; }
  .bd__stone span { font-size: 10.5px; }
  .bd__title { font-size: clamp(32px, 7vw + 8px, 44px); }
}

@media (prefers-reduced-motion: reduce) {
  .bd__bead.is-next { animation: none; }
  .bd__bead, .bd__stone, .bd__stone img { transition: none; }
}
