/* The parts marketplace. Loaded AFTER public.css and never instead of
   it: every structural class the parts pages use (.public-page,
   .public-header, .public-hero, .public-grid, .public-vcard,
   .public-sublink, .public-browse-section, .public-footer) is the car
   marketplace's own, so the two sites are the same site. Item: "same
   design as the car site".

   What is here is only what a parts shop has and a car marketplace
   does not: the shelves, the counter, and a buyer's own request page.
   Every colour, radius and font below is a theme.css token, never a
   literal, for the same reason public.css gives. */

/* ─── SEARCH ─── */

/* The car landing's search box is 480px because it sits under a short
   heading. A part is described by more words than a car is ("right
   hand headlamp, 2016 Hilux"), so the box is wider and the placeholder
   has room to teach what can be typed into it. */
.pt-search { max-width: 560px; }

.pt-asked {
  margin: 18px 0 0; padding: 12px 14px;
  /* The same pastel-bg/saturated-text pair every other completion
     state in this app uses, rather than a second green. */
  background: var(--badge-complete-bg); border: 1px solid var(--lime-deep);
  color: var(--badge-complete-text);
  border-radius: var(--radius-md); font-size: var(--font-size-body);
}

.pt-count { color: var(--grey); font-size: var(--font-size-label); }
.pt-empty { max-width: 60ch; line-height: 1.7; }
.pt-section-lead { color: var(--grey); font-size: var(--font-size-label); margin: 0 0 14px; max-width: 70ch; line-height: 1.6; }

/* ─── THE CARD ─── */

/* A part needs two lines the car card does not: what state it is in,
   and who is selling it. Both are small and quiet, because the
   heading and the price are what a buyer scans. */
.pt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pt-tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--grey); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.pt-shop { font-size: var(--font-size-small); color: var(--grey); margin-top: 8px; }

/* ─── THE SHELVES ─── */

.pt-shelves-section { margin-top: 32px; }
.pt-shelves {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
/* A shelf, not a pill. The browse-by-make row uses .public-sublink
   because a make is one word; a department has a name and a count and
   reads as a place you walk to, so it gets a box with two lines. */
.pt-shelf {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--ink);
}
.pt-shelf:hover { border-color: var(--lime-deep); }
.pt-shelf-name { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.pt-shelf-meta { font-size: 0.72rem; color: var(--grey); font-family: 'Space Mono', monospace; }
.pt-sublink-ask { border-style: dashed; }
.pt-shelf-ask { margin: 26px 0 0; color: var(--grey); font-size: var(--font-size-label); }

/* ─── THE COUNTER ─── */

/* Deliberately the most solid block on the page. On an empty
   marketplace this is the only thing that works, so it is not allowed
   to look like a footer afterthought. */
.pt-counter {
  margin: 36px 0 0; padding: 24px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.pt-counter h2 { font-size: 1.15rem; margin: 0 0 8px; }
.pt-counter-lead { color: var(--grey); font-size: var(--font-size-body); margin: 0 0 18px; max-width: 62ch; line-height: 1.6; }
.pt-counter-error {
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--badge-danger-bg); border: 1px solid var(--badge-danger-text);
  color: var(--badge-danger-text); font-size: var(--font-size-label);
}
.pt-counter-form { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
.pt-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 0; min-width: 0; }
.pt-field-label { font-size: var(--font-size-label); font-weight: 500; color: var(--ink); }
.pt-field input { width: 100%; margin: 0; font-size: 16px; }
.pt-field-help { font-size: var(--font-size-small); color: var(--grey); line-height: 1.5; }
.pt-optional { color: var(--grey); font-weight: 400; }
.pt-field-row { display: flex; gap: 12px; }
.pt-field-narrow { flex: 0 0 96px; }
.pt-counter-submit { align-self: flex-start; }
/* Off screen rather than display:none. A bot reading the markup fills
   anything it can see in the DOM; hiding it this way keeps it out of
   the layout without announcing that it is a trap. */
.pt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 560px) {
  .pt-field-row { flex-direction: column; }
  .pt-field-narrow { flex: 1 1 auto; }
  .pt-counter { padding: 18px 16px; }
}

/* ─── FOR SELLERS ─── */

.pt-sell { margin: 36px 0 8px; }
.pt-sell h2 { font-size: 1.05rem; margin: 0 0 8px; }
.pt-sell p { color: var(--grey); font-size: var(--font-size-body); margin: 0 0 14px; max-width: 62ch; line-height: 1.6; }

/* ─── A BUYER'S OWN REQUEST ─── */

.pt-request-note { color: var(--grey); font-size: var(--font-size-body); margin: 0 0 4px; max-width: 62ch; }
.pt-keep {
  margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--paper); border: 1px solid var(--line);
  font-size: var(--font-size-label); color: var(--grey); max-width: 62ch; line-height: 1.6;
}
.pt-offers { margin: 32px 0 0; }
.pt-offers h2 { font-size: 1.05rem; margin: 0 0 14px; }
.pt-offer {
  padding: 16px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: 12px;
}
.pt-offer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pt-offer-name { font-size: 0.95rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.pt-offer-name:hover { text-decoration: underline; }
.pt-offer-price { font-family: 'Space Mono', monospace; font-weight: 700; color: var(--ink); }
.pt-offer-note { color: var(--grey); font-size: var(--font-size-label); margin: 8px 0 12px; line-height: 1.6; }
.pt-close { margin: 24px 0 0; }

/* ─── SORT AND REFINEMENTS ─── */

/* .filter-chip is theme.css's own, the same object the car
   marketplace's filter bar is built from, so a buyer meets one control
   on both sites. These are anchors rather than buttons because the
   whole state lives in the URL: no JavaScript, every refinement is
   shareable and back works. */
.pt-refine { margin: 18px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.pt-refine-group { display: flex; flex-direction: column; gap: 6px; }
.pt-refine-label { font-size: var(--font-size-label); color: var(--grey); font-weight: 500; }
.pt-refine-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* An anchor styled as a chip needs the bits a button gets for free. */
.pt-refine-row .filter-chip { text-decoration: none; display: inline-flex; align-items: baseline; gap: 6px; }
.pt-refine-row .filter-chip:hover { border-color: var(--lime-deep); }
.pt-refine-row .filter-chip.active:hover { border-color: var(--black); }
.pt-refine-count { font-family: 'Space Mono', monospace; font-size: 0.72rem; opacity: 0.75; }
.pt-refine-hidden { margin: 0; font-size: var(--font-size-small); color: var(--grey); line-height: 1.6; max-width: 64ch; }
