/* ========================================================================
   Pick Your Part — South Bend: Modern Redesign
   Internal prototype. No affiliation with PYP. Original design by Jeffery.
   ======================================================================== */

:root {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --ink: #14171a;
  --ink-2: #4b5159;
  --ink-3: #808790;
  --line: #e8e6df;
  --line-2: #d6d3c8;
  --accent: #b8531a;          /* warm rust — picks up on the yard/wrench feel */
  --accent-ink: #8a3d11;
  --accent-soft: #fbeede;
  --good: #237a3e;            /* PYP green as secondary accent (subtle nod) */
  --warn: #b07a00;
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.04), 0 1px 1px rgba(20, 23, 26, 0.03);
  --shadow-md: 0 4px 12px rgba(20, 23, 26, 0.06), 0 1px 2px rgba(20, 23, 26, 0.04);
  --shadow-lg: 0 12px 32px rgba(20, 23, 26, 0.08), 0 2px 6px rgba(20, 23, 26, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============== TOP BAR ============== */
.topbar {
  background: #14171a;
  color: #d8d5cc;
  font-size: 13px;
  border-bottom: 1px solid #2a2e33;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 9px;
  padding-bottom: 9px;
  gap: 24px;
  flex-wrap: wrap;
}
.topbar__location {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__sep { color: #555a62; }
.topbar__meta {
  display: flex;
  gap: 24px;
  align-items: center;
}
.topbar__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar__status .dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ============== HEADER ============== */
.header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand__mark {
  width: 44px; height: 44px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
  position: relative;
  overflow: hidden;
}
.brand__mark span {
  color: var(--accent);
}
.brand__mark::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #f1b250);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand__tag {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  font-variant: small-caps;
  margin-top: 2px;
}
.nav {
  display: flex;
  gap: 4px;
}
.nav__link {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--ink-2);
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.nav__link:hover {
  background: var(--bg);
  color: var(--ink);
}
.nav__link.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ============== HERO ============== */
.hero {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 90% 10%, rgba(184, 83, 26, 0.08), transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(35, 122, 62, 0.05), transparent 50%);
  pointer-events: none;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding: 64px 0 56px;
  position: relative;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--ink);
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p.lead {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 540px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 0.08s, box-shadow 0.12s, background 0.12s;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: #000; }
.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: var(--accent-ink); }
.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--bg); }

/* Hero visual — stats card */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.statcard {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.statcard h3 {
  margin: 0 0 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.statrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.statrow:first-of-type { border-top: none; }
.statrow__label { color: var(--ink-2); }
.statrow__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.statrow__value--accent { color: var(--accent); font-size: 22px; letter-spacing: -0.02em; }

/* ============== INVENTORY GRID ============== */
.section {
  padding: 56px 0;
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.section__sub {
  color: var(--ink-2);
  margin: 0;
  font-size: 15px;
}
.section__filter {
  display: flex;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: none;
  transition: background 0.12s, color 0.12s;
}
.chip:hover { color: var(--ink); }
.chip.is-active {
  background: var(--ink);
  color: #fff;
}

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

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.12s, border-color 0.12s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.card__photo {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #2a2e33 0%, #14171a 100%);
  position: relative;
  overflow: hidden;
}
.card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__photo svg.car-silhouette {
  width: 70%;
  height: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.45;
}
.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card__id {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
}
.card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.card__trim {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
.card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.spec {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.card__loc {
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card__parts {
  color: var(--accent-ink);
  font-weight: 600;
}

/* ============== VEHICLE DETAIL ============== */
.detail {
  padding: 48px 0;
}
.detail__crumb {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.detail__crumb a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 2px;
}
.detail__head {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.gallery {
  background: linear-gradient(135deg, #2a2e33 0%, #14171a 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
}
.gallery svg {
  width: 70%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.4;
}
.gallery__count {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.detail__title {
  margin: 0 0 8px;
  font-size: 36px;
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.1;
}
.detail__sub {
  color: var(--ink-3);
  margin: 0 0 24px;
  font-size: 16px;
}
.specsgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.specsgrid__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.specsgrid__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
}
.specsgrid__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.locationpill {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid #f3d4a8;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--accent-ink);
  font-weight: 600;
}
.locationpill svg { flex-shrink: 0; }

.detail__divider {
  height: 1px;
  background: var(--line);
  margin: 32px 0;
}

.parts {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.parts__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.parts__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.parts__search {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  position: relative;
}
.parts__search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  font-family: inherit;
}
.parts__search input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg-elev);
}
.parts__search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}

.partstable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.partstable th {
  text-align: left;
  padding: 12px 22px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.partstable td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.partstable tr:last-child td { border-bottom: none; }
.partstable tr:hover td { background: #fafaf5; }
.partstable__code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-3);
}
.partstable__name { font-weight: 600; }
.partstable__price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-ink);
  text-align: right;
}
.partstable__warranty {
  color: var(--ink-2);
  font-size: 13px;
  text-align: right;
}

/* ============== FIND PARTS BY TYPE ============== */
.findparts {
  padding: 56px 0;
}
.findparts__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.findparts__lead {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 32px;
  max-width: 640px;
}
.searchbox {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.searchbox label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 6px;
}
.searchbox select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  font-family: inherit;
  color: var(--ink);
}
.searchbox select:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg-elev);
}
.searchbox__input {
  position: relative;
}
.searchbox__input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.searchbox__input input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  font-family: inherit;
  color: var(--ink);
}
.searchbox__input input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg-elev);
}

.suggestions {
  margin-bottom: 24px;
}
.suggestions__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.suggestions__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chip--soft {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid #f3d4a8;
}
.chip--soft:hover {
  background: #fbe2c4;
}

.card__matchlist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-2);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.matchlist__item strong { color: var(--ink); }
.matchlist__more {
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 600;
}

.matchcount {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.matchcount strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============== EMPTY STATE ============== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.empty h3 {
  color: var(--ink);
  font-size: 20px;
  margin: 12px 0 8px;
}
.empty svg { opacity: 0.4; }

/* ============== FOOTER ============== */
.footer {
  background: #14171a;
  color: #b6b3a9;
  padding: 48px 0 32px;
  margin-top: 60px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 36px;
}
.footer__brand {
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  margin-bottom: 12px;
}
.footer__addr,
.footer__phone {
  margin: 4px 0;
  font-size: 14px;
}
.footer h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.footer p, .footer ul {
  font-size: 14px;
  line-height: 1.7;
}
.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer ul li::before {
  content: '·';
  margin-right: 8px;
  color: var(--accent);
}
.footer__small {
  font-size: 12px;
  color: #808790;
  margin-top: 8px;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
  .hero h1 { font-size: 32px; }
  .detail__head { grid-template-columns: 1fr; gap: 24px; }
  .detail__title { font-size: 28px; }
  .searchbox { grid-template-columns: 1fr 1fr; }
  .searchbox__main { grid-column: span 2; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .topbar__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topbar__meta { flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .searchbox { grid-template-columns: 1fr; }
  .searchbox__main { grid-column: span 1; }
  .specsgrid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
}