/* Customer-facing parts store (dropship mirror) */

/* Hero */
.ps-hero {
  background: linear-gradient(180deg, #0d0e12 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 40px;
}
.ps-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 0 24px;
  max-width: var(--max);
  margin: 0 auto;
}
@media (max-width: 1000px) { .ps-hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.ps-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 14px 0 14px;
}
.ps-hero h1 .accent { color: var(--orange); }
.ps-lede { color: var(--text-2); font-size: 15.5px; line-height: 1.6; max-width: 600px; }
.ps-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.ps-hero-stats > div { display: flex; flex-direction: column; gap: 4px; }
.ps-hero-stats strong { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ps-hero-stats span { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; }

/* Filter row */
.ps-filters {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
}
.ps-filter-row {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  align-items: center;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
}
.ps-filter-row select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  max-width: 220px;
}
.ps-filter-row select:focus { border-color: var(--orange); }
.ps-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.ps-toggle input { accent-color: var(--orange); }
.ps-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: 0.4px; }

/* Grid */
.ps-main { padding: 24px 24px 64px; }
.ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.ps-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.ps-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow); }

.ps-image {
  aspect-ratio: 4/3;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ps-image img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 12px; }
.ps-image.empty { background: var(--bg-3); }
.ps-image.empty::after { content: "📷"; font-size: 32px; color: var(--text-3); }

.ps-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ps-brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--orange);
}
.ps-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 56px;
}
.ps-mfr { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }

.ps-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.ps-price { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.ps-price-was { font-size: 11px; color: var(--text-3); text-decoration: line-through; margin-left: 4px; }

.ps-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}
.ps-stock::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.ps-stock.high { color: var(--green); }
.ps-stock.low  { color: var(--warn); }
.ps-stock.out  { color: var(--text-3); }

.ps-actions {
  padding: 0 16px 14px;
  display: flex;
  gap: 6px;
}
.ps-actions .btn { flex: 1; padding: 9px 10px; font-size: 12px; }
.ps-actions .btn-primary {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
}
.ps-actions .btn-primary:hover { background: var(--orange-2); }
.ps-actions .btn-primary.added { background: var(--green); }
.ps-actions .btn-ghost {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ps-actions .btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

/* Pager */
.ps-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 32px 0 16px;
  flex-wrap: wrap;
}
.ps-pager button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ps-pager button:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.ps-pager button:disabled { opacity: 0.35; cursor: not-allowed; }
.ps-pager .info { color: var(--text-2); font-size: 13px; padding: 0 12px; }

.ps-empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ps-empty h3 { font-size: 18px; margin-bottom: 6px; color: var(--text); }

/* ────────── Layout: sidebar + main ────────── */
.ps-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 24px 24px 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .ps-layout { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
}

/* ────────── Sidebar ────────── */
.ps-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 64px);
  align-self: start;
}
@media (max-width: 900px) {
  .ps-sidebar { position: static; }
}
.ps-side-inner {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  max-height: calc(100vh - var(--header-h) - 96px);
  overflow-y: auto;
}
.ps-side-inner::-webkit-scrollbar { width: 6px; }
.ps-side-inner::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.ps-side-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.ps-side-group { margin-top: 14px; }
.ps-side-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 8px 6px;
}

.ps-side-list { display: flex; flex-direction: column; gap: 1px; }

.ps-side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px;
  transition: background .12s, color .12s;
}
.ps-side-link .ico { font-size: 14px; width: 18px; text-align: center; line-height: 1; }
.ps-side-link .lbl { flex: 1; font-weight: 500; }
.ps-side-link .qty {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  padding: 1px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.ps-side-link:hover { background: var(--bg-3); color: var(--text); }
.ps-side-link.active {
  background: rgba(255,107,0,0.12);
  color: var(--orange);
  font-weight: 600;
}
.ps-side-link.active .qty { background: var(--orange); color: #fff; }

.ps-side-foot {
  margin-top: 18px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.ps-side-foot strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 13px; }
.ps-side-foot a { color: var(--orange); font-weight: 700; text-decoration: none; }

/* ────────── Breadcrumb ────────── */
.ps-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 16px;
  font-size: 13px;
  color: var(--text-2);
}
.ps-crumb a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}
.ps-crumb a:hover { color: var(--orange); }
.ps-crumb .sep { color: var(--text-3); }
.ps-crumb-current { color: var(--orange); font-weight: 700; }
.ps-crumb-tag {
  display: inline-flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

/* ────────── Adjust .ps-main now lives inside .ps-layout ────────── */
.ps-main { padding: 0; }
