/* Macrigi Core 2027 — WooCommerce category archive | v0.6.27 sparse leaf-product layout */
body.mc-category-2027-page .mc-main{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;overflow:visible!important}
.mc-category-landing{background:#fff;color:var(--mc-primary)}
.mc-category-shell{width:min(calc(100% - 48px),1510px);margin-inline:auto;padding:14px 0 36px}

/* Hero — data logic unchanged: Thumbnail 1 -> Woo thumbnail -> neutral fallback. */
.mc-category-hero{position:relative;min-height:326px;display:grid;grid-template-columns:minmax(0,1.02fr) minmax(500px,.98fr);overflow:hidden;border:1px solid #e1e9ed;border-radius:15px;background:linear-gradient(100deg,#fbfdfe 0%,#edf6fa 50%,#f7faf8 100%);box-shadow:0 10px 30px rgba(16,46,58,.055)}
.mc-category-hero__copy{position:relative;z-index:2;padding:34px 40px 32px;display:flex;flex-direction:column;justify-content:center;min-width:0;background:linear-gradient(90deg,rgba(251,253,254,.99) 0%,rgba(247,251,252,.97) 72%,rgba(247,251,252,.74) 91%,rgba(247,251,252,.18) 100%)}
.mc-category-hero__eyebrow{margin:0 0 11px;color:#668391;font-size:11px;font-weight:800;letter-spacing:.18em;text-transform:uppercase}
.mc-category-hero h1{margin:0;color:#102e3a;font-family:Georgia,"Times New Roman",serif;font-size:clamp(43px,3.45vw,61px);font-weight:500;line-height:.98;letter-spacing:-.025em}
.mc-category-hero__lead{max-width:660px;margin:15px 0 0;color:#435f6e;font-size:16px;line-height:1.45}
.mc-category-hero__benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:24px;max-width:690px}
.mc-category-benefit{min-width:0;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;padding:0 17px;border-right:1px solid #d7e3e8}.mc-category-benefit:first-child{padding-left:0}.mc-category-benefit:last-child{border-right:0;padding-right:0}
.mc-category-benefit>span{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:#e9f6fb;color:#0f526a}.mc-category-benefit svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.mc-category-benefit strong,.mc-category-benefit small{display:block}.mc-category-benefit strong{font-size:13px;line-height:1.15}.mc-category-benefit small{margin-top:2px;color:#647b87;font-size:10.5px;line-height:1.25}
.mc-category-hero__visual{min-height:326px;background-image:linear-gradient(90deg,rgba(245,250,251,.58) 0%,rgba(245,250,251,.15) 19%,rgba(245,250,251,0) 38%),var(--mc-cat-hero);background-size:cover;background-position:center;background-repeat:no-repeat}
.mc-category-hero.is-no-image .mc-category-hero__visual{background:linear-gradient(135deg,#e9f5f9,#dcecf1)}

/* Heading + toolbar */
.mc-category-heading{display:flex;align-items:end;justify-content:space-between;gap:28px;padding:23px 0 13px}.mc-category-heading__copy{min-width:0}.mc-category-heading h2{margin:0;color:#102e3a;font-family:Georgia,"Times New Roman",serif;font-size:39px;font-weight:500;line-height:1;letter-spacing:-.015em}.mc-category-heading p{margin:6px 0 0;color:#617886;font-size:13px}.mc-category-heading--products{padding-bottom:18px}
.mc-category-heading .mc-shop-toolbar{padding-bottom:1px}

/* Category cards — keep the real Woo thumbnail visible, with text legibility on the left. */
.mc-category-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.mc-category-cards[data-count="1"]{grid-template-columns:minmax(0,620px);max-width:620px}
.mc-category-cards[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr));max-width:960px}
.mc-category-cards[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));max-width:1180px}
.mc-category-card{position:relative;min-height:148px;overflow:hidden;border:1px solid #dfe7eb;border-radius:11px;background:#eef5f7;color:#fff;text-decoration:none;box-shadow:0 3px 13px rgba(16,46,58,.045);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.mc-category-card:hover{transform:translateY(-2px);border-color:#c6dce5;box-shadow:0 12px 27px rgba(16,46,58,.12)}
.mc-category-card__image{position:absolute;inset:0;background-size:cover;background-position:right center;background-repeat:no-repeat;transition:transform .22s ease}.mc-category-card:hover .mc-category-card__image{transform:scale(1.025)}.mc-category-card__image.is-placeholder{display:grid;place-items:center;background:linear-gradient(135deg,#eaf5f8,#dcecf1);color:#5faece}.mc-category-card__image.is-placeholder svg{width:46px;height:46px;fill:none;stroke:currentColor;stroke-width:1.5}
.mc-category-card__overlay{position:absolute;inset:0;background:linear-gradient(90deg,rgba(255,255,255,.98) 0%,rgba(255,255,255,.94) 27%,rgba(255,255,255,.78) 43%,rgba(255,255,255,.43) 57%,rgba(255,255,255,.10) 73%,rgba(255,255,255,0) 90%)}
.mc-category-card__content{position:relative;z-index:2;min-height:148px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:min(64%,290px);padding:18px 12px 18px 20px;color:#102e3a;text-shadow:none}
.mc-category-card__content strong{font-family:Georgia,"Times New Roman",serif;font-size:24px;font-weight:600;line-height:1.03;color:#102e3a;overflow-wrap:normal;word-break:normal;hyphens:none}
.mc-category-card--long-title .mc-category-card__content strong{font-size:21px;line-height:1.05;letter-spacing:-.01em}.mc-category-card__content small{display:block;max-width:230px;margin-top:5px;color:#516a77;font-size:11px;line-height:1.3}.mc-category-card__count{display:inline-flex;align-items:center;min-height:26px;margin-top:10px;padding:0 10px;border-radius:999px;background:#e9f6fb;color:#104155;font-size:11px;font-weight:800;text-shadow:none}
.mc-category-card__arrow{position:absolute;z-index:3;right:14px;bottom:14px;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.96);color:#102e3a;box-shadow:0 4px 10px rgba(16,46,58,.12);transition:transform .16s ease,background .16s ease}.mc-category-card:hover .mc-category-card__arrow{transform:translateX(2px);background:#fff}.mc-category-card__arrow svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transform:none}
.mc-category-cards[data-view="list"]{grid-template-columns:1fr 1fr;max-width:none}.mc-category-cards[data-view="list"] .mc-category-card{min-height:116px}.mc-category-cards[data-view="list"] .mc-category-card__content{min-height:116px}

/* Leaf category / products — WooCommerce remains owner of products; Core only controls presentation. */
.mc-category-products{padding-top:0}
.mc-category-heading--products{padding:20px 0 8px}
.mc-category-products__extras{margin:0 0 10px}
.mc-category-products__toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;min-height:42px;margin:0 0 12px}
.mc-category-products__result,.mc-category-products__ordering{min-width:0}
.mc-category-products__toolbar .woocommerce-result-count,.mc-category-products__toolbar .woocommerce-ordering{float:none!important;margin:0!important}
.mc-category-products__toolbar .woocommerce-result-count{color:#627985;font-size:12px;text-align:left}
.mc-category-products__toolbar .woocommerce-ordering{justify-self:end}
.mc-category-products__toolbar .woocommerce-ordering select{height:40px;border:1px solid #d6e0e5;border-radius:8px;padding:0 36px 0 12px;background:#fff;color:#415966}
.mc-category-products ul.products{clear:both;margin-top:0!important}

/* Sparse leaf categories: explicit count classes win over the global Woo 4-column grid. */
.woocommerce .mc-category-products--sparse ul.products{display:grid!important;gap:22px!important;width:100%;margin:0 auto!important;align-items:start;justify-content:center}
.woocommerce .mc-category-products--count-1 ul.products{grid-template-columns:minmax(0,430px)!important;max-width:430px}
.woocommerce .mc-category-products--count-2 ul.products{grid-template-columns:repeat(2,minmax(0,430px))!important;max-width:882px}
.woocommerce .mc-category-products--count-3 ul.products{grid-template-columns:repeat(3,minmax(0,350px))!important;max-width:1094px}
.woocommerce .mc-category-products--sparse ul.products li.product{min-width:0;width:auto!important;margin:0!important;padding:16px 16px 18px;border:1px solid #e3eaee;border-radius:12px;background:#fff;box-shadow:0 4px 14px rgba(16,46,58,.045)}
.woocommerce .mc-category-products--sparse ul.products li.product a img{display:block;width:100%;height:270px!important;max-height:270px!important;object-fit:contain;margin:0 0 14px!important}
.woocommerce .mc-category-products--count-1 ul.products li.product a img{height:285px!important;max-height:285px!important}
.woocommerce .mc-category-products--sparse ul.products li.product .woocommerce-loop-product__title{margin-top:0}
/* Trust strip: slightly more like the approved mockup, no behavioural change. */
.mc-category-landing .mc-shop-trust{margin-top:20px;padding:16px 24px;border-color:#dde8ed;border-radius:12px;background:linear-gradient(90deg,#f3faff 0%,#f7fbfd 48%,#f3faff 100%)}
.mc-category-landing .mc-shop-trust__item{grid-template-columns:44px minmax(0,1fr);gap:13px;padding-inline:26px}.mc-category-landing .mc-shop-trust__item:first-child{padding-left:0}.mc-category-landing .mc-shop-trust__item:last-child{padding-right:0}
.mc-category-landing .mc-shop-trust__item>span{width:42px;height:42px;border-radius:50%;background:#e6f5fb;color:#0f526a}.mc-category-landing .mc-shop-trust__item svg{width:25px;height:25px}.mc-category-landing .mc-shop-trust__item strong{font-family:Georgia,"Times New Roman",serif;font-size:14px;color:#102e3a}.mc-category-landing .mc-shop-trust__item small{margin-top:2px;font-size:10px}

@media(max-width:1180px){
 .mc-category-shell{width:min(calc(100% - 36px),1100px)}
 .mc-category-hero{grid-template-columns:1.08fr .92fr;min-height:290px}.mc-category-hero__visual{min-height:290px}.mc-category-hero__copy{padding:27px}.mc-category-hero h1{font-size:44px}.mc-category-hero__lead{font-size:15px}.mc-category-benefit{padding:0 12px}.mc-category-cards,.mc-category-cards[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));max-width:none}.mc-category-cards[data-count="2"]{max-width:880px}
}
@media(max-width:820px){
 .mc-category-shell{width:calc(100% - 28px);padding-top:12px}.mc-category-hero{grid-template-columns:1fr;min-height:0}.mc-category-hero__copy{padding:25px 22px 22px;background:#f8fbfc}.mc-category-hero__visual{min-height:235px;background-image:var(--mc-cat-hero-mobile,var(--mc-cat-hero));background-position:center}.mc-category-hero__benefits{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mc-category-benefit{padding:0;border:0}.mc-category-benefit:last-child{grid-column:1/-1}.mc-category-heading{align-items:flex-start;flex-direction:column}.mc-category-heading .mc-shop-toolbar{width:100%}.mc-category-cards,.mc-category-cards[data-count="2"],.mc-category-cards[data-count="3"]{grid-template-columns:repeat(2,minmax(0,1fr));max-width:none}.mc-category-cards[data-count="1"]{grid-template-columns:1fr;max-width:none}.mc-category-cards[data-view="list"]{grid-template-columns:1fr}.mc-category-heading h2{font-size:34px}.mc-category-card__content{width:min(67%,270px)}
 .mc-category-landing .mc-shop-trust{padding:14px 18px}.mc-category-landing .mc-shop-trust__item{padding-inline:18px}
}
@media(max-width:560px){
 .mc-category-shell{width:calc(100% - 20px);padding-bottom:24px}.mc-category-hero{border-radius:11px}.mc-category-hero__copy{padding:21px 17px 18px}.mc-category-hero h1{font-size:35px}.mc-category-hero__lead{font-size:14px}.mc-category-hero__benefits{grid-template-columns:1fr;margin-top:18px}.mc-category-benefit:last-child{grid-column:auto}.mc-category-hero__visual{min-height:190px}.mc-category-heading{padding-top:18px}.mc-category-heading h2{font-size:31px}.mc-category-cards,.mc-category-cards[data-count="2"],.mc-category-cards[data-count="3"]{grid-template-columns:1fr}.mc-category-card{min-height:137px}.mc-category-card__content{min-height:137px;width:70%;padding-left:17px}.mc-category-card__content strong{font-size:23px}.mc-category-card--long-title .mc-category-card__content strong{font-size:21px}.mc-category-card__overlay{background:linear-gradient(90deg,rgba(255,255,255,.98) 0%,rgba(255,255,255,.93) 38%,rgba(255,255,255,.58) 62%,rgba(255,255,255,.08) 88%)}.mc-category-cards[data-view="list"] .mc-category-card,.mc-category-cards[data-view="list"] .mc-category-card__content{min-height:110px}
 .mc-category-landing .mc-shop-trust{padding:12px 14px}.mc-category-landing .mc-shop-trust__item,.mc-category-landing .mc-shop-trust__item:first-child,.mc-category-landing .mc-shop-trust__item:last-child{padding:10px 0}
}

/* v0.6.27 — sparse leaf product layout. */
@media(max-width:900px){
 .mc-category-products__toolbar{grid-template-columns:1fr auto}
 .woocommerce .mc-category-products--count-1 ul.products{grid-template-columns:minmax(0,430px)!important;max-width:430px}
 .woocommerce .mc-category-products--count-2 ul.products,.woocommerce .mc-category-products--count-3 ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:882px}
}
@media(max-width:560px){
 .mc-category-products__toolbar{grid-template-columns:1fr;gap:10px;margin-bottom:12px}
 .mc-category-products__toolbar .woocommerce-ordering{justify-self:stretch;width:100%}
 .mc-category-products__toolbar .woocommerce-ordering select{width:100%}
 .woocommerce .mc-category-products--count-1 ul.products,.woocommerce .mc-category-products--count-2 ul.products,.woocommerce .mc-category-products--count-3 ul.products{grid-template-columns:1fr!important;max-width:none}
 .woocommerce .mc-category-products--sparse ul.products li.product{padding:13px}
 .woocommerce .mc-category-products--sparse ul.products li.product a img,.woocommerce .mc-category-products--count-1 ul.products li.product a img{height:250px!important;max-height:250px!important}
}

/* v0.6.38 — archive/card palette cleanup only.
   Remove legacy olive/red text inherited from older WooCommerce/wholesale
   styles while leaving the approved category geometry unchanged. */
body.tax-product_cat .mc-category-products ul.products li.product{color:#314d5a!important}
body.tax-product_cat .mc-category-products ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat .mc-category-products ul.products li.product h2,
body.tax-product_cat .mc-category-products ul.products li.product h3{color:#102e3a!important}
body.tax-product_cat .mc-category-products ul.products li.product :where(p,small,strong,span){color:#314d5a!important}
body.tax-product_cat .mc-category-products ul.products li.product :where(.price,.price *, .amount, .amount *, [class*="wholesale_price"], [class*="wholesale_price"] *){color:#0e879e!important}
body.tax-product_cat .mc-category-products ul.products li.product a:not(.button):not([class*="button"]){text-decoration-color:currentColor}

/* Product cards: one alignment and one button geometry for simple/variable products. */
body.tax-product_cat .mc-category-products ul.products{align-items:start}
body.tax-product_cat .mc-category-products ul.products li.product{display:flex;flex-direction:column;align-items:stretch;min-width:0;box-sizing:border-box}
body.tax-product_cat .mc-category-products ul.products li.product>.woocommerce-LoopProduct-link{text-align:center;min-width:0}
body.tax-product_cat .mc-category-products ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat .mc-category-products ul.products li.product .price{display:block;text-align:center;overflow-wrap:anywhere}
body.tax-product_cat .mc-category-products ul.products li.product .wcvendors_sold_by_in_loop{display:block;text-align:center;line-height:1.4;margin:8px 0}
body.tax-product_cat .mc-category-products ul.products li.product>br{display:none}
body.tax-product_cat .mc-category-products ul.products li.product>a.button{display:flex;align-items:center;justify-content:center;width:100%!important;min-height:46px;margin:10px 0 0!important;padding:9px 12px!important;border-radius:8px!important;background:#102e3a!important;color:#fff!important;font-size:14px!important;font-weight:700!important;line-height:1.25!important;text-align:center;white-space:normal;box-sizing:border-box}
body.tax-product_cat .mc-category-products ul.products li.product .macrigi-b2b-actions-loop{width:100%!important;max-width:100%;box-sizing:border-box;margin:8px 0 0!important;padding:0!important}
body.tax-product_cat .mc-category-products ul.products li.product .macrigi-b2b-action-row{width:100%!important;min-width:0}
body.tax-product_cat .mc-category-products ul.products li.product .macrigi-b2b-action-row>.macrigi-b2b-btn{width:100%!important;min-height:46px!important;padding:9px 12px!important;box-sizing:border-box;line-height:1.25!important;white-space:normal;overflow-wrap:anywhere}

/* v0.6.44 — keep WooCommerce sale badge safely inside category cards,
   especially on narrow iPhone viewports. */
body.tax-product_cat .mc-category-products ul.products li.product{position:relative}
body.tax-product_cat .mc-category-products ul.products li.product .onsale{
  position:absolute!important;
  top:10px!important;
  right:10px!important;
  left:auto!important;
  bottom:auto!important;
  margin:0!important;
  transform:none!important;
  z-index:3;
  max-width:calc(100% - 20px);
  min-width:0!important;
  min-height:0!important;
  box-sizing:border-box;
}
@media(max-width:560px){
  body.tax-product_cat .mc-category-products ul.products li.product .onsale{
    top:12px!important;
    right:12px!important;
  }
}
