/* Phase 31 — deterministic WooCommerce catalog and product route lock. */
:root{
  --sam-p31-gold:#ffb116;
  --sam-p31-lime:#aaff47;
  --sam-p31-ink:#080a0f;
  --sam-p31-panel:#11151e;
  --sam-p31-panel-2:#171c27;
  --sam-p31-paper:#f3f2ed;
  --sam-p31-text:#111318;
  --sam-p31-muted:#737984;
  --sam-p31-dark-muted:#aeb5c0;
  --sam-p31-line:rgba(255,255,255,.12);
}

/* --------------------------------------------------------------------------
   ROOT ROUTE RESET — uses WordPress/WooCommerce core body classes so it does
   not depend on a custom body-class filter or cache timing.
   -------------------------------------------------------------------------- */
body.woocommerce-shop .sam-commerce-main,
body.post-type-archive-product .sam-commerce-main,
body.tax-product_cat .sam-commerce-main,
body.tax-product_tag .sam-commerce-main{
  min-height:80vh;
  padding:0 0 88px!important;
  overflow:clip!important;
  background:var(--sam-p31-paper)!important;
}
body.woocommerce-shop .sam-commerce-shell,
body.post-type-archive-product .sam-commerce-shell,
body.tax-product_cat .sam-commerce-shell,
body.tax-product_tag .sam-commerce-shell{
  width:min(1320px,calc(100% - 40px))!important;
  max-width:1320px!important;
}

body.single-product .sam-commerce-main{
  min-height:100vh;
  padding:26px 0 0!important;
  overflow:clip!important;
  background:
    radial-gradient(circle at 8% 2%,rgba(255,177,22,.13),transparent 34rem),
    radial-gradient(circle at 96% 17%,rgba(76,104,255,.10),transparent 38rem),
    var(--sam-p31-ink)!important;
  color:#fff!important;
}
body.single-product .sam-commerce-shell{
  width:min(1320px,calc(100% - 40px))!important;
  max-width:1320px!important;
}
body.single-product .sam-p31-product{
  position:relative;
  isolation:isolate;
  width:100%!important;
  margin:0!important;
  color:#fff!important;
  background:transparent!important;
}

/* --------------------------------------------------------------------------
   SHOP — compact editorial hero + controlled catalog.
   -------------------------------------------------------------------------- */
body.woocommerce-shop .woocommerce-products-header,
body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header,
body.tax-product_tag .woocommerce-products-header,
body.woocommerce-shop .woocommerce-breadcrumb,
body.post-type-archive-product .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_tag .woocommerce-breadcrumb{display:none!important}

body .sam-p30-catalog-hero{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr);
  gap:clamp(28px,4vw,62px);
  align-items:end;
  width:100vw;
  margin-left:calc(50% - 50vw);
  padding:clamp(50px,6vw,82px) max(20px,calc((100vw - 1320px)/2)) 34px;
  border-bottom:1px solid rgba(255,255,255,.09);
  background:
    linear-gradient(115deg,rgba(4,5,9,.97),rgba(8,10,16,.91)),
    radial-gradient(circle at 9% 14%,rgba(255,177,22,.25),transparent 28rem),
    radial-gradient(circle at 92% 24%,rgba(72,104,255,.18),transparent 30rem),
    #080a0f;
}
body .sam-p30-catalog-hero__main{max-width:820px}
body .sam-p30-catalog-hero h1{
  max-width:12ch;
  font-size:clamp(3.7rem,6.7vw,7.1rem)!important;
  line-height:.86!important;
}
body .sam-p30-catalog-copy{max-width:690px;margin-top:20px;font-size:1rem;line-height:1.68}
body .sam-p30-product-search{margin-top:24px}
body .sam-p30-catalog-hero__proof{
  grid-template-columns:1fr;
  gap:10px;
  width:100%;
  margin:0;
}
body .sam-p30-catalog-hero__proof article{
  grid-template-columns:72px minmax(0,1fr);
  align-items:center;
  gap:14px;
  min-height:72px;
  padding:14px 16px;
  background:rgba(255,255,255,.045);
}
body .sam-p30-catalog-hero__proof strong{font-size:1.25rem}
body .sam-p30-category-rail{grid-column:1/-1;margin-top:2px;padding-top:22px}

.sam-p31-catalog-content{position:relative}
body .sam-p30-catalog-toolbar{padding:36px 0 20px}
body .sam-p30-catalog-toolbar__copy strong{font-size:1rem}

body.woocommerce-shop ul.products,
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:22px!important;
  margin:24px 0 0!important;
  padding:0!important;
}
body.woocommerce-shop ul.products li.product,
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  width:auto!important;
  height:100%!important;
  margin:0!important;
  padding:0 0 16px!important;
  float:none!important;
  border:1px solid #dcdeda!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:0 12px 38px rgba(19,23,31,.06)!important;
  overflow:hidden!important;
}
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__link,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__link,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__link,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__link{
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
}
body.woocommerce-shop ul.products li.product img,
body.post-type-archive-product ul.products li.product img,
body.tax-product_cat ul.products li.product img,
body.tax-product_tag ul.products li.product img{
  width:100%!important;
  aspect-ratio:16/10!important;
  margin:0 0 18px!important;
  border-radius:0!important;
  object-fit:cover!important;
}
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title{
  min-height:2.05em!important;
  padding:0 20px!important;
  color:var(--sam-p31-text)!important;
  font-size:clamp(1.55rem,1.8vw,1.95rem)!important;
  line-height:1.03!important;
}
body.woocommerce-shop .sam-p30-card-excerpt,
body.post-type-archive-product .sam-p30-card-excerpt,
body.tax-product_cat .sam-p30-card-excerpt,
body.tax-product_tag .sam-p30-card-excerpt{min-height:3.25em}
body.woocommerce-shop ul.products li.product>.button,
body.post-type-archive-product ul.products li.product>.button,
body.tax-product_cat ul.products li.product>.button,
body.tax-product_tag ul.products li.product>.button,
body.woocommerce-shop ul.products li.product .sam-start-brief,
body.post-type-archive-product ul.products li.product .sam-start-brief,
body.tax-product_cat ul.products li.product .sam-start-brief,
body.tax-product_tag ul.products li.product .sam-start-brief,
body.woocommerce-shop ul.products li.product .sam-request-quote,
body.post-type-archive-product ul.products li.product .sam-request-quote,
body.tax-product_cat ul.products li.product .sam-request-quote,
body.tax-product_tag ul.products li.product .sam-request-quote{margin-top:auto!important}

.sam-p31-no-products{padding:70px 0}
.sam-p31-no-products .woocommerce-info{margin:0!important}

/* --------------------------------------------------------------------------
   PRODUCT — one dark, readable stack. Legacy after-summary sections are hidden
   as an extra safety net for stale full-page caches.
   -------------------------------------------------------------------------- */
body.single-product .sam-p30-product-nav{top:92px;margin-bottom:10px}
body.single-product .sam-p30-product-hero{
  min-height:auto!important;
  padding:34px 0 64px!important;
}
body.single-product .sam-p30-product-intro .product_title{
  max-width:14ch;
  font-size:clamp(3.25rem,5vw,5.7rem)!important;
  line-height:.86!important;
}
body.single-product .sam-p30-product-intro .woocommerce-product-details__short-description{
  color:#c8cdd5!important;
}
body.single-product .sam-p30-hero-facts article,
body.single-product .sam-p30-signal-line span,
body.single-product .sam-p30-media-proof span{background:rgba(255,255,255,.04)!important}

body.single-product .sam-p30-configurator,
body.single-product .sam-p30-scope,
body.single-product .sam-p30-faq{
  position:relative;
  z-index:2;
  min-height:0!important;
  margin:0 0 56px!important;
  border:1px solid var(--sam-p31-line)!important;
  color:#fff!important;
  opacity:1!important;
}
body.single-product .sam-p30-configurator{
  background:linear-gradient(145deg,#151923,#0d1017)!important;
  border-color:rgba(255,177,22,.25)!important;
}
body.single-product .sam-p30-scope,
body.single-product .sam-p30-faq{
  background:linear-gradient(145deg,#121722,#0d1118)!important;
  box-shadow:0 26px 80px rgba(0,0,0,.24)!important;
}
body.single-product .sam-p30-section-head,
body.single-product .sam-p30-scope-grid,
body.single-product .sam-p30-faq-list{position:relative;z-index:2;opacity:1!important}
body.single-product .sam-p30-section-head h2,
body.single-product .sam-p30-scope-card h3,
body.single-product .sam-p30-faq summary{color:#fff!important;opacity:1!important}
body.single-product .sam-p30-section-head>p{color:#aeb5c0!important}
body.single-product .sam-p30-scope-card{
  background:#0a0e15!important;
  border-color:rgba(255,255,255,.11)!important;
  opacity:1!important;
}
body.single-product .sam-p30-scope-card ul li,
body.single-product .sam-p30-scope-card ol li{
  background:#121720!important;
  border-color:rgba(255,255,255,.09)!important;
  color:#c2c8d1!important;
}
body.single-product .sam-p30-scope-card ol p{color:#939ca8!important}
body.single-product .sam-p30-faq details{
  background:#0b0f16!important;
  border-color:rgba(255,255,255,.11)!important;
}
body.single-product .sam-p30-faq details p{color:#aeb5c0!important}

/* Compact, accessible project-brief accordion. */
body.single-product .sam-p31-configurator .sam-project-brief{
  width:100%!important;
  margin:0 0 18px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.single-product .sam-p31-configurator .sam-project-brief__header{padding:0 0 18px}
body.single-product .sam-p31-configurator .sam-project-brief__header h3{margin:4px 0 8px;color:#fff!important;font-size:clamp(1.7rem,2.5vw,2.45rem)!important}
body.single-product .sam-p31-configurator .sam-project-brief__header p{max-width:720px;margin:0;color:#aeb5c0;line-height:1.62}
.sam-p31-brief-progress{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 14px}
.sam-p31-brief-progress span{padding:7px 9px;border:1px solid var(--sam-p31-line);border-radius:999px;color:#878f9c;font-size:.65rem;font-weight:850}
.sam-p31-brief-progress span.is-active{border-color:rgba(255,177,22,.52);background:rgba(255,177,22,.11);color:#fff}
body.single-product .sam-p31-configurator .sam-project-brief__group{
  margin:0 0 10px!important;
  padding:0!important;
  border:1px solid var(--sam-p31-line)!important;
  border-radius:15px!important;
  background:rgba(255,255,255,.025)!important;
  overflow:hidden!important;
}
body.single-product .sam-p31-configurator .sam-project-brief__group legend{display:block;width:100%;max-width:none;margin:0;padding:0;color:#fff}
.sam-p31-brief-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;gap:20px;padding:16px 18px;border:0;background:transparent;color:#fff;text-align:left;font:850 .84rem/1.3 Inter,sans-serif;cursor:pointer}
.sam-p31-brief-toggle i{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:rgba(255,255,255,.08);color:var(--sam-p31-gold);font-style:normal}
body.single-product .sam-p31-configurator .sam-project-brief__grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:13px!important;padding:2px 18px 18px}
body.single-product .sam-p31-configurator .sam-project-brief__group.is-collapsed .sam-project-brief__grid{display:none!important}
body.single-product .sam-p31-configurator .sam-brief-field textarea{min-height:88px!important}
body.single-product .sam-p31-configurator .sam-project-brief__privacy{margin-top:11px}

/* Hard duplicate guard: older cached HTML may still contain these stacks. */
body.single-product .sam-p30-after-product,
body.single-product .sam-p20-after-product,
body.single-product .sam-p19-product-detail-grid,
body.single-product .sam-p24-delivery,
body.single-product .sam-p24-outcomes,
body.single-product .sam-p24-faq,
body.single-product .sam-trust-layer,
body.single-product .sam-p31-product>.woocommerce-tabs,
body.single-product .sam-p31-product>.upsells.products{display:none!important}

body.single-product .sam-p30-related{
  position:relative;
  z-index:3;
  margin-top:0!important;
}
body.single-product .sam-p30-final-cta{position:relative;z-index:3}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media(max-width:1120px){
  body .sam-p30-catalog-hero{grid-template-columns:minmax(0,1fr) 300px}
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:900px){
  body.woocommerce-shop .sam-commerce-shell,
  body.post-type-archive-product .sam-commerce-shell,
  body.tax-product_cat .sam-commerce-shell,
  body.tax-product_tag .sam-commerce-shell,
  body.single-product .sam-commerce-shell{width:calc(100% - 24px)!important}
  body .sam-p30-catalog-hero{grid-template-columns:1fr;padding-top:42px}
  body .sam-p30-catalog-hero__proof{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
  body .sam-p30-catalog-hero__proof::-webkit-scrollbar{display:none}
  body .sam-p30-catalog-hero__proof article{flex:0 0 min(76vw,310px);scroll-snap-align:start}
  body .sam-p30-category-rail{margin-top:6px}
  body.single-product .sam-commerce-main{padding-top:18px!important}
  body.single-product .sam-p30-product-nav{top:80px}
  body.single-product .sam-p30-product-hero{padding-top:20px!important}
}
@media(max-width:680px){
  body .sam-p30-catalog-hero h1{font-size:clamp(3.2rem,15vw,4.6rem)!important}
  body .sam-p30-catalog-copy{font-size:.93rem}
  body .sam-p30-catalog-toolbar{align-items:stretch;flex-direction:column;gap:14px;padding-top:28px}
  body .sam-p30-catalog-toolbar__controls{align-items:stretch;flex-direction:column;width:100%}
  body .sam-p30-catalog-toolbar__controls .woocommerce-ordering,
  body .sam-p30-catalog-toolbar__controls select{width:100%!important}
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products{grid-template-columns:1fr!important;gap:16px!important}
  body.single-product .sam-p30-product-intro .product_title{font-size:clamp(3rem,14vw,4.6rem)!important}
  body.single-product .sam-p30-configurator,
  body.single-product .sam-p30-scope,
  body.single-product .sam-p30-faq{padding:22px 14px!important;border-radius:21px!important}
  body.single-product .sam-p31-configurator .sam-project-brief__grid{grid-template-columns:1fr!important;padding:2px 13px 16px}
  .sam-p31-brief-toggle{padding:15px 13px}
}
@media(max-width:420px){
  body .sam-p30-catalog-hero{padding-inline:16px}
  body .sam-p30-catalog-hero__proof article{flex-basis:86vw}
}
