/* ==================================================
   PRO PHONE — Shared design system
   Buy • Sell • Repair • Everything Tech
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color */
  --ink: #0B1220;
  --muted: #6B7280;
  --muted-soft: #9AA3B2;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --primary: #2F5CFF;
  --primary-dark: #1E3FCC;
  --primary-soft: #EAF0FF;
  --accent: #6D5EF5;
  --success: #16A34A;
  --success-soft: #E9F9EF;
  --warning: #F59E0B;
  --warning-soft: #FEF3E2;
  --danger: #EF4444;
  --danger-soft: #FDECEC;
  --border: #EBEEF5;
  --border-soft: #F1F3F8;

  /* Spacing scale — keep every page's rhythm consistent */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 28px;
  --sp-7: 40px;

  /* Radius */
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --r-pill: 999px;

  /* Shadow — soft, low-contrast; premium marketplace feel rather than heavy drop-shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 2px 10px rgba(20, 29, 54, .05);
  --shadow-md: 0 12px 28px rgba(20, 29, 54, .09);
  --shadow-lift: 0 10px 24px rgba(47, 92, 255, .16);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Consistent vertical rhythm between page sections (home, product, panels, etc.) */
.section { margin: var(--sp-6) 0; }
.section:first-child { margin-top: 0; }

/* Lightweight heading scale so every page reads at the same size, not ad hoc inline styles */
.h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.02em; }
.h2 { font-size: 17px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.015em; }
.h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 4px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-md);
  padding: 13px 20px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, opacity .12s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(47,92,255,.24); }
.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-ghost {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.btn-light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-light:hover { background: var(--border-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card-pad { padding: 22px; }

/* ---------- Badges / Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.badge-new    { background: var(--primary-soft); color: var(--primary-dark); }
.badge-superb { background: var(--success-soft); color: var(--success); }
.badge-good   { background: #EAF3FF; color: #2563EB; }
.badge-fair   { background: var(--warning-soft); color: #B45309; }

.pill { font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: var(--r-pill); display: inline-block; letter-spacing: .01em; }
.pill-pending  { background: var(--warning-soft); color: #B45309; }
.pill-info     { background: var(--primary-soft); color: var(--primary-dark); }
.pill-progress { background: #EEF2FF; color: #4338CA; }
.pill-success  { background: var(--success-soft); color: var(--success); }
.pill-danger   { background: var(--danger-soft); color: var(--danger); }

.discount-tag {
  background: var(--success);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .01em;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  box-shadow: 0 3px 8px rgba(22,163,74,.28);
}

.qc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
}

/* ---------- Skeleton loading ---------- */
.skeleton {
  background: linear-gradient(90deg, #EEF1F7 25%, #E4E8F1 37%, #EEF1F7 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Toast ---------- */
#toast-stack {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 90vw);
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in .25s ease forwards;
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }

/* ---------- Bottom sheet ---------- */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 18, 32, .45);
  z-index: 998;
  display: none;
}
.sheet-overlay.open { display: block; animation: fade-in .18s ease; }
.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  z-index: 999;
  padding: 10px 20px 24px;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 -12px 30px rgba(20,29,54,.12);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 38px; height: 4px;
  background: var(--border);
  border-radius: var(--r-pill);
  margin: 6px auto 18px;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Step indicator ---------- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 20px;
}
.step-indicator .step {
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--border);
  transition: background .2s ease;
}
.step-indicator .step.done, .step-indicator .step.active {
  background: var(--primary);
}

/* ---------- Forms ---------- */
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=password],
.field input[type=number],
.field input[type=date],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  outline: none;
}
.chip-select { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-select .chip {
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.chip-select .chip.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* ---------- Scrollers ---------- */
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { display: none; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state p { font-size: 13.5px; max-width: 280px; margin: 0 auto; }
.empty-state .icon-wrap {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--primary);
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.mt-0 { margin-top: 0; }
.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.link-more {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
