/* North - shared design system. Matches the landing page at north.joburg. */

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

:root {
  --blue: #0066ff;
  --blue-dark: #0052cc;
  --blue-light: #e8efff;
  --blue-subtle: #f3f6ff;
  --ink: #0a0a0a;
  --ink-light: #555;
  --ink-muted: #888;
  --border: #e2e2e2;
  --surface: #f6f7f9;
  --white: #fff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(10, 10, 10, 0.08);
  --header-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-muted); }
.light { color: var(--ink-light); }

/* ---- Header ------------------------------------------------------------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo { font-weight: 800; font-size: 1.4rem; color: var(--blue); letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--ink); font-weight: 500; }
.nav a:hover { color: var(--blue); }
.nav a.active { color: var(--blue); font-weight: 700; }
/* Buttons in the nav keep their own (white) text - beats the .nav a rule. */
.nav a.btn, .nav a.btn:hover { color: var(--white); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--ink); cursor: pointer; padding: 4px 6px; }
.page { padding-top: calc(var(--header-h) + 28px); padding-bottom: 60px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--white);
  padding: 14px 24px; border-radius: var(--radius);
  font-family: inherit; font-weight: 600; font-size: 1rem;
  border: none; cursor: pointer; transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { color: var(--white); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--ink); border-color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn.in-cart { background: var(--blue-light); color: var(--blue-dark); }
.btn.in-cart:hover { background: var(--blue-light); color: var(--blue-dark); }

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.card-pad-sm { padding: 18px; }

/* ---- Product grid / cards ----------------------------------------------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.product-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .14s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card .thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: var(--surface); display: block; }
.product-card .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card .title {
  font-weight: 600; font-size: 1rem; color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price { font-weight: 800; font-size: 1.15rem; }
.product-card .body .btn { margin-top: auto; }

/* ---- Badges / tags ------------------------------------------------------ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; background: var(--blue-light); color: var(--blue-dark);
}
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; background: var(--surface); color: var(--ink-light);
  border: 1px solid var(--border);
}
.badge-status { text-transform: capitalize; }

/* ---- Forms -------------------------------------------------------------- */
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.95rem; }
.field { margin-bottom: 18px; }
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=search], input[type=url], input[type=datetime-local],
select, textarea {
  width: 100%; padding: 12px 16px; font-family: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--white);
  color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light);
}
textarea { min-height: 100px; resize: vertical; }

/* ---- Filter / sort bar -------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); color: var(--ink-light); font-weight: 500;
  font-size: 0.9rem; cursor: pointer; transition: all .12s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* Single-line, swipeable filter strip (no ragged wrapping). */
.chip-row {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto;
  margin-bottom: 18px; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }

/* Search: one cohesive pill (borderless input + attached button). */
.searchbar {
  display: flex; align-items: stretch; width: 100%; margin-bottom: 16px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.searchbar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.searchbar input[type=search] {
  flex: 1; min-width: 0; border: none; box-shadow: none; border-radius: 0; background: transparent;
}
.searchbar input[type=search]:focus { outline: none; box-shadow: none; }
.searchbar .btn { flex: 0 0 auto; border-radius: 0; }

/* Empty state: centred, constrained, intentional. */
.empty { text-align: center; max-width: 460px; margin: 32px auto; padding: 40px 24px; }
.empty .empty-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { margin-top: 0; }

/* Results count + sort, on one tidy line. */
.results-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.results-row select { width: auto; padding: 8px 12px; }

/* ---- Tables (admin) ----------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
table.data th { background: var(--surface); font-weight: 600; color: var(--ink-light); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--blue-subtle); }

/* ---- Summary cards ------------------------------------------------------ */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 28px; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat .label { color: var(--ink-muted); font-size: 0.85rem; font-weight: 500; }
.stat .value { font-size: 1.8rem; font-weight: 800; margin-top: 4px; }

/* ---- Yard sale rail ----------------------------------------------------- */
.ys-section { margin-bottom: 26px; }
.ys-rail { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.ys-rail::-webkit-scrollbar { display: none; }
.ys-card {
  flex: 0 0 auto; width: 270px; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease;
}
.ys-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ys-thumbs { display: flex; gap: 2px; height: 120px; background: var(--surface); }
.ys-thumbs img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; }
.ys-body { padding: 14px; }
.ys-urgency {
  display: inline-block; background: var(--blue); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.badge-sale { background: #fff1e6; color: #c2410c; }

/* ---- Banners / notices -------------------------------------------------- */
.banner {
  background: var(--blue); color: var(--white); border-radius: var(--radius-lg);
  padding: 16px 22px; margin-bottom: 24px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.banner a { color: var(--white); text-decoration: underline; }
.notice { background: var(--blue-subtle); border: 1px solid var(--blue-light); color: var(--ink-light); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; }
.alert { background: #fff4f4; border: 1px solid #ffd5d5; color: #b00020; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }

/* ---- Address autocomplete ----------------------------------------------- */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.ac-item { padding: 10px 14px; cursor: pointer; font-size: 0.92rem; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--blue-subtle); }

/* ---- Upload previews ---------------------------------------------------- */
.upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-item { width: 96px; }
.upload-thumb {
  width: 96px; height: 96px; object-fit: cover; display: block;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
}
.upload-meta { font-size: 0.72rem; color: var(--ink-muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; line-height: 1.3; }
.spin {
  width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--blue-light); border-top-color: var(--blue);
  display: inline-block; animation: north-spin .7s linear infinite;
}
@keyframes north-spin { to { transform: rotate(360deg); } }

/* ---- Cart badge --------------------------------------------------------- */
.cart-icon { position: relative; }
.cart-count {
  position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---- Timeline ----------------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 24px 32px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -8px; top: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--border); border: 3px solid var(--white);
}
.timeline li.done::before { background: var(--blue); }
.timeline li.current::before { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
.timeline li.future { color: var(--ink-muted); }
.timeline .step-title { font-weight: 600; }
.timeline .step-time { font-size: 0.82rem; color: var(--ink-muted); }

/* ---- Modal -------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(10, 10, 10, 0.5); padding: 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 480px; margin: auto; }

/* ---- Auth / centred card ------------------------------------------------ */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; }

/* ---- Utilities ---------------------------------------------------------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gallery-main { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); aspect-ratio: 4/3; object-fit: cover; background: var(--surface); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.thumbs img.active { border-color: var(--blue); }

@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  .card { padding: 20px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card .body { padding: 12px; gap: 6px; }
  .product-card .title { font-size: 0.92rem; }
  .product-card .price { font-size: 1.05rem; }
  .page { padding-left: 0; padding-right: 0; }
  .container { padding: 0 16px; }

  /* Collapse the header nav behind a hamburger on mobile. */
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 6px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 4px; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: none; }
  .nav a.btn { margin: 10px 0; text-align: center; }
  .nav .cart-count { position: static; margin-left: 6px; }
}
