/* =========================================================
   BLACK WOLF — Category / listing page
   (loads after style.css and reuses its tokens + product card)
   ========================================================= */

/* ---------- Page head ---------- */
.cat-hero { padding: 36px 0 28px; background: var(--bg-alt); }
.breadcrumb { font-size: 12px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--black); }
.breadcrumb [aria-current] { color: var(--black); }
.cat-hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.cat-hero h1 { font-family: var(--serif); font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; }
.cat-hero p { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 460px; }
.quick-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-cats button {
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 30px; background: #fff;
  font-size: 13px; transition: .25s;
}
.quick-cats button:hover { border-color: var(--black); }
.quick-cats button.is-active { background: var(--black); color: #fff; border-color: var(--black); }

/* ---------- Toolbar ---------- */
.cat-toolbar { position: sticky; top: 72px; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.filter-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.ft-count { min-width: 18px; height: 18px; padding: 0 5px; background: var(--black); color: #fff; border-radius: 10px; font-size: 10px; line-height: 18px; text-align: center; }
.result-count { margin: 0; font-size: 13px; color: var(--muted); }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sort span { color: var(--muted); }
.sort select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 32px 8px 12px; background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  cursor: pointer;
}
.sort select:focus { outline: none; border-color: var(--black); }
.grid-switch { display: flex; gap: 4px; }
.grid-switch button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: #b5b5b5; }
.grid-switch button.is-active { color: var(--black); background: var(--bg-alt); }
.grid-switch svg { width: 18px; height: 18px; }

/* ---------- Layout ---------- */
.cat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; padding-top: 32px; padding-bottom: 80px; align-items: start; }
.cat-layout.filters-hidden { grid-template-columns: 0 1fr; gap: 0; }
.cat-layout.filters-hidden .filters { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Filters ---------- */
.filters { position: sticky; top: 152px; max-height: calc(100vh - 170px); display: flex; flex-direction: column; transition: opacity .3s; }
.filters-body { overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.filters-head { display: none; }
.filters-foot { display: none; }
.filters-overlay { display: none; }
.f-group { border-bottom: 1px solid var(--line); padding: 16px 0; }
.f-group:first-child { padding-top: 0; }
.f-group summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.f-group summary::-webkit-details-marker { display: none; }
.f-group summary::after { content: "+"; font-size: 18px; font-weight: 300; line-height: 1; }
.f-group[open] summary::after { content: "–"; }
.f-group[open] summary { margin-bottom: 14px; }

.f-list { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 16px; height: 16px; border: 1px solid #bdbdbd; border-radius: 3px; flex-shrink: 0; display: grid; place-items: center; transition: .2s; }
.check .box.round { border-radius: 50%; }
.check input:checked + .box { background: var(--black); border-color: var(--black); }
.check input:checked + .box::after { content: ""; width: 8px; height: 4px; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible + .box { outline: 2px solid var(--black); outline-offset: 2px; }
.check small { margin-left: auto; color: var(--muted); font-size: 12px; }
.check.is-disabled { opacity: .4; cursor: default; }

.f-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.f-sizes button { height: 38px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 500; transition: .2s; background: #fff; }
.f-sizes button:hover { border-color: var(--black); }
.f-sizes button[aria-pressed="true"] { background: var(--black); color: #fff; border-color: var(--black); }

.f-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.f-colors button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: #555; }
.f-colors .dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 0 0 3px #fff, 0 0 0 4px transparent; transition: box-shadow .2s; }
.f-colors button[aria-pressed="true"] .dot { box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--black); }
.f-colors button[aria-pressed="true"] { color: var(--black); font-weight: 500; }

/* dual range */
.range { position: relative; height: 24px; margin: 4px 8px 16px; }
.range-track { position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--line); transform: translateY(-50%); border-radius: 3px; }
.range-track span { position: absolute; top: 0; bottom: 0; background: var(--black); border-radius: 3px; }
.range input { position: absolute; left: -8px; width: calc(100% + 16px); top: 0; height: 24px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--black); cursor: grab; }
.range input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--black); cursor: grab; }
.range input::-webkit-slider-runnable-track { background: none; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-inputs label { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.price-inputs label span { position: absolute; left: 10px; bottom: 9px; font-size: 13px; color: var(--ink); }
.price-inputs input { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 8px 8px 22px; width: 100%; -moz-appearance: textfield; }
.price-inputs input::-webkit-outer-spin-button, .price-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.price-inputs input:focus { outline: none; border-color: var(--black); }

/* ---------- Results ---------- */
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.active-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 30px; font-size: 12px; }
.chip svg { width: 12px; height: 12px; }
.chip:hover { border-color: var(--black); }
.chip-clear { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }

.cat-grid-products { display: grid; gap: 28px 18px; }
.cat-grid-products.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cat-grid-products.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cat-layout:not(.filters-hidden) .cat-grid-products.cols-4 { grid-template-columns: repeat(3, 1fr); }
.cat-layout.filters-hidden .cat-grid-products.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cat-grid-products .product-card { animation: cardIn .5s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rating { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.rating b { color: var(--ink); font-weight: 500; }
.sold-out { position: absolute; left: 12px; bottom: 12px; z-index: 2; background: var(--black); color: #fff; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; }
.product-card.is-oos .product-media img { opacity: .55; }

.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h3 { font-family: var(--serif); font-size: 26px; }
.empty-state p { color: var(--muted); font-size: 13px; margin: 8px 0 22px; }

.load-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 56px; }
.load-more p { margin: 0; font-size: 12px; color: var(--muted); }
.lm-bar { width: 200px; height: 2px; background: var(--line); }
.lm-bar span { display: block; height: 100%; background: var(--black); transition: width .4s; }
.load-more .btn { padding: 12px 40px; }
.load-more.is-done .btn { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cat-layout, .cat-layout.filters-hidden { grid-template-columns: 1fr; gap: 0; }
  .cat-grid-products.cols-4, .cat-layout:not(.filters-hidden) .cat-grid-products.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-switch { display: none; }

  /* filters become a drawer */
  .filters, .cat-layout.filters-hidden .filters {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; width: min(360px, 88vw); max-height: none;
    background: #fff; transform: translateX(-100%); transition: transform .35s ease;
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .filters.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .filters-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .filters-head h2 { font-family: var(--serif); font-size: 22px; }
  .filters-body { flex: 1; padding: 20px; }
  .filters-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .filters-foot .btn { justify-content: center; border-radius: 6px; padding: 13px; }
  .filters-overlay { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4); opacity: 0; visibility: hidden; transition: .3s; }
  .filters-overlay.is-open { opacity: 1; visibility: visible; }
  body.no-scroll { overflow: hidden; }
}

@media (max-width: 860px) {
  .cat-grid-products.cols-4, .cat-grid-products.cols-3,
  .cat-layout:not(.filters-hidden) .cat-grid-products.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .cat-hero-row { flex-direction: column; align-items: flex-start; }
  .quick-cats { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .quick-cats button { white-space: nowrap; }
}

@media (max-width: 640px) {
  .cat-toolbar { top: 72px; }
  .toolbar-inner { gap: 10px; }
  .result-count { display: none; }
  .sort span { display: none; }
  .filter-toggle { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
  .cat-layout { padding-top: 20px; }
}

/* New In pill + nav highlight */
.quick-cats .pill-new { position: relative; }
.quick-cats .pill-new::after { content: ""; position: absolute; top: 6px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--sale); }
