/* Oskar Store — shared tokens and base components (spec §12) */
:root {
  color-scheme: light;
  --navy: #14293F;
  --navy-deep: #0B1A28;
  --navy-soft: #EDF0F4;
  --white: #FFFFFF;
  --bg: #F6F6F4;
  --line: #E6E9ED;
  --muted: #6B7785;
  --red: #D62828;
  --red-soft: #FCEDED;
  --wa: #25D366;
  --wa-deep: #1DA851;

  --mist: #EEF0F3;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Alexandria', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 26, 40, .06);
  --shadow: 0 1px 2px rgba(11, 26, 40, .05), 0 8px 24px rgba(11, 26, 40, .07);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy-deep);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.icon { flex: none; }
.visually-hidden {
  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 {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.15rem;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap;
  background: var(--white); color: var(--navy);
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); }
.btn-outline { border-color: var(--line); background: var(--white); }
.btn-outline:hover:not(:disabled) { border-color: var(--navy); }
.btn-ghost { background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--navy-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover:not(:disabled) { background: var(--wa-deep); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .3rem .85rem; font-size: .85rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 999px;
  border: 0; background: transparent; color: var(--navy); text-decoration: none;
}
.icon-btn:hover { background: var(--navy-soft); }

/* Form fields */
.field { display: grid; gap: .35rem; }
.label { font-size: .85rem; font-weight: 600; color: var(--navy); }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .55rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20, 41, 63, .12);
}
.input[aria-invalid="true"] { border-color: var(--red); }
.form-error { min-height: 1.2em; margin: 0; color: var(--red); font-size: .85rem; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 38px; padding: .3rem .9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: .9rem; font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
}
.chip[aria-pressed="true"], .chip.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chip:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; font-size: .85rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 40px; height: 24px; border-radius: 999px;
  background: #C9CFD6; transition: background .2s var(--ease); flex: none;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--navy); }
.switch input:checked + .switch-track::after { transform: translateX(-16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; line-height: 1.6;
}
.badge-sale { background: var(--red); color: #fff; }
.badge-out { background: var(--navy-deep); color: #fff; }
.badge-new { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }
.badge-muted { background: var(--line); color: var(--muted); }

.price-now { font-weight: 700; color: var(--navy-deep); }
.price-sale { color: var(--red); }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .85em; font-weight: 400; }

/* Toasts */
.toasts {
  position: fixed; inset-inline: 0; bottom: calc(84px + env(safe-area-inset-bottom));
  display: grid; justify-items: center; gap: .5rem; padding: 0 16px; pointer-events: none; z-index: 100;
}
.toast {
  max-width: 420px; padding: .7rem 1.1rem; border-radius: 12px;
  background: var(--navy-deep); color: #fff; font-size: .9rem; box-shadow: var(--shadow);
  animation: toast-in .25s var(--ease);
}
.toast.is-error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--navy);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
