/* Quantity stepper.
 *
 * Shared by the product page and each cart line, so the two can never
 * present quantity differently. Sizing is driven by --qty-size, which is the
 * only thing that changes between the two contexts.
 */

.qty {
  --qty-size: 2.5rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-ink);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.qty--sm {
  --qty-size: 1.75rem;
  border-color: rgb(22 44 37 / 0.25);
}

.qty__btn {
  width: var(--qty-size);
  height: var(--qty-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-md);
  line-height: 1;
  color: var(--c-ink);
  transition: background var(--d-fast) var(--ease-out);
}

.qty--sm .qty__btn { font-size: var(--t-sm); }

.qty__btn:hover:not(:disabled) { background: rgb(22 44 37 / 0.06); }

.qty__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* A real number input: keyboard entry, and it participates in forms later. */
.qty__value {
  width: var(--qty-size);
  height: var(--qty-size);
  border: none;
  background: none;
  text-align: center;
  font: inherit;
  font-size: var(--t-base);
  font-variant-numeric: tabular-nums;
  color: var(--c-ink);
  -moz-appearance: textfield;
}

.qty--sm .qty__value { font-size: var(--t-sm); }

.qty__value::-webkit-outer-spin-button,
.qty__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty__value:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: -2px;
}
