/*
  Input 09 — Quantity Input — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --input-accent: #39ff14;
  --input-fg: oklch(0.145 0 0);
  --input-border: oklch(0.87 0 0);
  --input-muted: oklch(0.5 0 0);
}

body {
  margin: 0;
  display: flex;
  min-height: 20rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}

.product-line {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 1.25rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.product-line__details {
  min-width: 0;
}

.product-line__name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--input-fg);
}

.product-line__price {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--input-muted);
}

.stepper {
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.stepper__label {
  display: block;
  margin-bottom: 0.375rem;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--input-fg);
}

.stepper__shell {
  display: inline-flex;
  height: 2.75rem;
  align-items: stretch;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--input-border);
  background-color: #ffffff;
}

.stepper__button {
  display: flex;
  width: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 1.125rem;
  color: var(--input-fg);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.stepper__button:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.04);
}

.stepper__button:active:not(:disabled) {
  transform: scale(0.95);
}

.stepper__button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--input-accent);
  outline-offset: -2px;
}

.stepper__button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.stepper__value {
  width: 3rem;
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid var(--input-border);
  border-right: 1px solid var(--input-border);
  background-color: #ffffff;
  text-align: center;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--input-fg);
  outline: none;
}

.stepper__value:disabled {
  cursor: not-allowed;
  color: var(--input-muted);
}

.stepper__message {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--input-muted);
}

@media (prefers-reduced-motion: reduce) {
  .stepper__button {
    transition: background-color 150ms ease;
  }
  .stepper__button:active:not(:disabled) {
    transform: none;
  }
}
