/* Quantities: a number field, and the stepper around it. */

@layer components {
  .qty { width: 5.5rem; text-align: right; }

  /* The sale form's quantity: the number (typed by hand too), + (solid, the
     business's color) and − (solid red), both signs in the business's text
     tint, bordered in its shade. − hides at zero but keeps its place. */
  .stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    @media (max-width: 640px) { gap: 0.3rem; }

    .qty {
      width: 4rem;
      text-align: right;
      padding-inline: 0.5rem;
      -moz-appearance: textfield;
      appearance: textfield;

      @media (max-width: 640px) { width: 2.9rem; }

      &::-webkit-outer-spin-button, &::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }
    }
    .step {
      width: 2.5rem;
      height: 2.5rem;
      padding: 0;
      justify-content: center;
      border-radius: 10px;
      font-size: 1.4rem;
      font-weight: 800;
      line-height: 1;
      touch-action: manipulation;
    }
    .more {
      background: var(--biz);
      border-color: var(--biz-shade);
      color: var(--biz-text);

      &:hover { background: var(--biz); filter: brightness(0.92); }
    }
    .less {
      background: var(--alert);
      border-color: var(--biz-shade);
      color: var(--biz-text);

      &:hover { background: #b51f33; }
    }
    &[data-empty] .less { visibility: hidden; }
  }
}
