/* Shared tokens and basics for the shop and the admin area. */
:root {
  --felt: #141414;
  --felt-2: #2c2c2a;
  --band: #b9a98a;
  --stone: #e4e2db;
  --paper: #f5f4f0;
  --ink: #141414;
  --muted: #64625c;
  --line: #c8c5bc;
  --faint: #9a978e;
  --danger: #b3261e;
  --ok: #2e6b47;
  --r-s: 2px;
  --r-m: 2px;
  --font: "Archivo", "Noto Kufi Arabic", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
}
:root[dir="rtl"] body { line-height: 1.8; }
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; }
:root[dir="rtl"] h1, :root[dir="rtl"] h2, :root[dir="rtl"] h3 { line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--band); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Buttons */
.btn {
  text-transform: uppercase; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 1.25em;
  border: 1.5px solid var(--felt); border-radius: var(--r-s);
  background: transparent; color: var(--felt);
  font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn:hover { background: rgba(31, 59, 45, 0.06); }
.btn.primary { background: var(--felt); color: #fff; }
.btn.primary:hover { background: var(--felt-2); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 38px; padding: 0 0.9em; font-size: 0.92rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn {
  background: none; border: 0; padding: 6px 0; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* Forms */
.field { display: grid; gap: 6px; margin-block-end: 16px; }
.field label, .label { font-weight: 650; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--paper); font-size: 16px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--felt); outline: none; box-shadow: 0 0 0 3px rgba(212, 161, 61, 0.45); }
[aria-invalid="true"] { border-color: var(--danger); }
.hint { margin: 0; color: var(--muted); font-size: 0.88rem; }
.err { margin: 0; color: var(--danger); font-size: 0.9rem; font-weight: 600; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--felt); }

/* Quantity stepper */
.qty {
  display: inline-flex; align-items: center; flex: none;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper);
}
.qty button {
  width: 48px; height: 46px; border: 0; background: transparent;
  font-size: 1.3rem; cursor: pointer;
}
.qty button:disabled { color: var(--faint); cursor: not-allowed; }
.qty output { min-width: 2.2em; text-align: center; font-weight: 700; }
.qty.small button { width: 38px; height: 36px; font-size: 1.1rem; }

/* Messages */
.notice { padding: 12px 14px; border-radius: var(--r-s); background: var(--paper); }
.notice.error { border-inline-start: 4px solid var(--danger); color: var(--danger); font-weight: 600; }
.notice.ok { border-inline-start: 4px solid var(--ok); }
.loading { color: var(--muted); padding-block: 48px; }
.empty { padding-block: 48px; display: grid; gap: 12px; justify-items: start; }

.toast {
  position: fixed; z-index: 60;
  inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 440px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-radius: var(--r-m);
  background: var(--ink); color: #fff;
  animation: toast-in 0.18s ease-out;
}
.toast a { color: var(--band); font-weight: 700; white-space: nowrap; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
