/**
 * NORDAN minimal product loop v1.2.
 * Shop, categories, WoodMart related-products carousel and upsells only.
 */
body:is(.tax-product_cat,.post-type-archive-product) :is(.wd-products-per-page,.wd-products-shop-view) {display:none;}
body:is(.tax-product_cat,.post-type-archive-product) .shop-loop-head {gap:var(--nd-space-3);}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product {--wd-prod-gap:10px;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product :is(
  .wd-product-card-hover,.wd-product-card-bg,.hover-content,
  .wd-bottom-actions,.wd-add-btn,
  .wrap-quickview-button,.wd-product-cats,.wd-product-brands-links,
  .wd-product-rating,.star-rating,.product-labels,
  .wrapp-swatches,.wd-product-stock,.wd-product-sku,
  .wd-product-img-hover,
  .wd-product-labels
) {display:none;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product :is(.wd-product-wrapper,.product-element-bottom) {box-shadow:none;transform:none;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product.wd-hover-with-fade:is(:hover,.state-hover) .wd-product-wrapper {transform:none;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product .product-element-bottom {padding:12px 8px 16px;text-align:center;gap:8px;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product :is(.wd-entities-title,.wd-entities-title a) {color:var(--nd-text);font-size:14px;line-height:1.65;font-weight:600;text-decoration:none;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product :is(.wd-entities-title a,.wd-product-img-link,.product-image-link):focus-visible {outline:2px solid var(--nd-focus);outline-offset:3px;border-radius:var(--nd-radius-sm);}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product :is(.price,.amount) {color:var(--nd-primary);font-weight:700;line-height:1.6;}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells) .wd-product .wd-product-img img {border-radius:var(--nd-radius-md);}


/* QA: native select popup is painted by the browser/OS.
   Explicit option colors, readable line-height; no heavy custom dropdown. */
body:is(.tax-product_cat,.post-type-archive-product) .woocommerce-ordering select option {
  background-color:var(--nd-surface);
  color:var(--nd-text);
  font-size:14px;
  line-height:1.8;
  padding:10px 14px;
}
html[data-theme="dark"] body:is(.tax-product_cat,.post-type-archive-product) .woocommerce-ordering select option {
  background-color:var(--nd-elevated);
  color:var(--nd-text);
}
body:is(.tax-product_cat,.post-type-archive-product) .woocommerce-ordering select {
  color-scheme:light;
}
html[data-theme="dark"] body:is(.tax-product_cat,.post-type-archive-product) .woocommerce-ordering select {
  color-scheme:dark;
}

/* QA v1.3: WoodMart standard cards do not contain .product-element-bottom.
   Put space on their actual wrapper; shared by archives and related carousel. */
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
.wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper {
  padding-block-end:clamp(24px,2.5vw,30px);
  gap:9px;
  min-width:0;
}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
.wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper > :is(.wd-entities-title,.price) {
  margin-block:0;
  padding-inline:10px;
  min-width:0;
}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
.wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper > .price {
  display:block;
  line-height:1.65;
  margin-block-start:2px;
  margin-block-end:0;
}
:is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
.wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper > .wd-entities-title {
  line-height:1.5;
  overflow-wrap:break-word;
}
@media(max-width:576px){
  :is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
  .wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper {
    padding-block-end:24px;
    gap:7px;
  }
  :is(body.tax-product_cat,body.post-type-archive-product,body.single-product .related-products,body.single-product .upsells)
  .wd-loop-builder-off .wd-product.wd-hover-standard > .wd-product-wrapper > :is(.wd-entities-title,.price) {
    padding-inline:8px;
  }
}


/* WoodMart related-carousel cards: actual DOM is .related-products
   .wd-carousel-item > .wd-product > .wd-product-wrapper. */
body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard > .wd-product-wrapper,
body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard > .product-wrapper {
  padding-bottom:26px!important;
  box-sizing:border-box;
}
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard .price {
  margin-bottom:0!important;
  padding-bottom:0!important;
}
@media(max-width:767px){
 body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard > .wd-product-wrapper,
 body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard > .product-wrapper {
   padding-bottom:26px!important;
 }
}


/* Extra real breathing room below the price in WoodMart's native related carousel. */
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard > .wd-product-wrapper {
  padding-bottom:36px!important;
}
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard > .wd-product-wrapper > .price {
  margin-bottom:0!important;
  padding-bottom:0!important;
}
/* Equal-height related product cards using native WoodMart markup. */
body.single-product .related-products .wd-carousel-item {
  display:flex;
  align-items:stretch;
  height:auto;
}
body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard {
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  min-width:0;
}
body.single-product .related-products .wd-carousel-item > .wd-product.wd-hover-standard > .wd-product-wrapper {
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:100%;
  width:100%;
  box-sizing:border-box;
  padding-bottom:36px!important;
}
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard .wd-product-thumb {
  flex-shrink:0;
}
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard .wd-entities-title {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  min-height:3.3em;
  max-height:3.3em;
  line-height:1.65;
  margin-bottom:8px;
}
body.single-product .related-products .wd-carousel-item .wd-product.wd-hover-standard .price {
  margin-top:auto!important;
  margin-bottom:0!important;
  padding-bottom:0!important;
  min-height:1.65em;
  text-align:center;
}
body:is(.tax-product_cat,.post-type-archive-product) .wd-product.wd-hover-standard > .wd-product-wrapper {
  display:flex;
  flex-direction:column;
}
body:is(.tax-product_cat,.post-type-archive-product) .wd-product.wd-hover-standard .wd-entities-title {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  min-height:3.3em;
  max-height:3.3em;
  line-height:1.65;
}

/* Mobile ordering: replace unreliable WoodMart font glyph with a tiny
   inline SVG mask. Native select remains on top for touch/keyboard use. */
@media(max-width:768.98px) {
  body:is(.tax-product_cat,.post-type-archive-product)
  .woocommerce-ordering.wd-ordering-mb-icon {
    background:transparent;
    border:0;
    color:var(--nd-text);
    width:36px;
    height:36px;
    min-width:36px;
  }
  body:is(.tax-product_cat,.post-type-archive-product)
  .woocommerce-ordering.wd-ordering-mb-icon::after {
    content:"";
    display:block;
    position:relative;
    width:22px;
    height:22px;
    min-width:22px;
    background-color:var(--nd-text);
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%206h10M4%2011h8M4%2016h6M18%205v14m-3-3%203%203%203-3%22%2F%3E%3C%2Fsvg%3E");
    mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%206h10M4%2011h8M4%2016h6M18%205v14m-3-3%203%203%203-3%22%2F%3E%3C%2Fsvg%3E");
    -webkit-mask-position:center;
    mask-position:center;
    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;
    -webkit-mask-size:contain;
    mask-size:contain;
    font-family:inherit;
    font-size:0;
    opacity:1;
    pointer-events:none;
  }
  body:is(.tax-product_cat,.post-type-archive-product)
  .woocommerce-ordering.wd-ordering-mb-icon select {
    width:100%;
    height:100%;
    min-height:36px;
    opacity:0;
    cursor:pointer;
    position:absolute;
    inset:0;
  }
  body:is(.tax-product_cat,.post-type-archive-product)
  .wd-show-sidebar-btn {
    background:transparent;
    color:var(--nd-text);
  }
  body:is(.tax-product_cat,.post-type-archive-product)
  .wd-show-sidebar-btn :is(.wd-action-icon,.wd-action-icon::before,.wd-action-text) {
    color:var(--nd-text);
  }
}



/* v1.2.22: NORDAN product-card policy. Keep WoodMart actions on the
   single-product purchase panel and on dedicated collection pages only.
   Don't show heart/compare overlays on category, shop, search or related cards.
   Avoid globally hiding `.wd-action-btn`: that also breaks product-page actions. */
:is(body.tax-product_cat,body.post-type-archive-product,body.search,
    body.single-product .related-products,body.single-product .upsells)
.wd-product :is(.wd-buttons,.wd-product-card-hover,.wd-bottom-actions,
               .wd-product-action,.wd-product-actions,.wd-wishlist-btn,.wd-compare-btn,
               .wd-add-btn,.wd-quick-view,.wrap-quickview-button) {
  display:none!important;
}
/* Real-product buttons outside the card remain interactive (no JS unbinding). */

/* Search results are a result grid, not the shop-facet experience. */
body.search :is(.ndps-filters,.ndps-filter-toggle,.ndps-drawer-trigger,.ndps-filter-backdrop) {display:none!important;}
body.search .wd-products {min-width:0;}
