/* catalog.css — front page + product archives. Sidebar, grid, card, info band. */

/* ============ CATEGORY BAR ============ */
.b3d-catbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.b3d-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.b3d-chip {
  background: transparent;
  border: 1px solid var(--b3d-n-300);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 13px;
  color: var(--b3d-ink-soft);
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 150ms var(--b3d-ease);
}
.b3d-chip:hover { border-color: var(--b3d-ink); color: var(--b3d-ink); }
.b3d-chip.active { background: var(--b3d-ink); color: var(--b3d-fleece); border-color: var(--b3d-ink); }
.b3d-chip.active .b3d-chip-count { background: rgba(255,255,255,0.2); color: var(--b3d-fleece); }
.b3d-chip-count {
  font-family: var(--b3d-font-mono); font-size: 11px; font-weight: 500;
  background: var(--b3d-fleece-2); color: var(--b3d-n-600);
  border-radius: 999px; padding: 1px 8px;
}
.b3d-sortrow { display: flex; align-items: center; gap: 10px; }
.b3d-sort-label {
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 13px; color: var(--b3d-n-600);
}
.b3d-sort {
  font-family: var(--b3d-font-body); font-size: 14px;
  border: 1px solid var(--b3d-n-300); border-radius: 999px;
  padding: 8px 14px; background: white; color: var(--b3d-ink);
  cursor: pointer;
}

/* ============ GRID + CARD ============ */
.b3d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.b3d-grid-2 { grid-template-columns: repeat(2, 1fr); }
.b3d-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--b3d-n-200);
  transition: transform 220ms var(--b3d-ease), border-color 220ms var(--b3d-ease);
  cursor: pointer;
}
.b3d-card:hover { transform: translateY(-4px); border-color: var(--b3d-n-400); }
.b3d-thumb {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--b3d-fleece-2);
}
.b3d-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms var(--b3d-ease);
}
.b3d-card:hover .b3d-thumb img { transform: scale(1.04); }
.b3d-badge {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 11px; letter-spacing: 0.5px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--b3d-fleece); color: var(--b3d-ink);
  backdrop-filter: blur(4px);
}
.b3d-badge-rev { font-family: var(--b3d-font-mono); font-weight: 500; }
.b3d-body {
  padding: 18px 20px 10px; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.b3d-host {
  font-family: var(--b3d-font-mono); font-size: 11px;
  color: var(--b3d-n-500);
}
.b3d-title {
  font-family: var(--b3d-font-title); font-weight: 600;
  font-size: 17px; line-height: 1.3;
  color: var(--b3d-ink); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.b3d-desc {
  font-size: 14px; color: var(--b3d-n-600);
  line-height: 1.5; margin: 2px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.b3d-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px 18px;
}
.b3d-foot-action { display: flex; align-items: center; gap: 8px; }
.b3d-price {
  font-family: var(--b3d-font-title); font-weight: 700;
  font-size: 20px; color: var(--b3d-ink); line-height: 1;
}
.b3d-link-arrow {
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 13px; color: var(--b3d-ink);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ============ INFO BAND ============ */
.b3d-info-band {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.b3d-info-card {
  background: white;
  border: 1px solid var(--b3d-n-200);
  border-radius: 20px;
  padding: 28px;
}
.b3d-info-icon {
  width: 44px; height: 44px;
  background: var(--b3d-fleece-2);
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px; color: var(--b3d-ink);
  margin-bottom: 18px;
}
.b3d-info-card h4 {
  font-family: var(--b3d-font-title); font-weight: 700;
  font-size: 20px; color: var(--b3d-ink); margin: 0 0 8px;
}
.b3d-info-card p {
  font-size: 14.5px; color: var(--b3d-n-600); margin: 0; line-height: 1.55;
}
.b3d-info-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-family: var(--b3d-font-ui); font-weight: 600; font-size: 14px; color: var(--b3d-ink);
}
.b3d-info-link:hover { text-decoration: underline; }

/* ============ EMPTY ============ */
.b3d-empty {
  text-align: center; padding: 60px 20px;
  background: var(--b3d-fleece-2);
  border-radius: 20px;
}
.b3d-empty p { font-size: 16px; color: var(--b3d-n-600); margin: 0 0 18px; }

/* ============ BROWSE LAYOUT (sidebar + body) ============ */
.b3d-browse {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
.b3d-browse > * { min-width: 0; }
.b3d-cat-sidebar {
  position: sticky; top: 92px;
  align-self: start;
  background: white;
  border: 1px solid var(--b3d-n-200); border-radius: 20px;
  padding: 20px;
}
.b3d-cat-sidebar-title {
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--b3d-n-500); margin: 0 0 12px; padding: 0 8px;
}
.b3d-cat-nav { display: flex; flex-direction: column; gap: 2px; }
/* One row per category: the name links to the category; the arrow (if any) opens its branch in place. */
.b3d-cat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 12px;
  transition: background 150ms var(--b3d-ease);
}
.b3d-cat-row:hover { background: var(--b3d-fleece-2); }
.b3d-cat-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center; gap: 10px;
  padding: 10px 12px;
  font-family: var(--b3d-font-ui); font-weight: 600;
  font-size: 14px; line-height: 1.3; color: var(--b3d-ink);
}
.b3d-cat-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; color: var(--b3d-n-600);
}
.b3d-cat-label { min-width: 0; overflow-wrap: anywhere; }
.b3d-cat-row.active { background: var(--b3d-ink); }
.b3d-cat-row.active .b3d-cat-link, .b3d-cat-row.active .b3d-cat-icon, .b3d-cat-row.active .b3d-cat-expand { color: var(--b3d-fleece); }

.b3d-cat-expand {
  width: 32px; height: 32px; margin-right: 6px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--b3d-n-500); font-size: 10px; cursor: pointer;
}
.b3d-cat-expand:hover { background: var(--b3d-n-200); color: var(--b3d-ink); }
.b3d-cat-row.active .b3d-cat-expand:hover { background: var(--b3d-ink-soft); }
.b3d-cat-expand i { transition: transform 150ms var(--b3d-ease); }
.b3d-cat-expand[aria-expanded="true"] i { transform: rotate(90deg); }

/* Sub-categories: no icons, hung off a guide line under the parent's icon, names wrap. */
.b3d-cat-children {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 6px 25px;
  padding-left: 12px;
  border-left: 2px solid var(--b3d-n-200);
}
.b3d-cat-children[hidden] { display: none; }
.b3d-grid .b3d-card[hidden] { display: none; }
.b3d-cat-row-child .b3d-cat-link {
  grid-template-columns: minmax(0, 1fr);
  padding: 8px 10px;
  font-family: var(--b3d-font-body); font-weight: 600;
  color: var(--b3d-ink-soft);
}
.b3d-cat-row-child.active { background: var(--b3d-fleece-2); }
.b3d-cat-row-child.active .b3d-cat-link { color: var(--b3d-ink); font-weight: 700; }
.b3d-cat-row-child.active .b3d-cat-expand { color: var(--b3d-n-500); }

/* Phone-only "Category" button (shown by mobile.css once catalog.js makes the sidebar collapsible). */
.b3d-cat-toggle { display: none; }
@media (prefers-reduced-motion: reduce) { .b3d-cat-expand i { transition: none; } }
.b3d-browse-main { display: flex; flex-direction: column; gap: 20px; }
.b3d-browse-toolbar {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
}
.b3d-search-body {
  display: flex; align-items: center; gap: 12px;
  background: white; border: 1px solid var(--b3d-n-300);
  border-radius: 999px; padding: 14px 20px;
  transition: border-color 150ms var(--b3d-ease);
}
.b3d-search-body:focus-within { border-color: var(--b3d-ink); }
.b3d-search-body i.fa-search { color: var(--b3d-n-500); font-size: 15px; }
.b3d-search-body input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-family: var(--b3d-font-body); font-size: 15.5px; color: var(--b3d-ink);
}
.b3d-search-clear {
  border: 0; background: var(--b3d-fleece-2); color: var(--b3d-n-600);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
}
.b3d-browse-count {
  font-family: var(--b3d-font-ui); font-size: 14px; color: var(--b3d-n-600);
}
.b3d-browse-count strong { color: var(--b3d-ink); font-weight: 700; }
.b3d-browse-count span { color: var(--b3d-ink); font-weight: 600; }

/* ============ ARCHIVE HEADER ============ */
.b3d-archive-head { margin-bottom: 24px; }
.b3d-archive-head h1 { font-family: var(--b3d-font-title); font-weight: 700; font-size: var(--b3d-text-4xl); margin: 0 0 8px; color: var(--b3d-ink); letter-spacing: -0.02em; }
.b3d-archive-head p { margin: 0; color: var(--b3d-n-700); max-width: 60ch; }

/* ============ PAGINATION ============ */
.b3d-browse-clear { color: var(--b3d-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.b3d-pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin-top: 32px;
  font-family: var(--b3d-font-ui); font-size: 14.5px;
}
.b3d-page-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.b3d-page-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 2px solid var(--b3d-n-200); border-radius: var(--b3d-radius-sm);
  background: #fff; color: var(--b3d-ink); font-weight: 600; text-decoration: none;
  transition: border-color 150ms var(--b3d-ease);
}
a.b3d-page-link:hover, a.b3d-page-link:focus-visible { border-color: var(--b3d-ink); }
.b3d-page-link.is-current { background: var(--b3d-ink); border-color: var(--b3d-ink); color: #fff; }
.b3d-page-step i { font-size: 11px; }
.b3d-page-gap { display: inline-flex; align-items: flex-end; height: 40px; padding: 0 4px; color: var(--b3d-n-500); }
@media (max-width: 640px) {
  .b3d-page-step { flex: 1 1 40%; }        /* Previous / Next share a row; numbers wrap below */
  .b3d-pagination .b3d-page-list { order: 3; width: 100%; justify-content: center; }
}
