/*
  BoundBio — vial-size selector styles
  =======================================
  Pairs with design-system/size-selector.js. Self-contained so any page can
  link this one file and get the control; it reads --accent / --accent-rgb
  from whatever the page already sets per product, so it themes itself.

  Sizing follows the existing button language: pill/round geometry, 1px
  hairlines in --line, --accent only for the selected state. Circles are
  46px, above the 44px touch-target floor used elsewhere in the build.
*/

.vsize { position: relative; display: inline-flex; vertical-align: middle; }
.vsize[hidden] { display: none; }

.vsize-btn,
.vsize-opt {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.vsize-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .13);
}
/* Tappable hint (2026-09-20): ONLY the real toggle on a product with more than one size
   gets .vsize-hint (size-selector.js) — never the static single-size pill. A soft Cupric
   Blue halo that breathes slowly; it does not touch the text or the border, so contrast and
   the 46px target are unchanged. The class is removed for good on the first interaction.
   Under prefers-reduced-motion the halo is static (rule at the foot of this file). */
.vsize-btn.vsize-hint {
  /* literal blues, not var(--accent-rgb): the vault never defines that variable, and one
     undefined var() invalidates the whole box-shadow declaration (found 2026-09-20). */
  box-shadow: 0 0 0 3px rgba(30, 143, 196, .16), 0 0 14px 3px rgba(30, 143, 196, .34);
  animation: vsize-hint 2.6s ease-in-out infinite;
}
@keyframes vsize-hint {
  0%, 100% { box-shadow: 0 0 0 3px rgba(30, 143, 196, .14), 0 0 10px 2px rgba(30, 143, 196, .24); }
  50%      { box-shadow: 0 0 0 6px rgba(30, 143, 196, .07), 0 0 20px 6px rgba(30, 143, 196, .42); }
}
.vsize-btn:hover { transform: translateY(-1px); }
.vsize-btn:active { transform: scale(.94); }
.vsize-btn:focus-visible,
.vsize-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Static single-size pill (2026-09-02, design-system proposal) — a <span>
   for a product with only one vial size, not the real toggle. .vsize-btn's
   own rule above always accent-rings the circle (it doubles as "the
   current pick" for the real 2-size toggle), so this overrides back to
   the plain hairline border/no shadow: nothing was chosen here, so nothing
   borrows the "chosen" signal. cursor stays the plain arrow and every
   hover/active transform is cancelled — it cannot look interactive. */
.vsize-btn.static {
  border-color: var(--line);
  box-shadow: none;
  cursor: default;
}
.vsize-btn.static:hover { transform: none; }
.vsize-btn.static:active { transform: none; }

.vsize-n {
  font-family: var(--font-display, 'Figtree', sans-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.vsize-u {
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1px;
}

/* Tap feedback on change: a quick vertical flip, so switching sizes reads
   as the same control turning over rather than the number just mutating. */
@keyframes vsize-flip {
  0%   { transform: rotateX(0deg); }
  45%  { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}
.vsize-btn.flip { animation: vsize-flip .34s ease; }

/* ---- Expanded picker (3+ sizes only) ---- */
.vsize-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 980px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(11, 60, 90, .16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 40;
}
.vsize.is-open .vsize-pop {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.vsize-opt.on {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .10);
}

/* The animations are decoration; the state changes are not. Under reduced
   motion the control still switches, just without the flip or the slide. */
@media (prefers-reduced-motion: reduce) {
  .vsize-btn.flip { animation: none; }
  .vsize-btn:hover, .vsize-btn:active { transform: none; }
  .vsize-pop { transition: none; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .vsize-btn.vsize-hint { animation: none; box-shadow: 0 0 0 3px rgba(30, 143, 196, .16), 0 0 14px 3px rgba(30, 143, 196, .34); }
}
