/* SHB Colors & Discount Badges v1.1 — WoodMart + WooCommerce
   Unified real pa_color swatches on archive cards and single product gallery.
   Scoped to image cards and galleries; no image crop/size changes. */

/* CARD swatches (bottom-inline-start = bottom right in RTL). */
:is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item).shb-has-colors .product-element-top,
body.single-product .shb-cc-single-gallery {position:relative!important}

:is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item) .product-element-top > .shb-cc-row,
body.single-product .shb-cc-single-gallery > .shb-cc-single-row {
  position:absolute!important;
  z-index:26!important;
  bottom:7px!important;
  inset-inline-start:7px!important;
  top:auto!important;
  width:max-content;
  max-width:calc(100% - 14px);
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center;
  justify-content:flex-start;
  gap:4px;
  padding:3px 5px!important;
  margin:0!important;
  border:1px solid rgba(0,0,0,.09)!important;
  border-radius:99px!important;
  background:rgba(255,255,255,.91)!important;
  box-shadow:0 2px 7px rgba(0,0,0,.10)!important;
  overflow-x:auto;
  scrollbar-width:none;
  direction:rtl;
}
.shb-cc-row::-webkit-scrollbar{display:none}
.shb-cc-row .shb-cc-dot {
  box-sizing:border-box!important;
  display:block!important;
  flex:0 0 13px!important;
  width:13px!important;
  height:13px!important;
  min-height:13px!important;
  padding:0!important;
  margin:0!important;
  border:1px solid rgba(0,0,0,.22)!important;
  border-radius:50%!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.9)!important;
}
body.single-product .shb-cc-single-gallery > .shb-cc-single-row .shb-cc-dot {
  flex-basis:15px!important;width:15px!important;height:15px!important;min-height:15px!important;
}

/* Hide ONLY color/attribute text badges, not sale/new/stock labels.
   Native WooCommerce attribute table below the gallery stays untouched. */
:is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item).shb-has-colors
:is(.product-label.attribute-label,.product-label[class*="label-attribute-"],.shb-color-badge,.shb-color-pill,.shb-color-tag,.product-color-badge){display:none!important}
body.single-product :is(.woocommerce-product-gallery,.wd-product-gallery,.product-images,.wd-gallery-images)
:is(.product-label.attribute-label,.product-label[class*="label-attribute-"],.shb-color-badge,.shb-color-pill,.shb-color-tag,.product-color-badge){display:none!important}

/* Darker antique-gold contrast, smaller circle and BOLDER, LARGER discount. */
:is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item)
:is(.product-label.onsale,.product-label.sale,.onsale,.shb-sale-badge),
body.single-product :is(.woocommerce-product-gallery,.wd-product-gallery,.product-images,.wd-gallery-images,.product-labels)
:is(.product-label.onsale,.onsale,.shb-sale-badge){
  box-sizing:border-box!important;
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
  max-width:36px!important;
  max-height:36px!important;
  padding:2px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid rgba(255,255,255,.8)!important;
  border-radius:50%!important;
  background:#876322!important;
  color:#fff!important;
  font-size:15px!important;
  font-weight:800!important;
  line-height:1!important;
  letter-spacing:-.35px!important;
  text-align:center!important;
  white-space:nowrap!important;
  text-shadow:0 1px 1px rgba(0,0,0,.23)!important;
  box-shadow:0 2px 9px rgba(0,0,0,.18)!important;
}

/* Single product: sale at the image's top corner (WoodMart uses top-left). */
body.single-product :is(.woocommerce-product-gallery,.wd-product-gallery,.product-images) > .product-labels{
  top:10px!important;
  left:10px!important;
  right:auto!important;
  z-index:30!important;
}

@media(max-width:767px){
  :is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item) .product-element-top > .shb-cc-row,
  body.single-product .shb-cc-single-gallery > .shb-cc-single-row{
    bottom:5px!important;inset-inline-start:5px!important;
    padding:3px 4px!important;gap:3px;max-width:calc(100% - 10px);
  }
  .shb-cc-row .shb-cc-dot{flex-basis:12px!important;width:12px!important;height:12px!important;min-height:12px!important}
  body.single-product .shb-cc-single-gallery > .shb-cc-single-row .shb-cc-dot{
    flex-basis:13px!important;width:13px!important;height:13px!important;min-height:13px!important;
  }
  :is(.wd-products,.products) :is(.wd-product,li.product,.product-grid-item)
  :is(.product-label.onsale,.product-label.sale,.onsale,.shb-sale-badge),
  body.single-product :is(.woocommerce-product-gallery,.wd-product-gallery,.product-images,.wd-gallery-images,.product-labels)
  :is(.product-label.onsale,.onsale,.shb-sale-badge){
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
    max-width:34px!important;max-height:34px!important;font-size:14px!important;
  }
}
