
/* Core wrapper */
#wd-woo-filter-wrapper {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  padding: 1rem;
  color: #000;
  background-color: #fff;
  font-family: 'Segoe UI', sans-serif;
}

/* Sidebar filters */
#wd-woo-filter-form {
  grid-column: 1 / 2;
  max-width: 300px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.wd-filter-group {
  margin-bottom: 1.5rem;
  color: #000;
}

.wd-filter-group h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.25rem;
  text-transform: uppercase;
  font-weight: bold;
}

.wd-filter-group label {
  display: block;
  margin-bottom: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}

input[type="checkbox"],
input[type="number"],
select {
  margin-right: 0.4rem;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  padding: 4px 6px;
  border-radius: 5px;
}

input[type="number"] {
  width: 100px;
}

/* Submit Button */
.wd-filter-button {
  background: #ffffff;
  color: #000;
  border: none;
  padding: 0.6rem 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.wd-filter-button:hover {
  background: #f2f2f2;
}

/* Products container */
#wd-product-results {
  grid-column: 2 / 3;
  min-width: 300px;
}

/* Prevent unwanted bullets or padding */
#wd-product-results ul.products {
  list-style-type: none !important;
  padding-left: 0 !important;
}

/* Remove unnecessary global width override */
#wd-product-results li.product {
  list-style: none !important;
}

/* Price styling */
.price {
  color: #01961A !important;
  font-size: 20px;
}

ul.products li.product .price,
ul.products li.product .woocommerce-Price-amount {
  color: #01961A !important;
  font-size: 20px !important;
}

/* Loading text */
.wd-loading {
  text-align: center;
  font-size: 1.1rem;
  padding: 2rem;
  color: #666;
}

/* Load More Button */
#wd-load-more-container {
  text-align: center;
  margin-top: 2rem;
}

#wd-load-more {
  padding: 10px 10%;
  font-size: 1rem;
  font-weight: bold;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}

#wd-load-more:hover {
  background: #333;
}

/* ========== MAIN FIX ========== */
/* 1) Force a true 3-col grid that stretches and packs items */
ul.products.columns-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* fill all space evenly */
  grid-auto-flow: row dense;                        /* pack any holes */
  gap: 1rem;
  list-style: none !important;
  padding: 0;
  margin: 0;
  justify-items: stretch;
  align-items: stretch;
}

/* 2) Nuke Woo/Theme width/float/max-width constraints on the LI */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products.columns-3 > li.product {
  width: auto !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  box-sizing: border-box;
  display: grid;                /* keep your inner grid approach */
  grid-template-rows: auto 1fr auto; /* optional */
  min-width: 0;                 /* prevent overflow caused by long titles */
}

/* 3) Make inner wrapper fill the whole cell */
ul.products.columns-3 li.product .woocommerce-LoopProduct-link {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.5rem;
  height: 100%;
}

/* 4) Ensure images aren’t capped by theme CSS */
ul.products.columns-3 li.product img {
  width: 100% !important;
  height: auto;
  max-width: none !important;
  object-fit: cover;            /* optional: keep consistent crop */
}

/* 5) Keep consistent title/price height if you want */
ul.products.columns-3 li.product .woocommerce-loop-product__title,
ul.products.columns-3 li.product .price {
  min-height: 2rem;
}

/* 6) Button sticks to the bottom and fills width */
ul.products.columns-3 li.product .button {
  align-self: end;
  justify-self: stretch;
  width: 100%;
}

ul.products.columns-3::before,
ul.products.columns-3::after {
  content: none !important;
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  width: 0 !important;
}

#wd-product-results ul.products li.product .price,
#wd-product-results ul.products li.product .woocommerce-Price-amount {
  color: #01961A !important;
  font-size: 20px !important;
}
#wd-product-results ul.products li.product span.price span.woocommerce-Price-amount {
  color: #01961A !important;
  font-size: 20px !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  ul.products.columns-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  ul.products.columns-3 {
    grid-template-columns: 1fr;
  }
}