/* Koli Industrials: interface pieces shared by the public site and the admin panel.
   Branded scrollbars, page links, and the dropdown that select.js draws in place of the browser's own option list.
   Everything takes its colours from the semantic tokens, so it follows Paper and Card areas alike. */

/* ------------------------------------------------------------------ scrollbars
   A slider in a duct: a square-cut thumb set into a sunken track, like trunking on a wall. */

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--surface-sunken); }
::-webkit-scrollbar-thumb { min-height: 40px; min-width: 40px; background: var(--line-strong); border: 3px solid var(--surface-sunken); border-radius: var(--radius-1); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
::-webkit-scrollbar-thumb:active { background: var(--action); }
::-webkit-scrollbar-corner { background: var(--surface-sunken); }
::-webkit-scrollbar-button { display: none; }

/* The page's own scrollbar is a little wider and darker, with a hairline where the duct meets the page. */
html::-webkit-scrollbar { width: 14px; height: 14px; }
html::-webkit-scrollbar-track { background: var(--surface-sunken); box-shadow: inset 1px 0 0 var(--brown-300); }
html::-webkit-scrollbar-thumb { background: var(--ink-muted); }
html::-webkit-scrollbar-thumb:hover, html::-webkit-scrollbar-thumb:active { background: var(--action); }

/* Firefox has only the standard properties: colours and a thin width. */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--ink-muted) var(--surface-sunken); }
  body * { scrollbar-color: var(--line-strong) var(--surface-sunken); scrollbar-width: thin; }
}

/* ------------------------------------------------------------------ pagination
   Page links under long lists: the catalog and category pages, and the admin lists (products, messages). */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-7); }
.pagination__middle { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3) var(--space-4); min-width: 0; }
.pagination ol { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
/* "Faqja [ 4 ] nga 9  Shko": the box looks like a page square and is as wide as the last page's number. */
.pagination__jump { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding-left: var(--space-4); border-left: 1px solid var(--line); }
.pagination__label, .pagination__of { color: var(--ink-muted); white-space: nowrap; }
.pagination__input {
  box-sizing: border-box; width: calc(var(--digits, 2) * 1ch + 22px); min-width: var(--control-s); height: var(--control-s);
  margin: 0; padding: 0 4px; font: inherit; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-1);
  appearance: textfield; -moz-appearance: textfield;
}
.pagination__input::-webkit-outer-spin-button, .pagination__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pagination__input:hover { border-color: var(--ink-muted); }
.pagination__input:focus-visible { outline: 2px solid transparent; border-color: var(--focus); box-shadow: var(--focus-ring); }
@media (max-width: 600px) {
  .pagination__jump { padding-left: 0; border-left: 0; }
}
.pagination__page { display: grid; place-items: center; min-width: var(--control-s); height: var(--control-s); padding: 0 var(--space-2); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; border: 1px solid var(--line-strong); border-radius: var(--radius-1); }
a.pagination__page:hover { background: var(--surface-sunken); }
.pagination__page.is-current { background: var(--action); border-color: var(--action); color: var(--on-action); }
.pagination__gap { display: grid; place-items: center; min-width: 20px; color: var(--ink-muted); }

/* ------------------------------------------------------------------ dropdown (select.js)
   The closed field keeps the select's own classes (Field, sort control…); the list is a menu on
   shadow-lift with the cord marking the chosen option, as the current link is marked elsewhere. */

.kl-dd { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.kl-field__row > .kl-dd { flex: 1 1 auto; min-width: 0; }
td > .kl-dd { display: flex; }

.kl-dd__native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; pointer-events: none; }

.kl-dd__combo {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
  flex: 1 1 auto; min-width: 0; padding-right: 36px; text-align: left; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  background-image: none; /* the select's class draws a fixed chevron; this one turns */
}
.kl-dd__combo:focus-visible { outline: 2px solid transparent; border-color: var(--focus); box-shadow: var(--focus-ring); }
.kl-dd__combo[aria-expanded="true"] { border-color: var(--ink); }
.kl-dd__combo[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.kl-dd.is-invalid .kl-dd__combo { border-color: var(--signal-danger); }

/* The value and, invisibly, every option in one grid cell: the field is as wide as its longest option,
   like a native select, and never jumps when the value changes. */
.kl-dd__value, .kl-dd__sizer > span { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-dd__sizer { display: contents; }
.kl-dd__sizer > span { height: 0; visibility: hidden; }

.kl-dd__chevron { position: absolute; top: 50%; right: 10px; width: 16px; height: 16px; margin-top: -8px; color: var(--ink); pointer-events: none; transition: transform 160ms ease-out; }
.kl-dd__combo[aria-expanded="true"] .kl-dd__chevron { transform: rotate(180deg); }

.kl-dd__list {
  position: fixed; z-index: 1000; box-sizing: border-box; margin: 0; padding: var(--space-1) 0; list-style: none;
  overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--font-sans); font-size: 16px; line-height: 22px; font-weight: 400; color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-1); box-shadow: var(--shadow-lift);
}
.kl-dd__option { display: flex; align-items: center; gap: var(--space-3); min-height: 38px; padding: 8px var(--space-3) 8px var(--space-4); cursor: pointer; }
.kl-dd__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kl-dd__option.is-active { background: var(--surface-sunken); }
.kl-dd__option[aria-selected="true"] { font-weight: 600; box-shadow: inset 2px 0 0 var(--cord); }
.kl-dd__check { flex: none; width: 16px; height: 16px; color: var(--ink); }
.kl-dd__option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.kl-dd__group { padding: var(--space-3) var(--space-3) var(--space-1); color: var(--ink-muted); }

@media (pointer: coarse) { .kl-dd__option { min-height: 44px; } }

@media (prefers-reduced-motion: no-preference) {
  .kl-dd__list { animation: kl-dd-down 140ms ease-out; }
  .kl-dd__list.is-up { animation-name: kl-dd-up; }
}
@keyframes kl-dd-down { from { opacity: 0; transform: translateY(-4px); } }
@keyframes kl-dd-up { from { opacity: 0; transform: translateY(4px); } }
