/*
 * Site-wide styling for the browser's up/down spinner on <input type="number">.
 * Loaded from the root layout (app/layout.tsx), so it covers every page: site pages, the admin panel,
 * the registration walkthrough and the React pages (Discover filters, gift cards, ...).
 *
 * Chromium/Safari: the native spinner is replaced with a small themed box holding two chevrons.
 * It is still the browser's own control (top half = up, bottom half = down), so clicking, holding,
 * keyboard arrows and min/max/step behave exactly as before.
 * Firefox does not allow its spinner to be styled; it keeps the native one, drawn in the page's color-scheme.
 *
 * Inputs wrapped by number-stepper.js (.tk-stepper, TSK-076) have their own −/+ buttons and no spinner.
 */
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  align-self: center;
  width: 18px;
  height: 26px;
  margin: 0 -4px 0 8px;
  border: 1px solid #ffffff33;
  border-radius: 6px;
  /* Lime chevrons (dark mode). */
  background: #ffffff12 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 18' fill='none' stroke='%23cfff4b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.25 7 5 4.25 7.75 7M2.25 11 5 13.75 7.75 11'/%3E%3C/svg%3E") center / 10px 18px no-repeat;
  opacity: .8;
  cursor: pointer;
  transition: opacity .15s, background-color .15s, border-color .15s;
}
input[type=number]:hover::-webkit-inner-spin-button,
input[type=number]:focus::-webkit-inner-spin-button {
  opacity: 1;
  background-color: #cfff4b26;
  border-color: #cfff4b99;
}

/* Light mode (theme.js sets data-color-mode on <html>): dark-green chevrons on a pale-green box. */
[data-color-mode=light] input[type=number]::-webkit-inner-spin-button {
  border-color: #a9bcb0;
  background-color: #eaf1e9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 18' fill='none' stroke='%2338631a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.25 7 5 4.25 7.75 7M2.25 11 5 13.75 7.75 11'/%3E%3C/svg%3E");
}
[data-color-mode=light] input[type=number]:hover::-webkit-inner-spin-button,
[data-color-mode=light] input[type=number]:focus::-webkit-inner-spin-button {
  background-color: #d9ebcd;
  border-color: #38631a;
}

/* No spinner where the value cannot be changed. */
input[type=number]:is(:disabled, [readonly])::-webkit-inner-spin-button { display: none; }

/* number-stepper.js inputs: the −/+ buttons replace the spinner entirely. */
.tk-stepper input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.tk-stepper input[type=number]::-webkit-inner-spin-button,
.tk-stepper input[type=number]::-webkit-outer-spin-button { display: none; -webkit-appearance: none; margin: 0; }
