/* VAG Auto Group — ortaq dizayn */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e5e9f0;
  --brand: #0d47a1;
  --brand-2: #1565c0;
  --brand-soft: #e8f0fe;
  --ok: #16a34a;
  --ok-soft: #e7f7ed;
  --warn: #d97706;
  --warn-soft: #fff4e0;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --wa: #25d366;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand-2); text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- ümumi elementlər ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  background: var(--brand); color: #fff; transition: transform .08s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.icon-btn:active { background: rgba(0,0,0,.06); }

.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(21, 101, 192, .15); }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { font-size: 12px; opacity: .7; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f7; color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: 92vw;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1000; white-space: pre-line; box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- alt pəncərə (sheet) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 500; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + var(--safe-b)); animation: up .2s ease-out;
}
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 20px; } }
.sheet-head { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; flex: 1; font-size: 17px; }
.sheet-body { padding: 16px; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: .6 } }

/* ---------- qalereya ---------- */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #0b1220; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: min(70vw, 420px); object-fit: contain; scroll-snap-align: center; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; }
.gallery-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.gallery-dots i.on { background: var(--brand); }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.dark { border-color: rgba(13,71,161,.2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg) } }
