:root {
  /* Porsche motorsport palette: Guards-style red, anthracite, GT silver */
  --paper: #ECEEF0;
  --white: #FFFFFF;
  --graphite: #1F2226;
  --anthracite-2: #2C3036;
  --red: #C8102E;
  --red-dark: #A00C24;
  --silver: #C9CDD1;
  --steel: #7D848B;
  --steel-dark: #5A6168;
  --rule: #D8DBDE;
  --ink: #000000;
  --focus: #1F6FEB;
  --wide: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--wide);
  font-stretch: 100%;
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-stretch: 125%; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 650; }
.num, .card-pn, .pn-list, .card-price, .price { font-variant-numeric: tabular-nums; }

/* Header */
#site-header { background: var(--graphite); color: var(--white); position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--red); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.wordmark { font-stretch: 125%; font-weight: 700; font-size: 18px; text-decoration: none; white-space: nowrap; }
.header-search { flex: 1 1 280px; display: flex; max-width: 460px; }
.header-search input { flex: 1; min-width: 0; border: 1px solid #3A3F44; background: #2B2F33; color: var(--white); padding: 9px 12px; font: inherit; border-radius: var(--radius) 0 0 var(--radius); }
.header-search input::placeholder { color: #A5ABB1; }
.header-search button { border: 0; background: var(--red); color: var(--white); font: inherit; font-weight: 600; padding: 0 14px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
#site-header nav { display: flex; gap: 18px; margin-left: auto; }
#site-header nav a { text-decoration: none; color: #D7DADD; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
#site-header nav a:hover, #site-header nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--red); }
.header-search button:hover { background: var(--red-dark); }
@media (max-width: 760px) {
  .header-row { gap: 10px; }
  #site-header nav { margin-left: 0; width: 100%; gap: 16px; overflow-x: auto; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
}

/* Hero: data-plate search */
.hero {
  padding: 60px 0 56px; color: var(--white);
  background:
    radial-gradient(ellipse 70% 90% at 78% 30%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, var(--anthracite-2), var(--graphite));
  border-bottom: 1px solid #000;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.hero-media { margin: 0; width: 260px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 18px 40px rgba(0,0,0,.45); outline: 1px solid rgba(255,255,255,.12); }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-media { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; }
}
.hero h1 { color: var(--white); }
.hero p.lede { max-width: 60ch; color: var(--silver); margin: 14px 0 28px; font-size: 18px; }
.plate {
  position: relative;
  max-width: 780px;
  padding: 22px 26px 20px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, rgba(0,0,0,.03) 1px 3px),
    linear-gradient(180deg, #E4E7EA, #BFC4C9 55%, #D3D7DB);
  border: 1px solid #9AA0A6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(0,0,0,.15), 0 14px 30px rgba(0,0,0,.35);
  color: var(--ink);
}
.plate::before, .plate::after, .plate .rivet-b::before, .plate .rivet-b::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F2F4F5, #8E949A 70%);
  box-shadow: 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 1px rgba(0,0,0,.35);
}
.plate::before { top: 8px; left: 8px; } .plate::after { top: 8px; right: 8px; }
.plate .rivet-b::before { bottom: 8px; left: 8px; } .plate .rivet-b::after { bottom: 8px; right: 8px; }
.plate label { display: block; font-stretch: 125%; font-weight: 700; font-size: 14px; color: #2E3337; margin-bottom: 10px; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.plate-row { display: flex; gap: 10px; }
.plate input {
  flex: 1; min-width: 0; font: inherit; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  padding: 12px 14px; border: 1px solid #8A9096; border-radius: 3px; background: #F7F8F9;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.18);
}
.plate button { font: inherit; font-weight: 700; font-size: 17px; padding: 0 22px; border: 0; border-radius: 3px; background: var(--red); color: var(--white); cursor: pointer; }
.plate button:hover { background: var(--red-dark); }
.plate-examples { margin: 14px 0 0; font-size: 14px; color: #3A3F44; }
.plate-examples a { margin-right: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .plate-row { flex-direction: column; }
  .plate button { padding: 12px; }
  .plate input { font-size: 18px; }
}

/* Sections */
.section { padding: 44px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section:nth-of-type(odd) { background: var(--white); }
.section-head h2::after { content: ""; display: block; width: 36px; height: 3px; background: var(--red); margin-top: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head a { font-weight: 600; color: var(--red-dark); }
.vehicle-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border-top: 1px solid var(--rule); }
.vehicle-list li { border-bottom: 1px solid var(--rule); }
.vehicle-list a { display: flex; justify-content: space-between; gap: 10px; padding: 14px 4px; text-decoration: none; font-weight: 600; }
.vehicle-list a:hover { background: var(--paper); box-shadow: inset 3px 0 0 var(--red); }
.vehicle-list .count { color: var(--steel-dark); font-weight: 400; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.type-tile { display: grid; grid-template-rows: 150px auto; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; overflow: hidden; }
.type-tile:hover { border-color: var(--red); }
.type-tile:hover strong { color: var(--red-dark); }
.type-tile .tile-img { background: var(--white); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.type-tile .tile-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.type-tile .tile-text { padding: 12px 14px; border-top: 1px solid var(--rule); }
.type-tile strong { display: block; font-stretch: 112%; }
.type-tile span { color: var(--steel-dark); font-size: 14px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); }
.card:hover { border-color: var(--red); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-media { aspect-ratio: 4 / 3; background: var(--white); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--rule); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.no-photo { color: var(--steel); font-size: 14px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 15px; font-stretch: 100%; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-pn { margin: 0; font-size: 13px; color: var(--steel-dark); }
.card-meta { margin: 0; font-size: 13px; color: var(--steel-dark); }
.card-price { margin: auto 0 0; padding-top: 6px; font-weight: 700; font-size: 18px; }
.card-stock, .stock-out { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--steel-dark); }
.stock-out { display: inline-block; margin: 0 0 16px; padding: 4px 10px; border: 1px solid var(--graphite); color: var(--graphite); }
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 14px; }
}

/* Inventory */
.page-head { padding: 32px 0 20px; }
.page-head p { color: var(--steel-dark); max-width: 70ch; margin: 10px 0 0; }
.crumbs { font-size: 14px; color: var(--steel-dark); margin-bottom: 12px; }
.crumbs a { color: var(--steel-dark); }
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 28px; padding-bottom: 56px; }
.filters { align-self: start; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 4px; }
.filters fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 14px 0; }
.filters legend { font-weight: 700; font-stretch: 112%; padding: 0; margin-bottom: 8px; }
.filters label { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 3px 0; cursor: pointer; }
.filters label .count { color: var(--steel-dark); margin-left: auto; }
.filters input[type="search"], .filters input[type="number"], .toolbar select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #B9BEC3; border-radius: var(--radius); background: var(--white); width: 100%; }
.price-row { display: flex; gap: 8px; align-items: center; }
.btn-plain { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .result-count { font-weight: 600; }
.toolbar .sort { display: flex; align-items: center; gap: 8px; }
.toolbar .sort select { width: auto; }
.filter-toggle { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 13px; border: 1px solid #B9BEC3; background: var(--white); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); text-decoration: none; }
.pager [aria-current="page"] { background: var(--red); color: var(--white); border-color: var(--red); }
.empty { background: var(--white); border: 1px solid var(--rule); padding: 28px; border-radius: var(--radius); }
@media (max-width: 860px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .filter-toggle { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border: 1px solid var(--graphite); background: var(--white); border-radius: var(--radius); cursor: pointer; }
}

/* Product */
.product { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; padding: 8px 0 40px; }
.gallery-main { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main .gnav { position: absolute; top: 50%; transform: translateY(-50%); border: 1px solid var(--rule); background: rgba(255,255,255,.92); width: 44px; height: 44px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.gallery-main .prev { left: 10px; } .gallery-main .next { right: 10px; }
.gallery-count { font-size: 13px; color: var(--steel-dark); margin: 8px 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.thumbs button { padding: 0; border: 2px solid transparent; background: var(--white); border-radius: var(--radius); cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy h1 { font-size: clamp(22px, 2.6vw, 30px); }
.price { font-size: 32px; font-weight: 700; margin: 16px 0 4px; }
.price-note { color: var(--steel-dark); font-size: 14px; margin: 0 0 16px; }
.shipping-note { font-size: 15px; margin: 0 0 10px; padding: 10px 12px; background: var(--paper); border-left: 3px solid var(--red); }
.facts { margin: 0 0 20px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.facts dt { color: var(--steel-dark); }
.facts dd { margin: 0; }
.pn-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pn-list li { background: var(--paper); border: 1px solid var(--rule); padding: 2px 8px; border-radius: 3px; font-size: 14px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.btn { display: inline-block; text-align: center; font: inherit; font-weight: 700; padding: 14px 18px; border-radius: var(--radius); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--red); color: var(--white); border: 1px solid var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border: 1px solid var(--graphite); }
.btn-secondary:hover { background: var(--graphite); color: var(--white); }
.detail-block { padding: 24px 0; border-top: 1px solid var(--rule); }
.detail-block h2 { font-size: 20px; margin-bottom: 12px; }
.prose { max-width: 75ch; }
.prose p { margin: 0 0 10px; }
.prose h3 { font-size: 1rem; font-weight: 700; margin: 18px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 10px; padding-left: 1.2em; }
.prose li { margin: 0 0 4px; }
table.specs { border-collapse: collapse; width: 100%; max-width: 820px; font-size: 15px; background: var(--white); }
table.specs th, table.specs td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
table.specs th { width: 34%; color: var(--steel-dark); font-weight: 500; }
details.policy summary { cursor: pointer; font-weight: 700; font-stretch: 112%; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 20px; } }

/* Categories page */
.cat-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-bottom: 56px; }
.cat-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cat-list li { border-bottom: 1px solid var(--rule); }
.cat-list a { display: block; padding: 14px 4px; text-decoration: none; }
.cat-list a:hover { background: var(--white); }
.cat-list strong { display: flex; justify-content: space-between; gap: 10px; }
.cat-list span.d { display: block; color: var(--steel-dark); font-size: 14px; margin-top: 2px; }
@media (max-width: 760px) { .cat-columns { grid-template-columns: 1fr; } }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; padding-bottom: 56px; }
.contact-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.contact-details dt { color: var(--steel-dark); }
.contact-details dd { margin: 0; }
.contact form { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.contact label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.contact input, .contact textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #B9BEC3; border-radius: var(--radius); }
.contact textarea { min-height: 150px; resize: vertical; }
.contact button[disabled] { opacity: .55; cursor: not-allowed; }
.form-note { font-size: 14px; color: var(--steel-dark); margin: 0; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

/* Footer, notices */
#site-footer { background: var(--graphite); color: #D7DADD; padding: 36px 0; margin-top: 24px; border-top: 3px solid var(--red); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 24px; font-size: 14px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-name { font-stretch: 125%; font-weight: 700; color: var(--white); font-size: 16px; margin: 0 0 6px; }
.footer-note { margin: 0; color: #A5ABB1; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.notice { background: var(--white); border: 1px solid var(--rule); padding: 20px; border-radius: var(--radius); }
.loading { color: var(--steel-dark); padding: 40px 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Cart */
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.cart-count[hidden] { display: none; }
.cart-added { margin: -2px 0 2px; font-size: 14px; min-height: 1em; }
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding-bottom: 56px; }
.cart-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cart-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.cart-thumb { display: block; width: 96px; aspect-ratio: 4 / 3; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-name { font-weight: 600; text-decoration: none; }
.cart-name:hover { text-decoration: underline; }
.cart-info p { margin: 4px 0 0; }
.cart-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-qty { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qty-btn { width: 36px; height: 36px; border: 1px solid #B9BEC3; background: var(--white); border-radius: var(--radius); font-size: 18px; cursor: pointer; }
.qty-input { width: 52px; height: 36px; text-align: center; font: inherit; border: 1px solid #B9BEC3; border-radius: var(--radius); }
.cart-qty .btn-plain { margin-left: 8px; }
.cart-summary { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; position: sticky; top: 84px; display: grid; gap: 10px; }
.cart-summary .btn { width: 100%; }
.cart-sum-line { display: flex; justify-content: space-between; margin: 0; font-variant-numeric: tabular-nums; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list-code { border: 2px solid var(--red); border-radius: var(--radius); padding: 14px; text-align: center; }
.list-code p { margin: 4px 0; }
.list-code-label { font-size: 14px; color: var(--steel-dark); }
.list-code-value { font-stretch: 125%; font-weight: 800; font-size: 30px; letter-spacing: .04em; color: var(--red-dark); font-variant-numeric: tabular-nums; }
.lookup { max-width: 520px; padding-bottom: 20px; }
.lookup label { display: block; font-weight: 700; margin-bottom: 8px; }
.lookup input { flex: 1; min-width: 0; font: inherit; font-size: 20px; padding: 10px 12px; border: 1px solid #B9BEC3; border-radius: var(--radius); text-transform: uppercase; }
@media (max-width: 860px) {
  .cart { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 520px) {
  .cart-row { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-thumb { width: 72px; }
  .cart-qty { grid-column: 1 / -1; justify-content: flex-start; }
}
@media print {
  #site-header, #site-footer, .crumbs, .cart-actions, .qty-btn, .cart-qty .btn-plain, #get-code, #empty, .cart-summary .form-note + .form-note { display: none !important; }
  body { background: #fff; }
  .cart { grid-template-columns: 1fr; }
  .cart-summary { position: static; border: 0; padding: 0; }
  .qty-input { border: 0; width: auto; }
}

/* Full parts list (/parts/) */
.hub-jump a { margin-right: 14px; white-space: nowrap; }
.hub-list { margin: 0; padding-left: 1.2em; columns: 2 420px; column-gap: 40px; }
.hub-list li { margin: 0 0 8px; break-inside: avoid; }
.hub-meta, .hub-count { color: var(--steel-dark); font-weight: 400; }

/* Shop name above the home page headline */
.hero-brand { display: block; font-size: 0.42em; font-weight: 700; letter-spacing: 0.01em; color: var(--silver); margin-bottom: 10px; }
