/* ==========================================================================
   base.css — reset, typography, utilities.
   Everything is written with LOGICAL properties so dir="rtl" mirrors the whole
   interface without a single RTL override (public/assets/css/rtl.css is empty
   on purpose — see DECISIONS.md).
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--np-cream);
  color: var(--np-ink);
  font-family: var(--np-font);
  font-size: var(--np-fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* The POS is a kiosk: text selection and long-press menus get in the way. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Inputs stay selectable — a cashier must be able to correct a typo. */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--np-font-title);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p { margin: 0; }

a { color: var(--np-lav-ink); text-decoration: none; }
a:hover { color: var(--np-lav); }

img, svg { vertical-align: middle; }
svg { flex: none; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: inherit;
}

button:disabled { cursor: default; }

/* Money and counters never jitter. Digits stay Latin in every language. */
.np-num,
.np-money,
[data-np-num] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- focus --------------------------------------------------------------- */
/* Visible on keyboard focus only: a cashier tapping glass must not see rings
   everywhere, but a PC operator navigating with Tab must always know where
   they are (inventory Q3). */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--np-sh-focus);
  border-radius: var(--np-r-xs);
  position: relative;
  z-index: 1;
}

/* ---- scrollbars ---------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--np-muted-line-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--np-muted-line-2); border-radius: var(--np-r-xs); }
::-webkit-scrollbar-track { background: transparent; }

.np-noscrollbar { scrollbar-width: none; }
.np-noscrollbar::-webkit-scrollbar { width: 0; height: 0; }

/* ---- text helpers -------------------------------------------------------- */
.np-eyebrow {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--np-dim);
}
.np-eyebrow--sm { font-size: 9.5px; letter-spacing: 0.1em; }
.np-eyebrow--lg { font-size: var(--np-fs-label); }

.np-title { font-family: var(--np-font-title); font-size: var(--np-fs-page-title); }
.np-title--sheet { font-size: var(--np-fs-sheet-title); }

.np-sub { font-size: 13px; color: var(--np-mid); }
.np-secondary { font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-dim { color: var(--np-dim); }
.np-mono { font-family: var(--np-font-mono); }

/* `unicode-bidi: plaintext` makes each truncated string carry its OWN base
   direction instead of the page's. Without it, a Latin customer or product
   name inside dir="rtl" is treated as an RTL paragraph and the ellipsis eats
   its START — "Boukemouche Idriss Elysium" rendered as "…mouche Idriss
   Elysium", which is the half you cannot identify anyone by (F042). Arabic
   text is unaffected: it is already RTL, so it still truncates at its end. */
.np-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  unicode-bidi: plaintext;
}
.np-pretty { text-wrap: pretty; }
.np-clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- layout helpers ------------------------------------------------------ */
.np-row { display: flex; align-items: center; gap: var(--np-s2); }
.np-col { display: flex; flex-direction: column; }
.np-grow { flex: 1; min-width: 0; }
.np-none { flex: none; }
.np-spacer { flex: 1; }
.np-wrap { flex-wrap: wrap; }
.np-gap-1 { gap: var(--np-s1); }
.np-gap-2 { gap: var(--np-s2); }
.np-gap-3 { gap: var(--np-s3); }
.np-gap-4 { gap: var(--np-s4); }
.np-end { margin-inline-start: auto; }

[hidden],
.np-hidden { display: none !important; }

.np-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- inline SVG icons ---------------------------------------------------- */
.np-ico {
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.np-ico--sm { width: 15px; height: 15px; stroke-width: 2; }
.np-ico--burger { width: 19px; height: 19px; stroke-width: 1.9; }

/* ---- motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
