/* Global Contractor Group: catalog layout v2 (products-v2.html, materials-v2.html).
   Search bar, category pills, active filters, filter sidebar and product grid.
   Uses the tokens and components from gcg.css; load it after gcg.css. */

/* ---------- short page hero ---------- */
.phead.cx-hero{padding:clamp(22px,3.2vw,40px) 0 clamp(18px,2.6vw,30px)}
.cx-herogrid{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px 32px}
.cx-herogrid>div:first-child{min-width:0;flex:1 1 420px}
.cx-hero h1{max-width:none;font-size:clamp(42px,5vw,64px)}
.cx-hero .lead{margin-top:10px}
.cx-hero .ctas{margin-top:0}
.cx-kick{display:flex;align-items:center;gap:9px;margin-bottom:10px;font-weight:800;font-size:14.5px;color:var(--g)}
.cx-kick::before{content:"";width:24px;height:4px;border-radius:2px;background:var(--or);flex:none}

/* ---------- catalog shell ---------- */
section.cx{--gut:clamp(14px,2.6vw,28px);padding:clamp(18px,2.4vw,28px) 0 var(--sec);background:var(--con)}
.cx :focus-visible{outline:3px solid var(--chalk);outline-offset:2px}

/* search bar + tools */
.cx-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px;margin-bottom:14px}
.cx-search{display:flex;align-items:center;gap:6px;flex:1 1 440px;max-width:700px;min-width:0;margin:0;padding:4px 4px 4px 14px;background:#fff;border:2px solid var(--line);border-radius:14px;transition:border-color .2s,box-shadow .2s}
.cx-search:hover{border-color:#B6BFB6}
.cx-search:focus-within{border-color:var(--chalk);box-shadow:0 0 0 4px rgba(47,111,219,.15)}
.cx-search>.ic{width:20px;height:20px;color:var(--mute)}
.cx-search input{flex:1;min-width:0;min-height:44px;padding:0 6px;border:0;background:transparent;font-size:16px;font-weight:500}
.cx-search input:focus,.cx-search input:focus-visible{outline:0}
.cx-search input::placeholder{color:var(--mute);opacity:.85}
.cx-search .btn{min-height:44px;padding:0 20px}
.cx-tools{display:flex;align-items:center;gap:10px}
.cx-count{font-size:15px;color:var(--mute);white-space:nowrap}
.cx-fbtn{display:none;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:2px solid var(--g);border-radius:12px;background:#fff;color:var(--g);font-weight:700;font-size:14.5px;white-space:nowrap}
.cx-fbtn:hover{background:var(--g);color:#fff}
.cx-fbtn .ic{width:19px;height:19px}
.cx-fn{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:99px;background:var(--or);color:#fff;font-size:12.5px;font-weight:700}
.cx-sort{min-height:44px;max-width:100%;padding:0 38px 0 13px;border:2px solid var(--line);border-radius:12px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2B2D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center/15px;font-weight:700;font-size:14.5px;color:var(--g);-webkit-appearance:none;appearance:none;cursor:pointer;transition:border-color .2s}
.cx-sort:hover{border-color:var(--g)}

/* category pills */
.cx-types{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.cx-types button{flex:none;display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:0 16px;border:2px solid var(--line);border-radius:99px;background:#fff;color:var(--g);font-weight:700;font-size:14.5px;white-space:nowrap;transition:border-color .2s,background .2s,color .2s}
.cx-types button small{font-size:12.5px;font-weight:700;color:var(--mute)}
.cx-types button:hover{border-color:var(--g)}
.cx-types button[aria-pressed=true]{background:var(--g);border-color:var(--g);color:#fff}
.cx-types button[aria-pressed=true] small{color:var(--cau)}

/* active filter chips */
.cx-active{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 14px}
.cx-active button{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:0 9px 0 13px;border:0;border-radius:99px;background:var(--or-l);color:var(--g);font-weight:700;font-size:13.5px;transition:background .2s}
.cx-active button:hover{background:#FFD2B8}
.cx-active button .ic{width:14px;height:14px;stroke-width:2.8}
.cx-active .cx-clearall{padding:0 8px;background:none;color:var(--g);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:2px;text-decoration-color:var(--or)}
.cx-active .cx-clearall:hover{background:none;color:var(--or-d)}

/* two columns */
.cx-layout{display:grid;grid-template-columns:16.5rem minmax(0,1fr);gap:24px;align-items:start}
.cx-side{position:sticky;top:64px;background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:0 16px 6px}
.cx-shead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 0 10px;border-bottom:1px solid var(--line)}
.cx-shead h2{font:900 26px/1 var(--display)}
.cx-x{display:none}
.cx-group{min-width:0;margin:0;padding:12px 0;border:0;border-bottom:1px solid var(--line)}
.cx-group:last-child{border-bottom:0}
.cx-group legend{float:left;width:100%;margin-bottom:6px;padding:0;font-weight:800;font-size:14px}
.cx-group legend+*{clear:both}
.cx-opt{display:flex;align-items:center;gap:10px;min-height:38px;margin:0 -8px;padding:2px 8px;border-radius:9px;font-size:14.5px;font-weight:600;line-height:1.25;cursor:pointer;transition:background .15s}
.cx-opt:hover{background:var(--con)}
.cx-opt input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--g);cursor:pointer}
.cx-opt span{flex:1;min-width:0}
.cx-opt small{flex:none;min-width:26px;padding:1px 7px;border-radius:99px;background:var(--con);color:var(--g);font-size:12.5px;font-weight:700;text-align:center}
.cx-opt:has(input:checked) small{background:var(--g);color:#fff}
.cx-opt.zero{color:var(--soft);cursor:default}
.cx-opt.zero:hover{background:none}
.cx-opt.zero input{cursor:default}
.cx-sfoot{display:none}
.cx-scrim{display:none}

/* results */
.cx-results{min-width:0}
.cx-selbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-bottom:12px;padding:8px 8px 8px 14px;background:#fff;border:1px solid var(--line);border-radius:var(--r)}
.cx-selbar .pcount{font-size:14.5px}
.cx-selbar .pcount b{font-size:24px;margin-right:3px}
.cx-selnote{flex:1 1 220px;font-size:14px;color:var(--mute)}
.cx-selbar .btn{margin-left:auto}
.cx-ctx{margin:0 0 12px;font-size:14.5px;color:var(--mute)}
.cx-ctx b{color:var(--g)}
.cx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:12px}
.cx-card{position:relative;display:flex;flex-direction:column;min-width:0;background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;scroll-margin-top:90px;transition:border-color .2s,box-shadow .25s,transform .25s}
.cx-card:hover{transform:translateY(-3px);box-shadow:0 20px 36px -26px rgba(30,43,45,.6)}
.cx-card.is-on{border-color:var(--or);box-shadow:0 0 0 1px var(--or)}
.cx-card.is-on:hover{box-shadow:0 0 0 1px var(--or),0 20px 36px -26px rgba(30,43,45,.6)}
.cx-card:target{border-color:var(--chalk);box-shadow:0 0 0 2px var(--chalk)}
.cx-img{position:relative;display:block;aspect-ratio:24/17;overflow:hidden;background:var(--con2)}
.cx-img img{width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.2,.8,.2,1)}
.cx-card:hover .cx-img img{transform:scale(1.06)}
.cx-mat .cx-img{aspect-ratio:7/5;background:#F4F6F3}
.cx-img .draw{display:grid;place-items:center;width:100%;height:100%;padding:10px}
.cx-img .draw svg{width:100%;height:100%}
.cx-tick{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--or);color:#fff;box-shadow:0 4px 10px rgba(0,0,0,.2);opacity:0;transform:scale(.6);transition:opacity .2s,transform .3s cubic-bezier(.3,1.6,.5,1)}
.cx-tick .ic{width:17px;height:17px;stroke-width:2.8}
.cx-card.is-on .cx-tick{opacity:1;transform:none}
.cx-body{display:flex;flex-direction:column;gap:3px;flex:1;padding:10px 12px 12px}
.cx-cat{font-size:12.5px;font-weight:700;color:var(--mute)}
.cx-name{font-size:16px;line-height:1.2}
.cx-desc{font-size:14px;line-height:1.4;color:var(--mute)}
.cx-card .add{margin-top:auto}
.cx-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:36px 16px;text-align:center;background:#fff;border:2px dashed var(--line);border-radius:var(--r)}
.cx-empty p{max-width:46ch;color:var(--mute)}
.cx-empty b{color:var(--g)}
.cx-empty .ctas{justify-content:center;margin-top:0}

/* ---------- tablets and phones: sidebar becomes a sheet ---------- */
@media(max-width:900px){
  .cx-layout{grid-template-columns:minmax(0,1fr)}
  .cx-fbtn{display:inline-flex}
  .cx-side{display:none}
  .cx-side.open{display:flex;flex-direction:column;position:fixed;left:0;right:0;bottom:0;top:auto;z-index:83;max-height:min(88vh,100%);padding:0;border:0;border-radius:20px 20px 0 0;box-shadow:0 -24px 60px -24px rgba(0,0,0,.55);animation:cxup .28s cubic-bezier(.2,.8,.2,1)}
  .cx-side.open .cx-shead{flex:none;padding:14px 18px 12px}
  .cx-side.open .cx-x{display:grid}
  .cx-side.open .cx-sbody{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 18px}
  .cx-side.open .cx-sfoot{display:flex;flex:none;gap:10px;padding:12px 18px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}
  .cx-sfoot .btn{flex:1;min-width:0}
  .cx-scrim{display:block;position:fixed;inset:0;z-index:82;background:rgba(14,22,24,.5)}
  .cx-scrim[hidden]{display:none}
}
@keyframes cxup{from{transform:translateY(40px);opacity:0}}
html.cx-lock{overflow:hidden}
@media(max-width:767px){
  .cx-search{flex-basis:100%;max-width:none}
  .cx-tools{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px}
  .cx-count{overflow:hidden;text-overflow:ellipsis;font-size:14.5px}
  .cx-fbtn{padding:0 12px}
  .cx-sort{padding-right:34px;background-position:right 10px center}
  .cx-selnote{display:none}
  .cx-types{flex-wrap:nowrap;overflow-x:auto;margin:0 calc(var(--gut) * -1) 10px;padding:2px var(--gut) 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .cx-types::-webkit-scrollbar{display:none}
  .cx-types button{min-height:40px;padding:0 14px;font-size:14px}
  .cx-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .cx-body{padding:8px 10px 10px}
  .cx-name{font-size:14.5px}
  .cx-desc{font-size:12.5px}
  .cx-cat{font-size:12px}
  .cx-tick{top:8px;right:8px;width:26px;height:26px}
  .cx-selbar{padding:6px 6px 6px 12px}
}
@media(max-width:400px){
  .cx-tools{grid-template-columns:1fr 1fr}
  .cx-count{grid-column:1/-1;order:3}
  .cx-fbtn{justify-content:center}
  .cx-sort{width:100%}
  .cx-search{padding-left:10px}
  .cx-search>.ic{display:none}
  .cx-search .btn{padding:0 14px}
  .cx-card .add{font-size:12.5px;gap:5px}
  .cx-card .add .ic{width:15px;height:15px}
  .cx-hero .ctas .btn{flex:1 1 auto}
}
/* very narrow phones: let the wordmark give way before the menu button is pushed off screen */
@media(max-width:400px){
  header.site .hrow .logo{flex:0 1 auto;min-width:0}
  header.site .hrow .wm{min-width:0}
  header.site .hrow .wm b{overflow:hidden;text-overflow:ellipsis}
  header.site .hacts{flex:none}
}
/* keep the sheet clear of the Wix free-plan banner (bottom of the screen on phones) while it shows */
@media(max-width:760px){
  body:has(#wixheadless-banner-container[style*="block"]) .cx-side.open{bottom:72px;max-height:calc(88vh - 72px);border-radius:20px}
}
