/* Branded select: closed box + open list. Tokens come from the page stylesheet. */

.pick {
  position: relative;
  display: block;
  min-width: 0;
}
.pick.is-open { z-index: 8; }
.qty {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow: visible;
  flex-shrink: 0;
}
.qty .pick { width: 8.5rem; }
.qty-unit {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.pick.is-on > select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
  background-image: none;
}

/* Chevron is ::after. Page `button:hover { background }` shorthand would
   tile a background-image SVG across the closed box. */
button.pick-btn,
.pick-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  min-height: var(--hit);
  margin: 0;
  padding: 0 var(--space-4) 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: var(--panel);
  background-image: none;
  color: var(--gold-bright);
  font-family: var(--body);
  font-size: 1.69rem;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1;
  text-transform: none;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
button.pick-btn::after,
.pick-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-2);
  width: 0.75rem;
  height: 0.5rem;
  transform: translateY(-50%);
  background-color: var(--gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
button.pick-btn:hover:not(:disabled),
.pick-btn:hover:not(:disabled),
.pick-btn.show-hover,
.pick.is-open button.pick-btn:hover:not(:disabled),
.pick.show-open button.pick-btn:hover:not(:disabled) {
  background-color: var(--panel);
  background-image: none;
  border-color: var(--gold);
  transform: none;
}
button.pick-btn:focus-visible,
.pick-btn:focus-visible,
.pick-btn.show-focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-color: var(--gold);
  background-color: var(--panel);
  background-image: none;
}
button.pick-btn:active:not(:disabled),
.pick-btn:active:not(:disabled) {
  background-color: var(--panel);
  background-image: none;
  border-color: var(--gold);
  transform: none;
}
button.pick-btn:disabled,
.pick-btn:disabled,
.pick-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background-color: var(--panel);
  background-image: none;
  border-color: var(--line);
  color: var(--gold-bright);
}
.pick.is-open .pick-btn,
.pick.show-open .pick-btn {
  border-color: var(--gold);
  background-image: none;
}
.pick.is-open .pick-btn::after,
.pick.show-open .pick-btn::after {
  transform: translateY(-50%) scaleY(-1);
}
.pick-btn.is-invalid { border-color: var(--gold-bright); }

.pick-list {
  position: absolute;
  z-index: 8;
  top: calc(100% - 1px);
  left: 0;
  right: auto;
  min-width: 100%;
  max-width: 22rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--panel);
  max-height: calc(6.5 * var(--hit));
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow:
    0 0 6px 0 rgba(201, 161, 90, 0.18),
    0 0 18px 1px rgba(180, 130, 50, 0.12);
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--panel);
}
.pick:not(.is-open):not(.show-open) .pick-list { display: none; }
.pick.show-open .pick-list {
  position: relative;
  top: auto;
  max-width: none;
}

.pick-opt {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: var(--hit);
  padding: 0 var(--space-2);
  color: var(--gold-bright);
  font-family: var(--body);
  font-size: 1.69rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.qty .pick-opt {
  justify-content: center;
  text-align: center;
}
.pick-opt:hover,
.pick-opt.show-hover,
.pick-opt:focus {
  background: color-mix(in srgb, var(--gold) 16%, var(--panel));
  outline: none;
}
.pick-opt:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}
.pick-opt.is-on {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}
.pick-opt.is-on:hover,
.pick-opt.is-on.show-hover,
.pick-opt.is-on:focus {
  background: var(--gold-bright);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .pick-btn { transition: none; }
}
