/* ===========================================================
   Schwarze Bulle — Parts Catalog
   Design tokens: blueprint navy + paper + safety orange
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #0F2A43;
  --ink-soft: #1C3A57;
  --paper: #F5F1E8;
  --paper-alt: #ECE6D8;
  --steel: #5C6B7A;
  --steel-light: #8B98A5;
  --safety: #D5570C;
  --safety-dark: #B3480A;
  --line: #CDC5B2;
  --line-dark: #3A5068;
  --ok: #3E6B4F;
  --card: #FFFFFF;
  --radius: 2px;
  --shadow: 0 1px 0 rgba(15,42,67,0.06), 0 8px 20px -12px rgba(15,42,67,0.25);
  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 4px solid var(--safety);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.brand-mark { height: 40px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand span.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--safety);
  text-transform: uppercase;
  margin-top: 4px;
}
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-search {
  display: flex;
  align-items: center;
  background: var(--ink-soft);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 40px;
  min-width: 220px;
}
.header-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 100%;
  padding: 8px 6px;
}
.header-search input::placeholder { color: var(--steel-light); }
.cart-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--safety);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.cart-link:hover { background: var(--safety); }
.cart-count {
  background: var(--safety);
  color: var(--ink);
  font-weight: 600;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.cart-link:hover .cart-count { background: var(--ink); color: var(--paper); }

/* ---------- Hero / index intro ---------- */
.catalog-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 40px;
  position: relative;
  overflow: hidden;
}
.catalog-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,241,232,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,241,232,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.catalog-hero .container { position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--safety);
  margin: 0 0 10px;
}
.catalog-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 56px);
  text-transform: uppercase;
  line-height: 0.98;
  margin: 0 0 14px;
  max-width: 820px;
}
.catalog-hero p.lede {
  font-size: 16px;
  color: var(--steel-light);
  max-width: 560px;
  margin: 0;
}
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-stats .stat { font-family: var(--font-mono); }
.hero-stats .stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--safety);
}
.hero-stats .stat span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel-light); }

/* ---------- Filter bar ---------- */
.filter-bar {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: 16px 0;
  position: sticky;
  top: 76px;
  z-index: 30;
}
.filter-bar .container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin-right: 4px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  border-color: var(--line);
}
.chip.active, .chip:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.result-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel);
}

/* ---------- Product grid ---------- */
.catalog-section { padding: 40px 0 80px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .sku-tab {
  position: absolute;
  top: 10px;
  left: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 10px 4px 12px;
  border-radius: 0 3px 3px 0;
  z-index: 2;
}
.card .thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.card .thumb .noimg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.card .card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--safety-dark);
}
.card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 8px;
}
.card .price { font-family: var(--font-mono); font-weight: 600; font-size: 16px; }
.card .price.unpriced { color: var(--steel-light); font-size: 12px; }
.card .compare { font-family: var(--font-mono); font-size: 12px; color: var(--steel-light); text-decoration: line-through; margin-right: 6px; }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  font-family: var(--font-mono);
  color: var(--steel);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.pagination button {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius);
}
.pagination button.active { background: var(--ink); color: var(--paper); }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Product detail page ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel);
  padding: 18px 0;
}
.breadcrumb a:hover { color: var(--safety-dark); }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  align-items: start;
}
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; gap: 28px; } }

.blueprint-frame {
  position: relative;
  background: var(--ink);
  padding: 28px;
  border-radius: var(--radius);
}
.blueprint-frame::before,
.blueprint-frame::after,
.blueprint-frame .corner-tl,
.blueprint-frame .corner-br {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--safety);
}
.blueprint-frame::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.blueprint-frame::after { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.blueprint-frame .image-wrap {
  background: var(--paper);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.blueprint-frame .image-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.blueprint-frame .image-wrap .noimg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.product-info .cat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--safety-dark);
  margin-bottom: 10px;
}
.product-info h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  text-transform: uppercase;
  line-height: 1.02;
  margin: 0 0 14px;
}
.product-info .sku-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--steel);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.product-info .price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
}
.product-info .price-block .price { font-family: var(--font-mono); font-weight: 700; font-size: 32px; }
.product-info .price-block .compare { font-family: var(--font-mono); font-size: 16px; color: var(--steel-light); text-decoration: line-through; }
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.stock-badge.in { background: rgba(62,107,79,0.12); color: var(--ok); }
.stock-badge.out { background: rgba(92,107,122,0.12); color: var(--steel); }
.stock-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.quote-banner {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 22px;
}
.quote-banner p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}
.qty-control button {
  background: none;
  border: none;
  width: 36px;
  height: 40px;
  font-size: 16px;
  color: var(--ink);
}
.qty-control button:hover { background: var(--paper-alt); }
.qty-control input {
  width: 44px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  height: 40px;
  font-family: var(--font-mono);
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.btn-primary { background: var(--safety); color: #fff; }
.btn-primary:hover { background: var(--safety-dark); }
.btn-primary:disabled { background: var(--steel-light); cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }

.product-description {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.product-description h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin: 0 0 14px;
}
.product-description .body-copy {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.product-description .body-copy p { margin: 0 0 12px; }
.product-description .body-copy strong { color: var(--ink); }

.trust-row {
  display: flex;
  gap: 20px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.trust-row .item {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--steel);
  display: flex;
  align-items: center;
  gap: 8px;
}
.trust-row .item .ico { color: var(--safety); font-weight: 700; }

/* ---------- Contact page ---------- */
.contact-page { padding: 40px 0 80px; max-width: 480px; }
.contact-page h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 34px;
  margin: 0 0 12px;
}
.contact-page .lede { color: var(--ink-soft); margin: 0 0 28px; }
.contact-options { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Policy page ---------- */
.policy-page { padding: 40px 0 80px; max-width: 640px; }
.policy-page h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 34px;
  margin: 0 0 24px;
}
.policy-page h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--steel);
  margin: 28px 0 8px;
}
.policy-page p { color: var(--ink-soft); line-height: 1.6; }
.policy-page code {
  font-family: var(--font-mono);
  background: var(--paper-alt);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 0.9em;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink);
  color: var(--paper);
  border-top: 4px solid var(--safety);
  z-index: 100;
  padding: 16px 24px;
}
.cookie-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 13px; color: var(--paper); }
.cookie-banner a { color: var(--safety); text-decoration: underline; }
.cookie-banner .btn { flex-shrink: 0; }

/* ---------- Cart page ---------- */
.cart-page { padding: 40px 0 80px; }
.cart-page h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 34px;
  margin: 0 0 24px;
}
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
@media (max-width: 860px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; top: auto; }
}
.cart-items { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row .actions { display: flex; align-items: center; gap: 16px; }
.cart-row .thumb {
  width: 72px; height: 72px; background: var(--paper-alt);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--line);
}
.cart-row .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-row .title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-row .sku { font-family: var(--font-mono); font-size: 11px; color: var(--steel); }
.cart-row .line-price { font-family: var(--font-mono); font-weight: 600; text-align: right; min-width: 70px; }
.cart-row .remove-btn {
  font-family: var(--font-mono); font-size: 11px; color: var(--steel);
  border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--radius); background: none;
}
.cart-row .remove-btn:hover { border-color: var(--safety); color: var(--safety-dark); }
.cart-qty { display: flex; align-items: center; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.cart-qty button { background: none; border: none; width: 28px; height: 30px; }
.cart-qty input { width: 34px; text-align: center; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 30px; font-family: var(--font-mono); font-size: 13px; }

.cart-summary {
  background: var(--ink);
  color: var(--paper);
  padding: 24px;
  border-radius: var(--radius);
  position: sticky;
  top: 160px;
}
.cart-summary h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel-light);
  margin: 0 0 18px;
}
.cart-summary .row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 14px; margin-bottom: 10px; }
.cart-summary .row.total { font-size: 18px; font-weight: 700; padding-top: 14px; margin-top: 8px; border-top: 1px dashed var(--line-dark); color: var(--safety); }
.cart-summary .checkout-btn { margin-top: 20px; }
.cart-empty { text-align: center; padding: 80px 0; font-family: var(--font-mono); color: var(--steel); }
.cart-empty a { color: var(--safety-dark); text-decoration: underline; }

@media (max-width: 560px) {
  .cart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }
  .cart-row .thumb { width: 60px; height: 60px; }
  .cart-row .info { flex: 1 1 auto; min-width: 0; }
  .cart-row .actions { flex-basis: 100%; justify-content: space-between; }
}

/* ---------- Status pages ---------- */
.status-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}
.status-page .box { max-width: 480px; }
.status-page .icon { font-family: var(--font-display); font-size: 64px; color: var(--safety); margin-bottom: 8px; }
.status-page h1 { font-family: var(--font-display); text-transform: uppercase; font-size: 30px; margin: 0 0 12px; }
.status-page p { color: var(--steel); margin-bottom: 24px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--steel-light);
  padding: 40px 0;
  margin-top: 40px;
  border-top: 4px solid var(--safety);
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer .foot-brand { font-family: var(--font-mono); font-size: 12px; color: var(--paper); }
.site-footer .foot-links { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 12px; }
.site-footer .foot-links a:hover { color: var(--safety); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--safety); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .header-search { display: none; }
  .site-header .container { height: 64px; }
  .catalog-hero { padding: 36px 0 28px; }
  .filter-bar { top: 64px; }
  .filter-bar .container {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-label, .chip { flex-shrink: 0; }
  .result-count { margin-left: 14px; }
}

/* OEM cross-reference chips + related parts (product page) */
.product-info .oem-line { border-bottom: none; padding-bottom: 0; margin-bottom: 12px; }
.oem-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  margin: 2px 4px 2px 0;
  color: var(--ink);
}
.related-parts { list-style: none; padding: 0; margin: 0; }
.related-parts li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.related-parts a { font-family: var(--font-mono); font-size: 13px; color: var(--ink); text-decoration: none; }
.related-parts a:hover { text-decoration: underline; }
