/* ===========================================================================
   category.css - House of Canopies range listing. Depends on brand.css +
   chrome.css. Owns the category head strip, the filter rail, the toolbar and
   the product-card grid.

   The .cat-card shares its DNA with home.css's .pcard ("Most specified"
   cards); if more pages grow product cards, the two are worth unifying into a
   shared css/cards.css. Reuses brand.css primitives (.chip, .price, .btn,
   .eyebrow, .wrap) rather than redefining them.

   Rail + toolbar classes are namespaced .cat-* so they can't collide with
   other pages that may grow their own filter UI.
   =========================================================================== */

/* ---- head strip ---------------------------------------------------------- */
.cat-head{padding-top:64px}   /* longhand: must NOT reset .wrap's horizontal padding */
.cat-head h1{font-size:clamp(34px,5vw,52px);font-weight:800;letter-spacing:-.02em;line-height:1;margin:14px 0 0}
.cat-head p{margin:18px 0 0;font-size:15px;color:var(--ink-2);max-width:60ch;line-height:1.6}

/* bordered data strip (mock .data): top rule on --ink, cells split by hairlines */
.cat-head .cat-data{display:flex;flex-wrap:wrap;gap:0;margin-top:28px;border-top:1px solid var(--ink);border-bottom:1px solid var(--line)}
.cat-head .cat-data .d{padding:16px 28px 16px 0;margin-right:28px;border-right:1px solid var(--line);font-size:12px;color:var(--ink-3);white-space:nowrap}
.cat-head .cat-data .d:last-child{border-right:0;margin-right:0}
.cat-head .cat-data .d b{display:block;font-size:18px;font-weight:800;color:var(--ink);letter-spacing:-.01em}
.cat-head .cat-data .d b small{font-size:11px;font-weight:600}

/* ---- shop layout: sticky rail + results -------------------------------- */
/* padding-top (longhand) so this rule doesn't reset .wrap's horizontal padding
   to 0 - that cascade clash (equal specificity, category.css loaded later) was
   what zeroed the side gutters and hugged the page below 1280px.
   minmax(0,1fr) is kept as plain hygiene: it stops the results column's
   min-content ever bulging the grid past the wrap, should card sizing change. */
.cat-shop{display:grid;grid-template-columns:248px minmax(0,1fr);gap:48px;padding-top:40px;align-items:start}
.cat-results{min-width:0}
.cat-results--full{grid-column:1 / -1}    /* when a range has no filters */

/* ---- filter rail --------------------------------------------------------- */
.cat-rail{position:sticky;top:74px;align-self:start}
.cat-fgroup{border-top:1px solid var(--ink);padding:18px 0 22px}
.cat-fgroup+.cat-fgroup{border-top:1px solid var(--line)}
.cat-fgroup h4{font-size:11px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;color:var(--ink-3);margin-bottom:14px}
.cat-fopt{display:flex;align-items:center;gap:10px;font-size:13.5px;padding:5px 0;cursor:pointer;color:var(--ink-2)}
.cat-fopt:hover{color:var(--ink)}
.cat-fopt .cat-fbox{width:15px;height:15px;border:1px solid var(--ink-4);flex:none;display:grid;place-items:center;transition:background .12s,border-color .12s}
.cat-fopt input{position:absolute;opacity:0;width:0;height:0}
.cat-fopt input:focus-visible+.cat-fbox{outline:2px solid var(--green);outline-offset:2px}
.cat-fopt input:checked+.cat-fbox{background:var(--green);border-color:var(--green)}
.cat-fopt input:checked+.cat-fbox::after{content:"";width:8px;height:4px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translateY(-1px)}
.cat-fopt .cat-fn{margin-left:auto;color:var(--ink-4);font-size:12px}
.cat-clear{font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--green-text,var(--green));background:none;border:0;padding:14px 0 0;cursor:pointer}
.cat-clear:hover{text-decoration:underline;text-underline-offset:3px}

/* ---- toolbar ------------------------------------------------------------- */
.cat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-bottom:20px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.cat-count{font-size:13px;color:var(--ink-3)}
.cat-count b{color:var(--ink);font-weight:700}
.cat-sort{display:inline-flex;align-items:center;gap:10px;cursor:pointer}
.cat-sort select{font:inherit;font-size:13px;border:1px solid var(--line);background:var(--card);padding:9px 12px;color:var(--ink);cursor:pointer}

.cat-noresults{color:var(--ink-3);font-size:14px;padding:40px 0}
.cat-noresults .cat-clear-inline{font:inherit;color:var(--green-text,var(--green));background:none;border:0;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:0}

/* ---- grid ---------------------------------------------------------------- */
/* Flexible auto-fill keeps cards at the original ~280px scale and flexes the
   column count with width. The min(280px,100%) clamp is the key edge fix: it
   stops a track ever being forced wider than its container (which was causing
   horizontal overflow and the page hugging the wall on narrow viewports). */
.cat-grid-wrap{padding-top:40px}
.cat-none{color:var(--ink-3);font-size:15px;padding:18px 0 60px}
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));gap:24px;padding-top:26px}

/* ---- product card -------------------------------------------------------- */
.cat-card{border:1px solid var(--line);background:var(--card);display:flex;flex-direction:column;transition:border-color .15s;min-width:0}
.cat-card[hidden]{display:none}
.cat-card:hover{border-color:var(--ink-3)}
.cat-card .ph{background:var(--card);border-bottom:1px solid var(--line);aspect-ratio:1/1;overflow:hidden;display:block}
.cat-card .ph img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.cat-card:hover .ph img{transform:scale(1.025)}
.cat-card .bd{padding:20px 20px 22px;display:flex;flex-direction:column;gap:12px;flex:1}
.cat-card .rng{font-size:10.5px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;color:var(--ink-4)}
.cat-card h3{font-size:16.5px;font-weight:700;letter-spacing:-.01em}
.cat-card .chips{display:flex;gap:6px;flex-wrap:wrap}
.cat-card .meta-row{display:flex;gap:14px;font-size:12px;color:var(--ink-3)}
.cat-card .meta-row b{color:var(--ink);font-weight:600}
.cat-card .meta-row{display:flex;gap:14px;font-size:12px;color:var(--ink-3)}
.cat-card .meta-row b{color:var(--ink);font-weight:600}
.cat-card .price .ex{font-size:20px}
.cat-card .price .inc{margin-top:2px}
.cat-card .foot{margin-top:auto;display:flex;justify-content:space-between;align-items:end;gap:10px}
.cat-card .foot .btn{padding:11px 18px}

/* ---- not-found ----------------------------------------------------------- */
.cat-empty{padding-top:80px;padding-bottom:96px}
.cat-empty h1{font-size:32px;font-weight:800;letter-spacing:-.02em;margin:12px 0 14px}
.cat-empty p{color:var(--ink-2);margin-bottom:26px;max-width:50ch;line-height:1.6}

/* ---- responsive ---------------------------------------------------------- */
/* The grid manages its own column count (auto-fill + min() clamp); we only
   collapse the rail/results split and tighten the head strip. */
@media(max-width:1000px){
  .cat-shop{grid-template-columns:1fr;gap:0}
  .cat-rail{position:static;display:grid;grid-template-columns:1fr 1fr;gap:0 28px;margin-bottom:8px}
  .cat-rail .cat-clear{grid-column:1 / -1}
}
@media(max-width:600px){
  .cat-head{padding-top:40px}
  .cat-head .cat-data{flex-wrap:wrap}
  .cat-grid{grid-template-columns:1fr}
}
