/* ==========================================================================
   پایه طراحی: توکن‌ها، ریست، تایپوگرافی، دکمه‌ها و فرم‌ها
   ========================================================================== */
:root {
  /* رنگ‌ها */
  --navy-950: #070f22;
  --navy-900: #0b1630;
  --navy-800: #0f2147;
  --navy-700: #1a3263;
  --navy-100: #e8edf7;
  --accent: #f05a28;
  --accent-600: #d8471a;
  --accent-50: #fff1eb;
  --red: #e0352b;
  --success: #12804c;
  --success-50: #e7f6ee;
  --warn: #b86a00;
  --warn-50: #fff5e0;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #eceff5;
  --border: #e3e7ef;
  --border-strong: #cfd6e3;
  --text: #111a2e;
  --text-2: #3b465e;
  --muted: #667089;

  /* تایپوگرافی */
  --font: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.2rem + 2.4vw, 3rem);

  /* فاصله‌ها */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
  --section: clamp(48px, 6vw, 80px);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 22, 48, .06);
  --shadow: 0 6px 20px -6px rgba(11, 22, 48, .14);
  --shadow-lg: 0 20px 48px -16px rgba(11, 22, 48, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1280px;
  --header-h: 128px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4 { margin: 0; line-height: 1.45; font-weight: 800; color: var(--text); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
del { color: var(--muted); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(16px, 3vw, 32px); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -60px; right: 16px; z-index: 999; background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.tiny { font-size: var(--fs-xs); }
.icon { flex-shrink: 0; }
.currency { font-size: .78em; font-weight: 500; color: var(--muted); margin-inline-start: 2px; }
bdi { unicode-bidi: isolate; }

/* ---------- دکمه‌ها ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 22px;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: var(--fs-base); line-height: 1;
  border: 1.5px solid transparent;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(240, 90, 40, .8); }
.btn--primary:hover:not(:disabled) { background: var(--accent-600); }
.btn--primary.is-added { background: var(--success); box-shadow: none; }
.btn--dark { background: var(--navy-800); color: #fff; }
.btn--dark:hover { background: var(--navy-700); }
.btn--ghost { background: #fff; color: var(--navy-800); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--navy-800); background: var(--surface-2); }
.btn--light { background: #fff; color: var(--navy-900); }
.btn--light:hover { background: var(--accent-50); }
.btn--outline-light { color: #fff; border-color: rgba(255,255,255,.45); }
.btn--outline-light:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn--sm { --h: 38px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--lg { --h: 54px; padding: 0 30px; font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn:disabled { background: var(--surface-3); color: var(--muted); box-shadow: none; border-color: transparent; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text-2); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--danger:hover { background: #fdecea; color: var(--red); }

/* ---------- فرم‌ها ---------- */
.form { display: grid; gap: var(--s-4); }
.form-row { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--red); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.8; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(26, 50, 99, .12); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field__err { color: var(--red); font-size: var(--fs-xs); min-height: 0; }
.field__err:empty { display: none; }

.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; font-size: var(--fs-sm); color: var(--text-2); }
.checkbox input { appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--border-strong); border-radius: 6px; display: grid; place-items: center; transition: .15s; flex-shrink: 0; margin: 0; }
.checkbox input:checked { background: var(--navy-800); border-color: var(--navy-800); }
.checkbox input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.checkbox .count { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); padding: 0 8px; border-radius: 99px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding: 6px 0; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; transition: .2s; flex-shrink: 0; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { right: 21px; }
