/* PartSource — mobile-parts marketplace styles.
   Design tokens from the Figma mock (Geist, slate palette, green accent). */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --dark: #0f172a;
  --text: #0f172a;
  --muted: #64748b;
  --light: #f1f5f9;
  --border: #e2e8f0;
  --green: #22c55e;
  --green-soft: #dcfce7;
  --green-dark: #15803d;
  --amber: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 10px 30px rgb(15 23 42 / 0.1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure {
  margin: 0;
}

.page {
  width: min(1200px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  flex: 1;
}

.link {
  color: var(--green-dark);
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* ----- buttons & inputs ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--green);
  color: #052e16;
}

.btn--primary:hover {
  background: #16a34a;
}

.btn--dark {
  background: var(--dark);
  color: #fff;
}

.btn--dark:hover {
  background: #1e293b;
}

.btn--outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--muted);
  background: var(--light);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn--block {
  width: 100%;
}

.input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

.input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

/* ----- navbar ----- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  width: min(1200px, 100% - 2.5rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--dark);
  color: var(--green);
}

.search {
  position: relative;
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
}

.search__icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}

.search__input {
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem 2.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--light);
  font: inherit;
  color: var(--text);
}

.search__input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  background: var(--surface);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgb(34 197 94 / 0.35);
}

/* ----- footer ----- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

.footer__inner {
  width: min(1200px, 100% - 2.5rem);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding: 2.25rem 0;
}

.footer__brand {
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer__cols {
  display: flex;
  gap: 4rem;
  margin-left: auto;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer__heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.footer__link {
  color: var(--text);
  font-size: 0.92rem;
}

.footer__link:hover {
  color: var(--green-dark);
}

.footer__bar {
  border-top: 1px solid var(--border);
}

.footer__bar p {
  width: min(1200px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ----- catalog layout ----- */

.catalog {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.filters {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.filters__title {
  font-size: 1rem;
}

.filters__clear {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dark);
}

.filters__clear:hover {
  text-decoration: underline;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.filter-group__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.filter-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-group__hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.chip:hover {
  border-color: var(--muted);
}

.chip--active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.price-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.price-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.price-form .btn {
  grid-column: 1 / -1;
}

/* ----- toolbar ----- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.results-info__title {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.results-info__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.sorts {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ----- product grid & cards ----- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.product-grid--row {
  margin-top: 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: radial-gradient(
    120% 120% at 20% 10%,
    #e2e8f0 0%,
    #f1f5f9 45%,
    #cbd5e1 100%
  );
  border-bottom: 1px solid var(--border);
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--condition {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid rgb(34 197 94 / 0.35);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1rem;
  flex: 1;
}

.product-card__model {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-card__title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.product-card__title-link:hover {
  color: var(--green-dark);
}

.product-card__stock {
  font-size: 0.8rem;
  color: var(--muted);
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--light);
}

.product-card__price {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ----- ratings ----- */

.rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rating__stars {
  display: inline-flex;
  gap: 0.05rem;
}

.star {
  color: #cbd5e1;
  font-size: 0.85rem;
}

.star--on {
  color: var(--amber);
}

.rating--lg .star {
  font-size: 1.05rem;
}

.rating__count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ----- empty state ----- */

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state--page {
  margin-top: 2rem;
  border-style: solid;
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--light);
  color: var(--muted);
}

.empty-state__code {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--muted);
}

.empty-state__title {
  font-size: 1.15rem;
}

.empty-state__text {
  color: var(--muted);
  max-width: 46ch;
}

.empty-state__actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

/* ----- breadcrumbs ----- */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.breadcrumbs__link:hover {
  color: var(--green-dark);
}

.breadcrumbs__current {
  color: var(--text);
  font-weight: 500;
}

/* ----- part detail ----- */

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 1.75rem;
  align-items: start;
}

.pdp__media {
  position: relative;
  background: radial-gradient(
    120% 120% at 20% 10%,
    #e2e8f0 0%,
    #f1f5f9 45%,
    #cbd5e1 100%
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.pdp__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp__info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.pdp__model {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdp__title {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pdp__description {
  color: var(--muted);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.88rem;
}

.specs-table__row {
  border-bottom: 1px solid var(--light);
}

.specs-table__row:last-child {
  border-bottom: 0;
}

.specs-table__key {
  text-align: left;
  padding: 0.55rem 0.9rem;
  color: var(--muted);
  font-weight: 500;
  width: 40%;
}

.specs-table__value {
  padding: 0.55rem 0.9rem 0.55rem 0;
  font-weight: 500;
}

/* ----- buy box ----- */

.buy-box {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.buy-box__price {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.buy-box__quality {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  align-self: flex-start;
}

.buy-box__stock {
  font-size: 0.85rem;
  color: var(--muted);
}

.buy-box__stock--low {
  color: var(--danger);
  font-weight: 600;
}

.buy-box__perks {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0.7rem 0 0;
  border-top: 1px solid var(--light);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.buy-box__perks li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  margin-right: 0.45rem;
}

.seller-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--light);
  transition: border-color 0.15s ease;
}

.seller-badge:hover {
  border-color: var(--muted);
}

.seller-badge__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.seller-badge__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.seller-badge__name {
  font-size: 0.9rem;
  font-weight: 600;
}

.seller-badge__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.verified {
  color: var(--green);
  font-size: 0.8em;
  margin-left: 0.15rem;
}

/* ----- more parts / section titles ----- */

.more-parts {
  margin-top: 2.25rem;
}

.section-title {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* ----- page hero / prose / cta ----- */

.page-hero {
  max-width: 720px;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.page-hero__title {
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-hero__text {
  color: var(--muted);
  font-size: 1rem;
}

.prose {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.prose h2 {
  font-size: 1.2rem;
  margin-top: 1.2rem;
}

.prose p,
.prose li {
  color: #334155;
}

.prose ol {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 2.5rem;
  padding: 1.6rem 1.8rem;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
}

.cta-band__title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.cta-band__sub {
  color: #94a3b8;
  font-size: 0.9rem;
}

.cta-band__actions {
  display: flex;
  gap: 0.6rem;
}

.cta-band .btn--outline {
  background: transparent;
  border-color: #334155;
  color: #fff;
}

.cta-band .btn--outline:hover {
  border-color: #64748b;
  background: rgb(255 255 255 / 0.06);
}

/* ----- sellers ----- */

.sellers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.seller-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.seller-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.seller-card__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.seller-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

.seller-card__id {
  min-width: 0;
}

.seller-card__name {
  font-size: 1rem;
}

.seller-card__location {
  font-size: 0.8rem;
  color: var(--muted);
}

.seller-card__rating {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.seller-card__score {
  font-weight: 700;
  color: var(--amber);
}

.seller-card__reviews {
  font-size: 0.8rem;
  color: var(--muted);
}

.seller-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--light);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat__key {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stat__value {
  font-weight: 700;
  font-size: 0.95rem;
}

.seller-card__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}

/* ----- seller detail hero ----- */

.seller-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.seller-hero__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 700;
}

.seller-hero__id {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.seller-hero__name {
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.seller-hero__location {
  color: var(--muted);
  font-size: 0.88rem;
}

.seller-hero__rating {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.seller-hero__score {
  font-weight: 700;
  color: var(--amber);
}

.seller-hero__reviews {
  font-size: 0.82rem;
  color: var(--muted);
}

.seller-hero__stats {
  display: flex;
  gap: 2.2rem;
  margin-left: auto;
}

/* ----- faq ----- */

.faq {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.faq__item[open] {
  border-color: rgb(34 197 94 / 0.4);
}

.faq__question {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--muted);
  flex-shrink: 0;
}

.faq__item[open] .faq__question::after {
  content: "–";
}

.faq__answer {
  padding: 0 1.2rem 1.1rem;
  color: #334155;
}

/* ----- responsive ----- */

@media (max-width: 1020px) {
  .product-grid,
  .sellers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pdp {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .buy-box {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 760px) {
  .catalog {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .navbar__inner {
    flex-wrap: wrap;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .nav-right .btn--outline:first-child {
    display: none;
  }

  .product-grid,
  .sellers-grid {
    grid-template-columns: 1fr;
  }

  .pdp {
    grid-template-columns: 1fr;
  }

  .footer__cols {
    margin-left: 0;
    gap: 2.5rem;
  }

  .seller-hero__stats {
    margin-left: 0;
  }
}
