/**
 * Viandes des Prés — grille de catégories WooCommerce
 * Ciblage body.woocommerce-shop pour battre le CSS Additionnel du Personnalisateur
 * (flex 4 colonnes + images 220px !important) sans modifier les grilles produit.
 */

body.woocommerce-shop ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(1rem, 2.2vw, 2rem) !important;
  width: 100% !important;
  max-width: var(--vdp-container, 1240px);
  margin-inline: auto !important;
  padding: 0 !important;
  list-style: none;
  float: none !important;
}

body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after {
  display: none !important;
  content: none !important;
}

body.woocommerce-shop ul.products li.product-category.product,
body.woocommerce-shop ul.products li.product-category {
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  height: auto;
  text-align: left;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid var(--vdp-border, #eae6e0);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(17, 17, 17, 0.045);
  text-decoration: none !important;
  color: inherit;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link:focus-visible {
  outline: 2px solid var(--vdp-primary, #7c1010);
  outline-offset: 3px;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__media {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f3efe8;
  flex: 0 0 auto;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__img,
body.woocommerce-shop ul.products li.product-category .vdp-cat-card__media img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  margin: 0 !important;
  border-radius: 0 !important;
  transition: transform 300ms ease;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: #fff;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__title {
  display: block;
  margin: 0 !important;
  padding: 0;
  font-family: var(--vdp-font, "Plus Jakarta Sans", system-ui, sans-serif) !important;
  font-size: clamp(1.25rem, 1.55vw, 1.7rem) !important;
  font-weight: 600 !important;
  line-height: 1.28 !important;
  letter-spacing: -0.015em;
  text-transform: none !important;
  text-align: left !important;
  color: var(--vdp-ink, #111111) !important;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__count {
  display: block;
  margin: 0;
  padding: 0;
  background: none !important;
  font-family: var(--vdp-font, "Plus Jakarta Sans", system-ui, sans-serif) !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  line-height: 1.4;
  text-align: left !important;
  color: var(--vdp-muted, #6e6e6e) !important;
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.7rem;
  font-family: var(--vdp-font, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--vdp-primary, #7c1010);
}

body.woocommerce-shop ul.products li.product-category .vdp-cat-card__arrow {
  display: inline-block;
  transition: transform 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08);
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link:hover .vdp-cat-card__img,
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link:hover .vdp-cat-card__media img {
    transform: scale(1.03);
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link:hover .vdp-cat-card__arrow {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__link,
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__img,
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__media img,
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__arrow {
    transition: none !important;
    transform: none !important;
  }
}

@media (max-width: 1024px) {
  body.woocommerce-shop ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.15rem !important;
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__title {
    font-size: clamp(1.2rem, 2.4vw, 1.45rem) !important;
  }
}

@media (max-width: 767px) {
  body.woocommerce-shop ul.products {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.1rem !important;
  }

  body.woocommerce-shop ul.products li.product-category,
  body.woocommerce-shop ul.products li.product-category.product {
    width: 100% !important;
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__body {
    padding: 1rem 1.05rem 1.15rem;
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__title {
    font-size: clamp(1.25rem, 5.2vw, 1.5rem) !important;
  }

  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__count {
    font-size: 0.84rem !important;
  }
}

@media (max-width: 360px) {
  body.woocommerce-shop ul.products li.product-category .vdp-cat-card__body {
    padding: 0.95rem 1rem 1.05rem;
  }
}
