/* Parts catalog page. Builds on ../styles.css */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--red); }

.catalog-hero { padding: 64px 0 56px; }
.catalog-hero h1 { font-size: clamp(2.6rem, 6vw, 4.25rem); text-transform: uppercase; color: var(--white); margin-bottom: 14px; }
.catalog-section { padding-top: 40px; }

.catalog-tools { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 .92rem var(--body); background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip:hover { border-color: var(--red); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--white); }
.chip[aria-pressed="true"] span { color: rgba(255,255,255,.8); }
.chip:focus-visible, .part-photo:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.search input { font: 500 1rem var(--body); padding: 10px 14px; width: min(320px, 100%); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.search input:focus { outline: 2px solid var(--red); border-color: var(--red); }
.catalog-count { color: var(--muted); font-size: .92rem; margin: 18px 0 14px; }
.catalog-empty { padding: 30px 0; }

.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.part { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.part[hidden] { display: none; }
.part-photo { padding: 0; border: 0; background: #e9e6e1; aspect-ratio: 1; cursor: zoom-in; overflow: hidden; }
.part-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.part-photo:hover img { transform: scale(1.04); }
.part-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.part-cat { font: 600 .74rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.part h3 { font-size: 1.3rem; margin-bottom: 10px; }
.part-variants { list-style: none; padding: 0; margin: 0 0 12px; }
.part-variants li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px dashed var(--line); }
.part-variants li:first-child { border-top: 0; }
.pv-label { font-size: .9rem; color: var(--muted); }
.pv-label:empty { display: none; }
.pv-pn { font: 500 .82rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.pv-price { font: 700 1.2rem var(--head); color: var(--ink); text-align: right; white-space: nowrap; }
.part-price { font: 700 1.15rem var(--head); text-transform: uppercase; margin-bottom: 10px; }
.part-call { color: var(--muted); }
.part-notes { font-size: .92rem; color: var(--muted); margin-bottom: 12px; }
.part-add { margin-top: auto; align-self: flex-start; }
.part-add.added { background: var(--steel); border-color: var(--steel); }

.order { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.order-terms { padding-left: 18px; margin: 0 0 16px; }
.order-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.order-form h3 { margin: 0; }
.order-form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.order-form input, .order-form select, .order-form textarea { font: 400 1rem var(--body); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.order-form input:focus, .order-form select:focus, .order-form textarea:focus { outline: 2px solid var(--red); border-color: var(--red); }
.order-form .btn { justify-self: start; cursor: pointer; }
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.order-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg); border-radius: var(--radius); font-size: .95rem; }
.order-list input { width: 64px; padding: 6px 8px; }
.order-list button { border: 0; background: none; color: var(--red); font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 4px 6px; }
.order-empty, .order-hint { color: var(--muted); font-size: .92rem; margin: 0; }

.order-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; background: var(--red); color: var(--white); text-decoration: none; font: 600 1rem/1 var(--body); padding: 14px 20px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.order-fab span { display: inline-block; background: var(--white); color: var(--red); border-radius: 999px; padding: 3px 8px; margin-left: 6px; font-size: .85rem; }
.order-fab[hidden], .order-fab.off { display: none; }

@media (max-width: 960px) { .order { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 640px) {
  .parts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .part-body { padding: 10px 12px 12px; }
  .part h3 { font-size: 1.1rem; }
  .part-variants li { grid-template-columns: 1fr auto; }
  .pv-label { grid-column: 1 / -1; }
  .pv-price { font-size: 1.05rem; }
  .search input { width: 100%; }
  .search { width: 100%; }
}
@media (max-width: 400px) { .parts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .part-photo img { transition: none; } }
