/* ============================================================================
   RARA · catalog.css — catalog / search listing (filters, facets, sort, rail).
   Migrated from rara.css with the Slice-4 palette (gold breadcrumbs → warm-grey,
   focus rings → burgundy). Product grid + card + chips are shared (components.css).
   ============================================================================ */

.cat-search input{width:100%;max-width:520px;font-family:var(--mono);font-size:14px;padding:13px 16px;border:1px solid var(--line-2);background:var(--surface);margin-bottom:18px}
.cat-search input:focus{outline:2px solid var(--burgundy);outline-offset:2px}

.cat-grid{display:grid;grid-template-columns:248px 1fr;gap:40px;align-items:start}

/* Results grid density: the catalog results column is narrower than the home grid (the 248px facet
   rail eats width), so the shared .grid's 4 fixed columns cramp cards to ~146px at 1024 and wrap the
   2 note-chips. Floor the card width at 200px (rail-present desktop only) so columns auto-reduce to 3
   in the ~1001-1180 band and 4 only when there's room; keeps 2 chips on one row + uncramps name/image.
   Below 1001px the rail is a drawer and the components.css .grid 3/2-col rules apply unchanged. */
@media (min-width:1001px){
  .cat-grid .grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
}

/* filter rail */
.rail{position:sticky;top:88px;border-top:1px solid var(--burgundy);padding-top:6px}
.rail-h{font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink);padding:12px 0}
.facet{border-top:1px solid var(--line);padding:14px 0}
.facet-h{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--warm-grey);margin-bottom:10px}
.facet-opt{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:6px 0;cursor:pointer;font-size:13px;min-height:32px}
.facet-opt input{width:15px;height:15px;accent-color:var(--burgundy);cursor:pointer}
.facet-lbl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.facet-n{font-size:11px;color:var(--warm-grey)}
/* show-more/less toggle for long facets (House at 85 options over-ran the rail) */
.facet-more{display:inline-flex;align-items:center;gap:5px;margin-top:6px;padding:5px 0;
  background:none;border:0;cursor:pointer;font-family:var(--mono);font-size:11px;
  letter-spacing:.06em;text-transform:uppercase;color:var(--burgundy);min-height:32px}
.facet-more:hover{color:var(--burgundy-deep);text-decoration:underline}

/* price range */
.price-row{display:flex;align-items:center;gap:8px}
.price-row input{width:74px;font-family:var(--mono);font-size:13px;padding:8px 9px;border:1px solid var(--line-2);background:var(--surface);min-height:38px}
.price-sep{color:var(--warm-grey);font-size:12px}

/* mobile filters toggle: a collapsible rail drawer. Desktop keeps the sticky rail
   always visible, so the toggle is hidden there (shown only <=1000px below). */
.rail-toggle{display:none}

/* results bar + sort */
.cat-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.sort{display:flex;align-items:center;gap:9px}
.sort select{font-family:var(--mono);font-size:12px;padding:9px 12px;border:1px solid var(--line-2);background:var(--surface);cursor:pointer;min-height:40px}

@media(max-width:1000px){
  .cat-grid{grid-template-columns:1fr}
  /* Collapsible drawer: hidden until the shopper opens it via .rail-toggle. */
  .rail{position:static;display:none;grid-template-columns:repeat(2,1fr);gap:0 28px}
  .rail.is-open{display:grid}
  .rail-h{grid-column:1/-1}
  .rail-toggle{display:flex;align-items:center;gap:10px;width:100%;justify-content:flex-start;
    padding:13px 16px;border:1px solid var(--line-2);background:var(--surface);cursor:pointer;
    font-family:var(--mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink);
    min-height:48px;margin-bottom:16px}
  .rail-toggle-n{color:var(--burgundy)}
  .rail-toggle-caret{margin-left:auto;font-size:10px;transition:transform var(--dur-fast,.2s) var(--ease-out,ease)}
  .rail-toggle[aria-expanded="true"] .rail-toggle-caret{transform:rotate(180deg)}
}
@media(max-width:600px){.rail.is-open{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.rail-toggle-caret{transition:none}}

/* ============================================================================
   Slice 4d beautification — catalog cards, grid entrance, skeletons, states,
   filter/chip polish. Consumes tokens only; single accent = --burgundy; gold
   lives ONLY on the .card-badge (Colección tier). All motion is transform/
   opacity and is disabled under prefers-reduced-motion (bottom of file).
   ============================================================================ */

/* ---- card hover: lift + shadow only (motion.css .card/.card .ph rules), no image
   zoom here. The zoom used to double up with the lift on this page while home cards
   (catalog.css not loaded there) only got the lift — two different hover languages
   on the same card component. Restrained-motion pass: ONE consistent card-hover
   effect across home + catalog, so the lift now carries the whole affordance. ---- */

/* ---- Colección tier badge (the only gold on the card). Its positioning moved to
   components.css (.card .card-tags stacking) in Slice 5 so it holds on the PDP /
   home too, where catalog.css is not loaded; only the gold look stays in the badge. ---- */

/* ---- name / notes / price hierarchy ---- */
.card .name{margin-bottom:6px}
.card .price{color:var(--warm-grey)}
.card-price{font-weight:500;color:var(--ink)}

/* ---- grid entrance: CSS-only staggered mount (Alpine/fetch-injected nodes the
   IntersectionObserver can't hook). Replays whenever results change; keyed items
   that persist across a sort don't re-fire. Stagger caps at the 12th card. ---- */
@keyframes cardIn{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
.catalog .grid .card:not(.skeleton){
  animation:cardIn var(--dur-mid) var(--ease-out) both;
  animation-delay:calc(min(var(--i,0),11) * 45ms);
}

/* ---- skeletons: complete the card shape (shimmer, not a spinner) ---- */
.catalog .skeleton .house,
.catalog .skeleton .name,
.catalog .skeleton .price{
  background:linear-gradient(100deg,var(--cream-2) 30%,var(--sk-1) 50%,var(--cream-2) 70%);
  background-size:200% 100%;animation:sh 1.2s infinite;border-radius:2px;
}
.catalog .skeleton .house{height:9px;width:38%;margin:12px 0 8px}
.catalog .skeleton .name{height:20px;width:72%;margin:0 0 10px}
.catalog .skeleton .price{height:12px;width:46%;border-top:0;padding:0;margin-top:8px}

/* ---- designed empty / error states (composed, on-brand, not bare text) ---- */
.state-msg{padding:76px 0}
.state-mark{width:64px;height:64px;margin:0 auto 22px;display:grid;place-items:center;
  font-family:var(--serif);font-size:32px;line-height:1;color:var(--burgundy);
  background:var(--surface);border:1px solid var(--line-2);border-radius:50%}
.state-msg p{max-width:40ch;margin-left:auto;margin-right:auto}
.state-cta{margin-top:22px}

/* ---- applied-filter chips: clearer remove affordance + active count ---- */
.chip .chip-x{font-size:12px;line-height:1;color:var(--warm-grey);transition:color var(--dur-fast)}
.chip:hover .chip-x{color:var(--burgundy)}

/* ---- filter rail: selected rows read on the single accent ---- */
.facet-opt:hover .facet-lbl{color:var(--ink)}
.facet-opt:has(input:checked) .facet-lbl{color:var(--burgundy);font-weight:500}
.facet-opt:has(input:checked) .facet-n{color:var(--burgundy)}
.rail-count{color:var(--warm-grey);font-weight:400}

/* ---- reduced motion: no mount travel (card hover lift is handled globally by
   motion.css's reduce block) ---- */
@media(prefers-reduced-motion:reduce){
  .catalog .grid .card:not(.skeleton){animation:none}
}
