/* Custom Shop Builder - Strictly scoped to body.csb-shop-enabled (Catalog only) */
body.csb-shop-enabled .site-content > .ast-container {
  max-width: var(--csb-content-width, 1400px) !important;
  width: 100%;
}

body.csb-shop-enabled .csb-archive-layout {
  display: grid !important;
  grid-template-columns: minmax(190px, var(--csb-sidebar-width, 260px)) minmax(0, 1fr);
  column-gap: var(--csb-layout-gap, 28px);
  row-gap: 18px;
  align-items: start;
  width: 100%;
  max-width: var(--csb-content-width, 1400px);
  margin-left: auto !important;
  margin-right: auto !important;
  clear: both;
  color: var(--csb-text, #333);
  font-size: var(--csb-body-size, 14px);
}

body.csb-shop-enabled .csb-archive-layout > .csb-filter-sidebar {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  align-self: start;
}

body.csb-shop-enabled .csb-archive-layout > .csb-archive-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  width: 100%;
}

body.csb-shop-enabled .csb-archive-main ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--csb-columns, 4), minmax(0, 1fr));
  gap: 24px 18px;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.csb-shop-enabled .csb-archive-main ul.products::before,
body.csb-shop-enabled .csb-archive-main ul.products::after {
  display: none !important;
  content: none !important;
}

body.csb-shop-enabled .csb-archive-main ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  position: relative;
  color: var(--csb-text, #333);
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Astra Product Summary: strictly vertical column stack */
body.csb-shop-enabled .csb-archive-main ul.products li.product .astra-shop-summary-wrap {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  flex-grow: 1 !important;
  margin-top: 10px !important;
}

body.csb-shop-enabled .csb-archive-main ul.products li.product .astra-shop-summary-wrap .ast-woo-product-category,
body.csb-shop-enabled .csb-archive-main ul.products li.product .astra-shop-summary-wrap .woocommerce-loop-product__title,
body.csb-shop-enabled .csb-archive-main ul.products li.product .astra-shop-summary-wrap .price {
  display: block !important;
  width: 100% !important;
}

/* Sidebar filter styles */
.csb-filter-sidebar {
  box-sizing: border-box;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--csb-border, #e5e5e5);
  border-radius: var(--csb-radius, 6px);
  background: var(--csb-sidebar-bg, #fff);
  color: var(--csb-text, #333);
  font-size: var(--csb-body-size, 14px);
  margin: 0;
}

.csb-filter-sidebar h3,
.csb-filter-heading strong {
  color: var(--csb-heading, #222);
}

.csb-filter-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.csb-filter-heading a {
  color: var(--csb-accent, #2271b1);
  font-size: 12px;
  text-decoration: underline;
}

.csb-filter-group {
  border-top: 1px solid var(--csb-border, #eee);
  padding: 14px 0;
}

.csb-filter-group h3 {
  font-size: var(--csb-heading-size, 16px);
  margin: 0 0 10px;
}

.csb-filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.csb-filter-options label,
.csb-filter-group > label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--csb-body-size, 14px);
  margin: 0;
}

.csb-filter-options input,
.csb-filter-group input {
  flex: 0 0 auto;
  accent-color: var(--csb-accent, #2271b1);
}

.csb-price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.csb-price-fields label {
  font-size: 11px;
}

.csb-price-fields input {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.csb-filter-sidebar input[type="number"] {
  border: 1px solid var(--csb-border, #ddd);
  border-radius: var(--csb-radius, 6px);
  color: var(--csb-text, #333);
}

/* ========================================================
   EXTRA ICONS & COMPARE REMOVAL (Scoped to Catalog only)
   ======================================================== */
body.csb-shop-enabled .woosc-btn,
body.csb-shop-enabled .wooscp-btn,
body.csb-shop-enabled [class*="woosc"],
body.csb-shop-enabled [id*="woosc"],
body.csb-shop-enabled .compare,
body.csb-shop-enabled .compare-button,
body.csb-shop-enabled .product-compare,
body.csb-shop-enabled [class*="compare"],
body.csb-shop-enabled [id*="compare"],
body.csb-shop-enabled a[href*="compare"],
body.csb-shop-enabled a[href*="action=yith-woocompare"],
body.csb-shop-enabled a[data-action*="compare"],
body.csb-shop-enabled a[data-tooltip*="compar" i],
body.csb-shop-enabled a[title*="compar" i],
body.csb-shop-enabled button[title*="compar" i],
body.csb-shop-enabled a[aria-label*="compar" i],
body.csb-shop-enabled button[aria-label*="compar" i],
body.csb-shop-enabled .wcboost-products-compare-button,
body.csb-shop-enabled .yith-woocompare-button,
body.csb-shop-enabled .woosw-btn,
body.csb-shop-enabled .woosq-btn,
body.csb-shop-enabled .woosc-item,
body.csb-shop-enabled .woosw-item,
body.csb-shop-enabled .woosq-item,
body.csb-shop-enabled div[class*="woosw"],
body.csb-shop-enabled div[class*="woosq"],
body.csb-shop-enabled span[class*="woosw"],
body.csb-shop-enabled span[class*="woosq"],
body.csb-shop-enabled .ast-quick-view-button,
body.csb-shop-enabled .ast-loop-product-action,
body.csb-shop-enabled .yith-wcwl-add-to-wishlist,
body.csb-shop-enabled .yith-wcwl-add-button,
body.csb-shop-enabled .yith-wcqv-button,
body.csb-shop-enabled .tinv-wraper,
body.csb-shop-enabled .tinvwl_add_to_wishlist_button,
body.csb-shop-enabled li.product [class*="quick-view"],
body.csb-shop-enabled li.product [class*="quickview"],
body.csb-shop-enabled li.product [class*="wishlist"],
body.csb-shop-enabled .ast-shop-product-btn-wrap > *:not(.add_to_cart_button):not(.product_type_simple):not(.product_type_variable):not(.product_type_grouped):not(.product_type_external):not(.added_to_cart):not(.csb-delivery-badge) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
}

/* ========================================================
   CONTAINER & BUTTON ALIGNMENT (LEFT / CENTER / RIGHT / FULL)
   ======================================================== */
body.csb-shop-enabled .ast-shop-product-btn-wrap,
body.csb-shop-enabled li.product .woocommerce-loop-product__buttons {
  display: flex !important;
  flex-direction: row !important;
  justify-content: var(--csb-btn-justify, center) !important;
  align-items: center !important;
  width: 100% !important;
  margin-top: auto !important;
  padding: 0 !important;
  gap: 0 !important;
}

.csb-filter-submit,
body.csb-shop-enabled ul.products li.product a.button,
body.csb-shop-enabled ul.products li.product button.button,
body.csb-shop-enabled ul.products li.product .added_to_cart,
body.csb-shop-enabled li.product a.button.add_to_cart_button,
body.csb-shop-enabled li.product a.button.product_type_simple,
body.csb-shop-enabled li.product a.button.product_type_variable {
  background: var(--csb-button-bg, #222) !important;
  color: var(--csb-button-text, #fff) !important;
  border: 1px solid var(--csb-button-bg, #222) !important;
  border-radius: var(--csb-radius, 6px) !important;
  font-size: var(--csb-button-size, 13px) !important;
  font-weight: var(--csb-button-weight, 600) !important;
  text-transform: var(--csb-button-transform, none) !important;
  padding: var(--csb-button-pad-y, 10px) var(--csb-button-pad-x, 14px) !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  text-align: center !important;
  transition: all .2s ease !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  white-space: nowrap !important;
  width: var(--csb-btn-width, auto) !important;
  align-self: var(--csb-btn-align-self, center) !important;
  margin-left: var(--csb-btn-ml, auto) !important;
  margin-right: var(--csb-btn-mr, auto) !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

.csb-filter-submit {
  width: 100% !important;
  margin-top: 10px !important;
  cursor: pointer;
}

.csb-filter-submit:hover,
body.csb-shop-enabled ul.products li.product a.button:hover,
body.csb-shop-enabled ul.products li.product button.button:hover,
body.csb-shop-enabled ul.products li.product .added_to_cart:hover {
  background: var(--csb-button-hover-bg, #444) !important;
  border-color: var(--csb-button-hover-bg, #444) !important;
  color: var(--csb-button-hover-text, #fff) !important;
}

/* ========================================================
   DELIVERY TIME INDICATORS
   ======================================================== */
.csb-delivery-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  padding: 4px 8px !important;
  border-radius: var(--csb-radius, 6px) !important;
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
}

.csb-delivery-badge.csb-delivery-pos-above_button {
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  margin: 6px 0 8px 0 !important;
}

.csb-delivery-badge.csb-delivery-pos-below_price {
  margin: 6px 0 8px 0 !important;
  align-self: flex-start !important;
}

.csb-delivery-icon,
.csb-delivery-text {
  color: inherit !important;
}

/* Product Labels */
body.csb-shop-enabled .csb-archive-main .woocommerce-loop-product__title {
  color: var(--csb-heading, #222);
  font-size: var(--csb-heading-size, 16px);
}

body.csb-shop-enabled .csb-archive-main .price,
body.csb-shop-enabled .csb-archive-main .price ins {
  color: var(--csb-text, #333);
}

body.csb-shop-enabled .csb-archive-main a:not(.button) {
  color: var(--csb-accent, #2271b1);
}

.csb-product-labels {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  pointer-events: none;
}

.csb-label {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--csb-radius, 6px);
  color: #fff;
  background: #333;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
}

.csb-label-sale { background: #c62828; }
.csb-label-new { background: #237a45; }
.csb-label-oos { background: #555; }
.csb-label-featured { background: #315b9a; }
.csb-label-delivery { background: #0d47a1; color: #fff; }

@media(max-width: 768px) {
  body.csb-shop-enabled .csb-archive-layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }
  body.csb-shop-enabled .csb-archive-layout > .csb-filter-sidebar,
  body.csb-shop-enabled .csb-archive-layout > .csb-archive-main {
    grid-column: 1;
    grid-row: auto;
  }
  body.csb-shop-enabled .csb-archive-main ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}