/* ============================================================
   WooDash — base.css
   Design tokens: dark navy + emerald, light bg, RTL, mobile-first
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --navy-900: #0b1f33;
  --navy-800: #0f2a43;
  --navy-700: #14395c;
  --navy-600: #1d4d7a;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-100: #d1fae5;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #16283b;
  --text-soft: #5b7083;
  --text-faint: #90a4b8;
  --line: #e4eaf0;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(11, 31, 51, .07), 0 4px 14px rgba(11, 31, 51, .05);
  --shadow-lg: 0 8px 30px rgba(11, 31, 51, .16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --nav-h: 62px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--emerald-600); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
img { max-width: 100%; }
ul, ol { list-style: none; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed; }

/* ---------- app layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + var(--header-h) + 12px) 16px calc(var(--safe-bottom) + var(--nav-h) + 24px);
}
.app-main.full { max-width: none; }
.app-header {
  position: fixed; top: 0; right: 0; left: 0; z-index: 50;
  height: calc(var(--safe-top) + var(--header-h));
  padding-top: var(--safe-top);
  background: var(--navy-800);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding-inline: 14px;
  box-shadow: var(--shadow);
}
.app-header .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.app-header .spacer { flex: 1; }
.app-header .icon-btn { color: #fff; }
.header-store {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12);
  border: none; color: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: .85rem; max-width: 46vw;
}
.header-store .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); flex: none; }
.dot.gray { background: #94a3b8; }
.dot.red { background: var(--danger); }
.dot.amber { background: var(--warn); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  display: flex;
  height: calc(var(--nav-h) + var(--safe-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-faint); font-size: .72rem; font-weight: 500;
  text-decoration: none; transition: color .15s;
}
.bottom-nav a.active { color: var(--emerald-600); }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav .badge {
  position: absolute; top: 8px; margin-inline-start: -4px;
  background: var(--danger); color: #fff; font-size: .62rem;
  border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}

/* ---------- boot splash ---------- */
.boot-splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; gap: 18px; }
.boot-logo { font-size: 1.7rem; font-weight: 700; color: var(--navy-800); }

/* ---------- spinner ---------- */
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--emerald-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- page title ---------- */
.page-title { font-size: 1.15rem; font-weight: 700; margin: 6px 0 14px; color: var(--navy-800); }
.section-title { font-size: .95rem; font-weight: 700; margin: 20px 0 10px; color: var(--text); }

/* ---------- desktop adaptation ---------- */
@media (min-width: 768px) {
  .app-main { max-width: 760px; padding-top: calc(var(--safe-top) + var(--header-h) + 20px); }
}
@media (min-width: 1024px) {
  .bottom-nav {
    right: auto; width: 220px; top: 0; bottom: 0; height: auto;
    flex-direction: column; border-top: none; border-inline-end: 1px solid var(--line);
    padding-top: calc(var(--safe-top) + var(--header-h) + 10px); padding-bottom: 0;
    justify-content: flex-start; gap: 4px;
  }
  .bottom-nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 22px; font-size: .95rem; border-radius: 0 999px 999px 0; }
  .bottom-nav a.active { background: var(--emerald-100); }
  .app-main { margin-inline-start: 220px; max-width: 860px; }
  .app-header { margin-inline-start: 220px; }
  .app-header .brand { font-size: 1.2rem; }
}
