:root {
  /* core palette */
  --ink: #111418;
  --ink-soft: #2D3138;
  --muted: #5C6470;
  --line: #E6E7EA;
  --line-soft: #F0F1F3;
  --paper: #FAFAFA;
  --white: #FFFFFF;

  /* brand — vivid trade orange */
  --brand: #FF7A1A;
  --brand-dark: #E5631A;
  --brand-tint: #FFF1E5;
  --brand-text: #B34800;

  /* accents */
  --green: #00A06B;
  --green-tint: #E2F6EE;
  --red: #DC2626;

  /* neutral thumb — restrained for trade context */
  --thumb-bg: #F4F5F7;
  --thumb-fg: #2D3138;
  --thumb-stripe-default: #5C6470;
  /* per-category accent stripe — single hue, kept subtle */
  --cat-cable-stripe: #FF7A1A;
  --cat-containment-stripe: #475569;
  --cat-lighting-stripe: #CA8A04;
  --cat-switchgear-stripe: #2D3138;
  --cat-accessories-stripe: #6B7280;
  --cat-tools-stripe: #047857;
  --cat-other-stripe: #94A3B8;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(17,20,24,0.04);
  --shadow-pop: 0 8px 24px rgba(17,20,24,0.10);

  --container: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────── nav ─────────── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.nav-search {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.nav-search input {
  width: 100%;
  height: 44px;
  padding: 0 18px 0 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.nav-search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255,122,26,0.15);
}
.nav-search::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6470' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
}
.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
}
.nav-link:hover { background: var(--line-soft); }

/* ─────────── buttons ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.06s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark {
  background: var(--ink);
  color: var(--white);
}
.btn-dark:hover { background: var(--ink-soft); }
.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--line-soft); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ─────────── hero ─────────── */
.hero {
  padding: 40px 0 32px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.hero h1 .accent {
  color: var(--brand);
}
.hero-lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 22px;
  max-width: 480px;
}
.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-trust {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}
.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-trust .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* hero illustration: stacked sample cards */
.hero-art {
  position: relative;
  height: 360px;
}
.hero-card-mini {
  position: absolute;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}
.hero-card-mini .thumb {
  aspect-ratio: 5 / 4;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 700;
  background: var(--thumb-bg);
  color: var(--thumb-fg);
  background-image:
    linear-gradient(var(--white) 1px, transparent 1px),
    linear-gradient(90deg, var(--white) 1px, transparent 1px);
  background-size: 18px 18px;
  position: relative;
}
.hero-card-mini .thumb::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--thumb-stripe-default);
}
.hero-card-mini .thumb[data-cat="cable"]::before { background: var(--cat-cable-stripe); }
.hero-card-mini .thumb[data-cat="lighting"]::before { background: var(--cat-lighting-stripe); }
.hero-card-mini .thumb[data-cat="switchgear"]::before { background: var(--cat-switchgear-stripe); }
.hero-card-mini .thumb[data-cat="containment"]::before { background: var(--cat-containment-stripe); }
.hero-card-mini .body {
  padding: 12px 14px;
}
.hero-card-mini .title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.hero-card-mini .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.hero-card-mini .price {
  font-weight: 700;
  font-size: 0.95rem;
}
.hero-card-1 {
  top: 0;
  right: 200px;
  transform: rotate(-3deg);
}
.hero-card-2 {
  top: 80px;
  right: 0;
  transform: rotate(3deg);
}
.hero-card-3 {
  top: 200px;
  right: 130px;
  transform: rotate(-1.5deg);
}

/* ─────────── category rail ─────────── */
.cat-rail {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  position: sticky;
  top: 68px;
  z-index: 30;
}
.cat-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  cursor: pointer;
}
.cat-chip:hover { background: var(--line-soft); }
.cat-chip.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.cat-chip.active .cat-chip-icon { background: rgba(255,255,255,0.2); color: var(--white); }
.cat-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}
/* category chip icons — single neutral surface, no rainbow */
.cat-chip .cat-chip-icon {
  background: var(--paper);
  color: var(--ink-soft);
}
.cat-chip:hover .cat-chip-icon { background: var(--white); }

/* ─────────── listings ─────────── */
.section { padding: 32px 0 64px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.18s, border-color 0.12s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
  border-color: var(--line);
}
.card-thumb {
  aspect-ratio: 5 / 4;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  position: relative;
  overflow: hidden;
  background: var(--thumb-bg);
  color: var(--thumb-fg);
  /* faint engineer-grid pattern for texture without colour */
  background-image:
    linear-gradient(var(--white) 1px, transparent 1px),
    linear-gradient(90deg, var(--white) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
}
.card-thumb::before {
  /* a thin coloured strip down the left so categories are still distinguishable */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--thumb-stripe-default);
}
.card-thumb[data-cat="cable"]::before       { background: var(--cat-cable-stripe); }
.card-thumb[data-cat="containment"]::before { background: var(--cat-containment-stripe); }
.card-thumb[data-cat="lighting"]::before    { background: var(--cat-lighting-stripe); }
.card-thumb[data-cat="switchgear"]::before  { background: var(--cat-switchgear-stripe); }
.card-thumb[data-cat="accessories"]::before { background: var(--cat-accessories-stripe); }
.card-thumb[data-cat="tools"]::before       { background: var(--cat-tools-stripe); }
.card-thumb[data-cat="other"]::before       { background: var(--cat-other-stripe); }

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink);
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.card-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.card-rrp {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: line-through;
  font-weight: 500;
}
.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  background: var(--ink);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ─────────── filters bar (listings page) ─────────── */
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}
.filter:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.filter-clear {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--brand);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-pill);
}
.filter-clear:hover { background: var(--brand-tint); }

/* ─────────── form (sell page) ─────────── */
.form-shell {
  max-width: 640px;
  margin: 32px auto 80px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  box-shadow: var(--shadow-card);
}
.form-shell h1 { margin-bottom: 6px; }
.form-shell .lead { color: var(--ink-soft); margin-bottom: 28px; }
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.form-row > label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.form-row .help {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -2px;
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=tel],
.form-row input[type=number],
.form-row select,
.form-row textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-row input[type=text]:focus,
.form-row input[type=email]:focus,
.form-row input[type=tel]:focus,
.form-row input[type=number]:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,122,26,0.12);
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-submit {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.form-submit small { color: var(--muted); font-size: 0.82rem; }

/* ─────────── trust bar (homepage) ─────────── */
.trust-bar {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.trust-cell h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.trust-cell .icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-text);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
}
.trust-cell p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ─────────── footer ─────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--white);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer a { color: var(--ink-soft); text-decoration: none; margin-right: 14px; }
.footer a:hover { color: var(--brand); }

/* ─────────── empty / loading ─────────── */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  margin-top: 24px;
}
.empty a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* ─────────── responsive ─────────── */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { display: none; }
  .trust-grid { grid-template-columns: 1fr; gap: 18px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-search { display: none; }
  .nav-link { display: none; }
  .form-shell { padding: 24px 18px; margin: 20px 12px 60px; }
  .hero h1 { font-size: 1.7rem; }
}
