/* Hide the theme/WooCommerce archive title + taxonomy description only on supplier
   archives that are replaced by the Stitchworx supplier hero. Site navigation/header
   remains untouched. */
body.swx-supplier-ui-active .hero-section,
body.swx-supplier-ui-active .woocommerce-products-header {display:none!important}

.swx-supplier-archive,.swx-supplier-archive *{box-sizing:border-box}
.swx-supplier-archive{--swx-teal:#11cbc6;--swx-teal-dark:#008e91;--swx-deep:#00383e;--swx-ink:#122126;--swx-muted:#5e6d72;--swx-line:#dce7e8;margin:0 0 34px;font-family:Arial,Helvetica,sans-serif;color:var(--swx-ink)}
.swx-supplier-hero{display:grid;grid-template-columns:minmax(0,1fr) 230px;align-items:center;gap:28px;padding:34px;border-radius:14px;background:linear-gradient(120deg,#002f35,#06444a 65%,#008e91);color:#fff;box-shadow:0 12px 30px rgba(0,45,50,.15)}
.swx-supplier-hero-copy{text-align:center}
.swx-supplier-kicker,.swx-resource-kicker{margin:0 0 8px;color:var(--swx-teal);font-size:12px;line-height:1.2;font-weight:900;letter-spacing:.12em;text-transform:uppercase}
.swx-supplier-hero h1{margin:0;color:#fff;font-size:clamp(38px,5vw,58px);line-height:1;font-weight:900;letter-spacing:-.04em}
.swx-supplier-hero p{max-width:700px;margin:14px auto 0;color:rgba(255,255,255,.9);font-size:16px;line-height:1.65;font-weight:700}
.swx-supplier-hero-actions{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:14px;margin-top:23px}
.swx-product-count{font-size:13px;font-weight:800;color:rgba(255,255,255,.78)}
.swx-supplier-hero-mark{min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;border-radius:10px;background:#fff;color:#111;text-align:center}
.swx-supplier-hero-mark.has-logo{padding:22px 24px}
.swx-supplier-hero-logo{display:block;width:100%;max-width:185px;max-height:110px;object-fit:contain;object-position:center;margin:auto}
.swx-supplier-hero-mark span,.swx-resource-cover-mark span{display:block;font-size:52px;line-height:.88;font-weight:900;letter-spacing:-.06em}
.swx-supplier-hero-mark strong,.swx-resource-cover-mark strong{display:block;margin-top:7px;font-size:16px;line-height:1.1;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
/* Shared global WooCommerce category navigation.
   These links filter the current supplier archive; they do not create supplier-specific
   duplicate categories. */
.swx-global-categories{margin-top:20px;padding:22px 22px 20px;border:1px solid var(--swx-line);border-radius:14px;background:#fff;box-shadow:0 7px 20px rgba(0,40,44,.05)}
.swx-global-categories-heading{text-align:center;margin-bottom:16px}
.swx-global-categories-heading h2{margin:0;color:var(--swx-ink);font-size:clamp(22px,2.4vw,30px);line-height:1.15;font-weight:900;letter-spacing:-.02em}
.swx-global-category-scroll{display:flex;flex-wrap:wrap;justify-content:center;gap:9px}
.swx-global-category{min-height:42px;display:inline-flex;align-items:center;justify-content:center;padding:9px 15px;border:1px solid #bcd0d2;border-radius:999px;background:#fff;color:#274047!important;text-decoration:none!important;font-size:12px;font-weight:900;line-height:1.15;white-space:nowrap;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}
.swx-global-category:hover{transform:translateY(-1px);border-color:var(--swx-teal-dark);background:#edfafa;color:var(--swx-deep)!important}
.swx-global-category.is-active{border-color:var(--swx-deep);background:var(--swx-deep);color:#fff!important;box-shadow:0 5px 13px rgba(0,56,62,.16)}
/* TRENDS supplier-authoritative category navigation. The taxonomy is dedicated to
   TRENDS and does not replace or rewrite Stitchworx global WooCommerce categories. */
.swx-trends-categories{margin-top:20px;padding:25px 24px 24px;border:1px solid var(--swx-line);border-radius:14px;background:#fff;box-shadow:0 7px 20px rgba(0,40,44,.05)}
.swx-trends-category-heading{text-align:center;margin-bottom:20px}
.swx-trends-category-heading h2{margin:0;color:var(--swx-ink);font-size:clamp(24px,2.7vw,32px);line-height:1.15;font-weight:900;letter-spacing:-.02em}
.swx-trends-category-heading p{max-width:720px;margin:10px auto 14px;color:var(--swx-muted);font-size:14px;line-height:1.6;font-weight:700}
.swx-trends-all{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 15px;border:1px solid #bcd0d2;border-radius:999px;background:#fff;color:#274047!important;text-decoration:none!important;font-size:12px;font-weight:900}
.swx-trends-all:hover,.swx-trends-all.is-active{border-color:var(--swx-deep);background:var(--swx-deep);color:#fff!important}
.swx-trends-parent-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.swx-trends-parent-card{min-height:78px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:13px 10px;border:2px solid #d9e8e8;border-radius:10px;background:#f9fcfc;color:var(--swx-deep)!important;text-align:center;text-decoration:none!important;transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease}
.swx-trends-parent-card:hover{transform:translateY(-2px);border-color:var(--swx-teal-dark);background:#effbfb;box-shadow:0 7px 17px rgba(0,56,62,.08)}
.swx-trends-parent-card.is-active{border-color:var(--swx-deep);background:var(--swx-deep);color:#fff!important;box-shadow:0 8px 20px rgba(0,56,62,.17)}
.swx-trends-parent-name{font-size:14px;line-height:1.2;font-weight:900}
.swx-trends-parent-count{font-size:11px;line-height:1.2;font-weight:800;opacity:.72}
.swx-trends-parent-card.is-active .swx-trends-parent-count{color:#c8f5f3;opacity:1}
.swx-trends-subcategories{margin-top:20px;padding-top:18px;border-top:1px solid #e1ebeb}
.swx-trends-subheading{text-align:center;margin-bottom:11px;color:var(--swx-ink);font-size:14px;font-weight:900}
.swx-trends-sub-scroll{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.swx-trends-sub{min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 13px;border:1px solid #bfd3d4;border-radius:999px;background:#fff;color:#274047!important;text-decoration:none!important;font-size:12px;line-height:1.15;font-weight:900;white-space:nowrap}
.swx-trends-sub span{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#edf5f5;color:#446166;font-size:10px;font-weight:900}
.swx-trends-sub:hover{border-color:var(--swx-teal-dark);background:#effbfb;color:var(--swx-deep)!important}
.swx-trends-sub.is-active{border-color:var(--swx-deep);background:var(--swx-deep);color:#fff!important}
.swx-trends-sub.is-active span{background:rgba(255,255,255,.16);color:#fff}
.swx-resource-panel{display:grid;grid-template-columns:260px minmax(0,1fr);gap:30px;align-items:center;margin-top:20px;padding:28px;border:1px solid var(--swx-line);border-radius:14px;background:#fff;box-shadow:0 8px 24px rgba(0,40,44,.06)}
.swx-resource-copy{text-align:center}
.swx-resource-visual{min-width:0;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}
.swx-resource-cover{width:100%;max-width:250px;min-height:315px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;margin:0 auto;padding:34px 24px 24px;border-radius:9px;background:linear-gradient(145deg,#f4f7f7,#fff);background-size:cover;background-position:center center;border:1px solid #e1e8e8;color:#111;box-shadow:0 8px 22px rgba(0,0,0,.08)}
.swx-resource-cover.has-image{background-color:#fff;background-size:contain;background-repeat:no-repeat;background-position:center center}
.swx-resource-cover-mark{text-align:center;margin:auto 0}
.swx-resource-cover-label{width:100%;padding-top:17px;border-top:1px solid #dce4e5;text-align:center;font-size:12px;font-weight:900;letter-spacing:.10em;color:#526369}
.swx-resource-copy h2,.swx-shop-tools h2{margin:0;color:var(--swx-ink);font-size:clamp(26px,3vw,38px);line-height:1.1;font-weight:900;letter-spacing:-.025em}
.swx-resource-meta{margin-top:10px;color:var(--swx-teal-dark);font-size:13px;font-weight:900}
.swx-resource-copy p,.swx-shop-tools-heading p{max-width:720px;margin:15px auto 22px;color:var(--swx-muted);font-size:14px;line-height:1.7;font-weight:700}
.swx-ui-btn{min-height:48px;display:inline-flex;align-items:center;justify-content:center;padding:12px 20px;border:0;border-radius:6px;text-decoration:none!important;cursor:pointer;font:900 13px/1.2 Arial,Helvetica,sans-serif;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}
.swx-ui-btn:hover{transform:translateY(-2px)}
.swx-ui-btn-primary{color:#fff!important;background:linear-gradient(135deg,#009ca0,#11cbc6);box-shadow:0 8px 22px rgba(0,157,160,.22)}
.swx-ui-link{display:inline-flex;margin-top:5px;color:var(--swx-teal-dark)!important;text-decoration:none!important;font-size:13px;font-weight:900}
.swx-ui-link:hover{text-decoration:underline!important}
.swx-resource-help{margin-top:10px;color:var(--swx-muted);font-size:12px;line-height:1.45;font-weight:700}
.swx-engine-fallback{margin-top:12px;padding:10px 12px;border-left:4px solid #d63638;background:#fff6f6;color:#5a2020;font-size:12px;font-weight:700;text-align:left}

/* DearFlip Lite supported thumbnail/lightbox trigger.
   We intentionally do not recreate, intercept, or replace DearFlip's PDF engine. */
.swx-dearflip-launch{display:flex;justify-content:center;align-items:flex-start;min-height:230px;width:100%}
.swx-dearflip-launch ._df_thumb,.swx-dearflip-launch .df-popup-thumb{width:190px;max-width:100%;margin:0!important;vertical-align:top}
.swx-dearflip-launch .df-popup-thumb .df-book-title{font-family:Arial,Helvetica,sans-serif;font-weight:900;letter-spacing:.03em}
.swx-dearflip-launch .df-popup-thumb .df-book-cover{border-radius:4px}
.swx-dearflip-launch .df-popup-thumb.df-thumb-not-found .df-book-cover{background:linear-gradient(145deg,#f4f7f7,#fff)}
.swx-dearflip-launch .df-popup-thumb.df-thumb-not-found .df-book-title{color:#122126;background:#fff}

.swx-shop-tools{margin-top:20px;padding:27px;border:1px solid var(--swx-line);border-radius:14px;background:#f8fbfb}
.swx-shop-tools-heading{text-align:center}
.swx-search-panel{margin-top:18px;padding:18px 20px 20px;border:2px solid var(--swx-deep);border-radius:10px;background:#fff;transition:border-color .2s ease,box-shadow .2s ease}
.swx-search-panel:focus-within{border-color:var(--swx-deep);box-shadow:0 0 0 3px rgba(0,56,62,.10)}
.swx-search-help{max-width:760px;margin:0 auto 16px!important;color:var(--swx-muted)!important;text-align:center;font-size:14px!important;line-height:1.6!important;font-weight:700!important}
.swx-supplier-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin-top:0}
.swx-supplier-search input{min-height:50px;width:100%;padding:0 16px;border:1px solid #cbdada!important;border-radius:6px;background:#fff!important;color:var(--swx-ink);font-size:15px;outline:none;box-shadow:none!important;transition:border-color .2s ease,box-shadow .2s ease}.swx-supplier-search input:focus{border-color:var(--swx-teal-dark)!important;box-shadow:0 0 0 3px rgba(0,142,145,.12)!important}
.swx-supplier-search button{min-width:120px;border:0;border-radius:6px;background:var(--swx-deep);color:#fff;font-weight:900;cursor:pointer}
.swx-supplier-search button:hover{background:#00555d}


/* ============================================================
   GLOBAL PRODUCT GRID — ONE CONSISTENT CARD SYSTEM
   Applies to supplier archives handled by this plugin AND standard
   WooCommerce product-search results so search cards match the exact
   same Stitchworx teal supplier-card template.
   Product images are contained rather than cropped.
   ============================================================ */
body.swx-product-card-ui-active .woocommerce ul.products,
body.swx-product-card-ui-active ul.products {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:20px!important;
  align-items:stretch!important;
}

body.swx-product-card-ui-active .woocommerce ul.products::before,
body.swx-product-card-ui-active .woocommerce ul.products::after,
body.swx-product-card-ui-active ul.products::before,
body.swx-product-card-ui-active ul.products::after {
  display:none!important;
  content:none!important;
}

body.swx-product-card-ui-active .woocommerce ul.products li.product,
body.swx-product-card-ui-active ul.products li.product {
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  float:none!important;
  display:flex!important;
  flex-direction:column!important;
  position:relative!important;
  overflow:hidden!important;
  border:1px solid #dce7e8!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:0 5px 16px rgba(0,40,44,.06)!important;
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease!important;
}

body.swx-product-card-ui-active .woocommerce ul.products li.product:hover,
body.swx-product-card-ui-active ul.products li.product:hover {
  transform:translateY(-3px)!important;
  border-color:#c6d9da!important;
  box-shadow:0 10px 24px rgba(0,40,44,.12)!important;
}

/* Make the linked product content fill the card so prices/actions line up. */
body.swx-product-card-ui-active ul.products li.product > a.woocommerce-LoopProduct-link,
body.swx-product-card-ui-active ul.products li.product > a.woocommerce-loop-product__link {
  flex:1 1 auto!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  padding:14px 14px 0!important;
  text-decoration:none!important;
}

/* Blocksy commonly wraps catalogue images in .ct-media-container. */
body.swx-product-card-ui-active ul.products li.product .ct-media-container {
  width:100%!important;
  aspect-ratio:1 / 1!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:#fff!important;
}

body.swx-product-card-ui-active ul.products li.product .ct-media-container img,
body.swx-product-card-ui-active ul.products li.product > a img,
body.swx-product-card-ui-active ul.products li.product img.attachment-woocommerce_thumbnail {
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:1 / 1!important;
  object-fit:contain!important;
  object-position:center!important;
  margin:0 auto!important;
}

body.swx-product-card-ui-active ul.products li.product .woocommerce-loop-product__title {
  margin:14px 0 10px!important;
  color:#122126!important;
  font-size:15px!important;
  line-height:1.4!important;
  font-weight:800!important;
  text-align:center!important;
}

/* Keep the Blocksy Type-2 price + action footer vertically centred.
   This prevents the price from sitting against the bottom edge of the card. */
body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions {
  width:100%!important;
  min-height:72px!important;
  margin-top:auto!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:minmax(150px,1fr) minmax(145px,1fr)!important;
  align-items:stretch!important;
  border-top:1px solid #e5eeee!important;
  background:#fff!important;
}

body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .price,
body.swx-product-card-ui-active ul.products li.product .price {
  margin:0!important;
  min-width:0!important;
  min-height:72px!important;
  padding:12px 12px!important;
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  align-self:stretch!important;
  white-space:nowrap!important;
  overflow:visible!important;
  color:#064b4d!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:800!important;
  font-variant-numeric:tabular-nums;
  text-align:left!important;
}

/* Keep WooCommerce variable-product ranges on one baseline. Some Blocksy/WooCommerce
   rules can turn individual amount spans into blocks, which makes ranges stack. */
body.swx-product-card-ui-active ul.products li.product .price > span,
body.swx-product-card-ui-active ul.products li.product .price .woocommerce-Price-amount,
body.swx-product-card-ui-active ul.products li.product .price .woocommerce-Price-amount bdi,
body.swx-product-card-ui-active ul.products li.product .price .woocommerce-Price-currencySymbol {
  display:inline!important;
  white-space:nowrap!important;
  margin:0!important;
  padding:0!important;
}

/* Cloke is the master supplier product-card colour treatment.
   Lock the same dark teal action styling across every handled supplier archive. */
body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .button,
body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions a.button,
body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .added_to_cart,
body.swx-product-card-ui-active ul.products li.product .button,
body.swx-product-card-ui-active ul.products li.product a.button,
body.swx-product-card-ui-active ul.products li.product .added_to_cart {
  width:100%!important;
  min-width:0!important;
  min-height:72px!important;
  height:100%!important;
  margin:0!important;
  padding:10px 12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-left:1px solid #e5eeee!important;
  border-radius:0 0 9px 0!important;
  background:#0d686a!important;
  color:#fff!important;
  box-shadow:none!important;
  text-align:center!important;
  font-size:13px!important;
  line-height:1.25!important;
  font-weight:900!important;
}

body.swx-product-card-ui-active ul.products li.product .button:hover,
body.swx-product-card-ui-active ul.products li.product a.button:hover,
body.swx-product-card-ui-active ul.products li.product .added_to_cart:hover,
body.swx-product-card-ui-active ul.products li.product .button:focus,
body.swx-product-card-ui-active ul.products li.product a.button:focus {
  border-color:#064b4d!important;
  background:#064b4d!important;
  color:#fff!important;
}

/* Keep product flags readable and tidy. */
body.swx-product-card-ui-active ul.products li.product .onsale {
  z-index:3!important;
}

@media(max-width:1100px){
  body.swx-product-card-ui-active .woocommerce ul.products,
  body.swx-product-card-ui-active ul.products {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:16px!important;
  }
}

@media(max-width:767px){
  body.swx-product-card-ui-active .woocommerce ul.products,
  body.swx-product-card-ui-active ul.products {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body.swx-product-card-ui-active ul.products li.product > a.woocommerce-LoopProduct-link,
  body.swx-product-card-ui-active ul.products li.product > a.woocommerce-loop-product__link {
    padding:10px 10px 0!important;
  }
  body.swx-product-card-ui-active ul.products li.product .woocommerce-loop-product__title {
    margin-top:10px!important;
    font-size:13px!important;
    line-height:1.35!important;
  }
  body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions {
    min-height:62px!important;
    grid-template-columns:minmax(0,.85fr) minmax(108px,1.15fr)!important;
  }
  body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .price,
  body.swx-product-card-ui-active ul.products li.product .price {
    min-height:62px!important;
    padding:9px 6px!important;
    font-size:11px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
  }
  body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .button,
  body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions a.button,
  body.swx-product-card-ui-active ul.products li.product .ct-woo-card-actions .added_to_cart,
  body.swx-product-card-ui-active ul.products li.product .button,
  body.swx-product-card-ui-active ul.products li.product a.button,
  body.swx-product-card-ui-active ul.products li.product .added_to_cart {
    min-height:62px!important;
    margin:0!important;
    padding:9px 8px!important;
    font-size:12px!important;
  }
}

@media(max-width:1100px){
  .swx-trends-parent-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:767px){
  .swx-trends-categories{padding:20px 14px 18px;border-radius:10px}
  .swx-trends-category-heading{margin-bottom:15px}
  .swx-trends-parent-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .swx-trends-parent-card{min-height:70px;padding:11px 8px}
  .swx-trends-parent-name{font-size:13px}
  .swx-trends-subcategories{margin-top:17px;padding-top:15px;overflow:hidden}
  .swx-trends-sub-scroll{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding:2px 1px 7px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .swx-trends-sub-scroll::-webkit-scrollbar{display:none}
  .swx-trends-sub{flex:0 0 auto;scroll-snap-align:start}
}
@media(max-width:900px){
  .swx-supplier-hero{grid-template-columns:1fr}.swx-supplier-hero-mark{display:none}
  .swx-resource-panel{grid-template-columns:200px minmax(0,1fr)}
  .swx-dearflip-launch ._df_thumb,.swx-dearflip-launch .df-popup-thumb{width:170px}
}
@media(max-width:767px){
  .swx-global-categories{padding:18px 0 16px;overflow:hidden}
  .swx-global-categories-heading{padding:0 16px;margin-bottom:14px}
  .swx-global-category-scroll{justify-content:flex-start;flex-wrap:nowrap;gap:8px;overflow-x:auto;padding:2px 16px 7px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .swx-global-category-scroll::-webkit-scrollbar{display:none}
  .swx-global-category{flex:0 0 auto;scroll-snap-align:start;min-height:40px;padding:9px 14px}
  .swx-supplier-archive{margin-bottom:24px}
  .swx-supplier-hero{padding:25px 20px;border-radius:10px}
  .swx-supplier-hero h1{font-size:38px}
  .swx-resource-panel{grid-template-columns:1fr;padding:18px;border-radius:10px}
  .swx-resource-cover{width:min(240px,80%);min-height:300px;margin:0 auto}
  .swx-dearflip-launch{min-height:0}
  .swx-dearflip-launch ._df_thumb,.swx-dearflip-launch .df-popup-thumb{width:min(210px,75%)}
  .swx-shop-tools{padding:20px 16px;border-radius:10px}
  .swx-search-panel{padding:16px 14px 16px;border-radius:9px}
  .swx-search-help{font-size:13px!important;margin-bottom:14px!important}
  .swx-supplier-search{grid-template-columns:1fr}.swx-supplier-search button{min-height:48px}
}
