/* --- ID 370: woocommerce shop - clean responsive product grid --- */

body.post-type-archive-product.woocommerce-shop {
  --hr-shop-blue: #4c6fff;
  --hr-shop-text: #1d2850;
  --hr-shop-muted: rgba(31, 42, 68, 0.72);
  --hr-shop-border: rgba(148, 163, 184, 0.32);
  --hr-shop-card: #ffffff;
  --hr-shop-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

/* Keep layout wide enough to avoid compressed cards. */
body.post-type-archive-product.woocommerce-shop .site-content .container,
body.post-type-archive-product.woocommerce-shop main.col-sm-8.col-xs-12.col-sm-offset-2 {
  width: 100% !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  float: none !important;
}

body.post-type-archive-product.woocommerce-shop .site-content .container {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Disable legacy grouped sections rendering to keep a clean Woo grid. */
body.post-type-archive-product.woocommerce-shop .hr-proshop-sections {
  display: none !important;
}

/* Native Woo product list: responsive 1 / 2 / 3 / 4 columns. */
body.post-type-archive-product.woocommerce-shop ul.products {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid !important;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: 14px;
}

/* Woo clearfix pseudo-elements create an empty first grid cell if not disabled. */
body.post-type-archive-product.woocommerce-shop ul.products::before,
body.post-type-archive-product.woocommerce-shop ul.products::after {
  content: none !important;
  display: none !important;
}

@media (min-width: 640px) {
  body.post-type-archive-product.woocommerce-shop ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  body.post-type-archive-product.woocommerce-shop ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1360px) {
  body.post-type-archive-product.woocommerce-shop ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.post-type-archive-product.woocommerce-shop ul.products li.product {
  position: relative !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 14px !important;
  min-width: 0;

  border: 1px solid var(--hr-shop-border);
  border-radius: 14px;
  background: var(--hr-shop-card);
  box-shadow: var(--hr-shop-shadow);

  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* Category readability: color dot at card top-right. */
body.post-type-archive-product.woocommerce-shop ul.products li.product::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--hr-shop-cat-color, #94a3b8);
  box-shadow: 0 0 0 2px #ffffff;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product.product_cat-cuisine {
  --hr-shop-cat-color: #4c6fff;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product.product_cat-sdb {
  --hr-shop-cat-color: #00bfa6;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product.product_cat-chambre {
  --hr-shop-cat-color: #ff8a3d;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product.product_cat-wc {
  --hr-shop-cat-color: #a971ff;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product.product_cat-global {
  --hr-shop-cat-color: #ff5f7a;
}

/* Keep compact layout: no image block in grid cards. */
body.post-type-archive-product.woocommerce-shop ul.products li.product img,
body.post-type-archive-product.woocommerce-shop ul.products li.product .woocommerce-placeholder {
  display: none !important;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product a.woocommerce-LoopProduct-link {
  display: block !important;
  width: 100%;
  text-decoration: none;
}

/* Full title (no truncation). */
body.post-type-archive-product.woocommerce-shop ul.products li.product .woocommerce-loop-product__title {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--hr-shop-text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 750;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product .price {
  display: block;
  margin: 4px 0 0 !important;
  color: var(--hr-shop-muted);
  font-size: 13px;
}

/* Add-to-cart button under text, compact footprint. */
body.post-type-archive-product.woocommerce-shop ul.products li.product a.button.add_to_cart_button {
  position: static !important;
  float: none !important;
  margin-top: 2px;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: flex-start;

  max-width: 100%;
  padding: 8px 12px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--hr-shop-blue) !important;
  background: var(--hr-shop-blue) !important;
  color: #fff !important;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}

body.post-type-archive-product.woocommerce-shop ul.products li.product a.added_to_cart {
  margin-top: 2px;
}

body.post-type-archive-product.woocommerce-shop nav.woocommerce-pagination {
  margin-top: 20px;
}

body.post-type-archive-product.woocommerce-shop nav.woocommerce-pagination ul li a:hover,
body.post-type-archive-product.woocommerce-shop nav.woocommerce-pagination ul li a:focus {
  color: var(--hr-shop-blue) !important;
  border-color: rgba(76, 111, 255, 0.35) !important;
  background: rgba(76, 111, 255, 0.08) !important;
}
