/**
 * Viandes des Prés — ProductCard + CategoryCard
 *
 * Pas de page-id, pas d’IDs Elementor, pas de #place_order / #vdp_delivery_date.
 */

/* -------------------------------------------------------------------------
   Grille produits (archives, recherche, related, cross-sells)
   ------------------------------------------------------------------------- */

.woocommerce ul.products,
.woocommerce-page ul.products,
.woocommerce ul.products.oceanwp-row,
.woocommerce-page ul.products.oceanwp-row,
.related.products ul.products,
.upsells.products ul.products,
.cross-sells ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--vdp-space-3, 16px) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 var(--vdp-space-5, 32px) !important;
  padding: 0 !important;
  list-style: none;
  float: none !important;
  box-sizing: border-box;
}

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

@media (min-width: 768px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .related.products ul.products,
  .upsells.products ul.products,
  .cross-sells ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: var(--vdp-space-4, 24px) !important;
  }
}

@media (min-width: 1280px) {
  .woocommerce ul.products:not(:has(.product-category)),
  .woocommerce-page ul.products:not(:has(.product-category)),
  .related.products ul.products,
  .upsells.products ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce ul.products.oceanwp-row .product,
.woocommerce ul.products.oceanwp-row.tablet-2-col .product,
.woocommerce ul.products.oceanwp-row.tablet-3-col .product,
.woocommerce ul.products.oceanwp-row.mobile-1-col .product,
.woocommerce ul.products.oceanwp-row.mobile-2-col .product,
.woocommerce ul.products.oceanwp-row.mobile-3-col .product,
.woocommerce .products.tablet-2-col .product,
.woocommerce .products.tablet-3-col .product,
.woocommerce .products.mobile-1-col .product,
.woocommerce .products.mobile-2-col .product,
.woocommerce .products.mobile-3-col .product {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none !important;
  display: flex !important;
  height: auto;
  text-align: left;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.woocommerce ul.products li.product .product-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Miniature OceanWP orpheline (si le hook n’a pas été retiré) */
.woocommerce ul.products li.product .product-inner > .woo-entry-image,
.woocommerce ul.products li.product .product-inner > .woocommerce-LoopProduct-link {
  display: none !important;
}

/* -------------------------------------------------------------------------
   ProductCard
   ------------------------------------------------------------------------- */

.vdp-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  background: var(--vdp-white, #fff);
  border: 1px solid var(--vdp-border, #e5e2de);
  border-radius: var(--vdp-radius-lg, 16px);
  overflow: hidden;
  box-shadow: none;
  box-sizing: border-box;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.vdp-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--vdp-shadow-soft, 0 8px 30px rgba(0, 0, 0, 0.06));
}

.vdp-product-card__badges {
  position: absolute;
  top: var(--vdp-space-2, 12px);
  left: var(--vdp-space-2, 12px);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vdp-product-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--vdp-radius-sm, 6px);
  background: var(--vdp-white, #fff);
  color: var(--vdp-red, #a30e16);
  font-family: var(--vdp-font, Inter, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.vdp-product-card__badge.is-oos {
  background: var(--vdp-black, #111);
  color: var(--vdp-white, #fff);
}

.vdp-product-card__badge.is-aop {
  background: var(--vdp-background-soft, #f2f0ec);
  color: var(--vdp-black, #111);
}

.vdp-product-card__media {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--vdp-background-soft, #f2f0ec);
  flex: 0 0 auto;
}

.vdp-product-card__img,
.vdp-product-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;
}

.vdp-product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  padding: var(--vdp-space-3, 16px);
  min-height: 0;
}

.vdp-product-card__title {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--vdp-font-display, "Cormorant Garamond", Georgia, serif) !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: 0;
  text-transform: none !important;
  color: var(--vdp-black, #111) !important;
}

.vdp-product-card__title a {
  color: inherit !important;
  text-decoration: none !important;
}

.vdp-product-card__title a:hover,
.vdp-product-card__title a:focus-visible {
  color: var(--vdp-red, #a30e16) !important;
}

.vdp-product-card__price,
.woocommerce ul.products li.product .vdp-product-card__price,
.woocommerce ul.products li.product .vdp-product-card__price .price,
.woocommerce ul.products li.product .vdp-product-card .price {
  margin: 0 !important;
  font-family: var(--vdp-font, Inter, system-ui, sans-serif) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: var(--vdp-black, #111) !important;
}

.vdp-product-card__price del,
.vdp-product-card .price del {
  color: var(--vdp-text-secondary, #666) !important;
  font-weight: 400 !important;
  font-size: 0.85em;
}

.vdp-product-card__price ins,
.vdp-product-card .price ins {
  text-decoration: none;
  color: var(--vdp-red, #a30e16) !important;
}

.vdp-product-card__actions {
  margin-top: auto;
  padding-top: var(--vdp-space-2, 12px);
}

.vdp-product-card__actions .button,
.vdp-product-card__actions a.button,
.vdp-product-card__btn,
.woocommerce ul.products li.product .vdp-product-card .button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: var(--vdp-radius, 8px) !important;
  background: var(--vdp-red, #a30e16) !important;
  color: var(--vdp-white, #fff) !important;
  font-family: var(--vdp-font, Inter, system-ui, sans-serif) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  text-transform: none !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
}

.vdp-product-card__actions .button:hover,
.vdp-product-card__actions a.button:hover,
.vdp-product-card__btn:hover {
  background: var(--vdp-red-hover, #8b1212) !important;
  color: var(--vdp-white, #fff) !important;
}

.vdp-product-card .added_to_cart {
  display: none !important;
}

/* Vue liste OceanWP */
.woocommerce ul.products.list li.product .vdp-product-card {
  flex-direction: row;
  align-items: stretch;
}

.woocommerce ul.products.list li.product .vdp-product-card__media {
  flex: 0 0 160px;
  width: 160px;
  max-width: 40%;
  aspect-ratio: 1 / 1;
}

.woocommerce ul.products.list li.product .vdp-product-card__actions .button {
  width: auto;
  min-width: 140px;
}

/* Accueil — 2 mobile / 4 dès tablette */
.vdp-hb-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--vdp-space-3, 16px) !important;
  width: 100% !important;
  max-width: 100% !important;
}

.vdp-hb-grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (min-width: 768px) {
  .vdp-hb-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: var(--vdp-space-4, 24px) !important;
  }
}

@media (max-width: 359px) {
  .vdp-hb-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* -------------------------------------------------------------------------
   CategoryCard — boutique + archives qui listent des catégories
   ------------------------------------------------------------------------- */

.woocommerce ul.products:has(.product-category) {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (min-width: 600px) {
  .woocommerce ul.products:has(.product-category) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .woocommerce ul.products:has(.product-category) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

.woocommerce ul.products li.product-category,
.woocommerce ul.products li.product-category.product {
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.vdp-cat-card__link {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--vdp-white, #fff);
  border: 1px solid var(--vdp-border, #e5e2de);
  border-radius: var(--vdp-radius-lg, 16px);
  overflow: hidden;
  box-shadow: none;
  text-decoration: none !important;
  color: inherit;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.vdp-cat-card__link:focus-visible {
  outline: 2px solid var(--vdp-red, #a30e16);
  outline-offset: 3px;
}

.vdp-cat-card__media {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--vdp-background-soft, #f2f0ec);
  flex: 0 0 auto;
}

.vdp-cat-card__img,
.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;
}

.vdp-cat-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  padding: var(--vdp-space-3, 16px) var(--vdp-space-3, 16px) var(--vdp-space-4, 24px);
  background: var(--vdp-white, #fff);
}

.vdp-cat-card__title {
  display: block;
  margin: 0 !important;
  padding: 0;
  font-family: var(--vdp-font-display, "Cormorant Garamond", Georgia, serif) !important;
  font-size: clamp(1.25rem, 1.6vw, 1.6rem) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: 0;
  text-transform: none !important;
  text-align: left !important;
  color: var(--vdp-black, #111) !important;
}

.vdp-cat-card__count {
  display: block;
  margin: 0;
  padding: 0;
  background: none !important;
  font-family: var(--vdp-font, Inter, system-ui, sans-serif) !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  line-height: 1.4;
  text-align: left !important;
  color: var(--vdp-text-secondary, #666) !important;
}

.vdp-cat-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--vdp-space-2, 12px);
  min-height: 44px;
  font-family: var(--vdp-font, Inter, system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vdp-red, #a30e16);
}

.vdp-cat-card__arrow {
  display: inline-block;
  transition: transform 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .vdp-cat-card__link:hover {
    transform: translateY(-2px);
    box-shadow: var(--vdp-shadow-soft, 0 8px 30px rgba(0, 0, 0, 0.06));
  }

  .vdp-cat-card__link:hover .vdp-cat-card__arrow {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vdp-product-card,
  .vdp-cat-card__link,
  .vdp-cat-card__arrow {
    transition: none !important;
    transform: none !important;
  }
}

/* Mobile : OceanWP force 50%/33% + marges négatives — on rétablit la grille */
@media (max-width: 767px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .woocommerce ul.products.oceanwp-row,
  .woocommerce-page ul.products.oceanwp-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .woocommerce .products.oceanwp-row.tablet-col .product,
  .woocommerce .products.oceanwp-row.mobile-col .product,
  .woocommerce ul.products.oceanwp-row.tablet-3-col .product,
  .woocommerce ul.products.oceanwp-row.mobile-2-col .product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .vdp-product-card {
    min-width: 0;
    border-radius: var(--vdp-radius-md, 10px);
  }

  .vdp-product-card:hover {
    transform: none;
    box-shadow: none;
  }

  .vdp-product-card__body {
    padding: 10px;
    gap: 4px;
  }

  .vdp-product-card__title {
    min-height: 0;
    font-family: var(--vdp-font, Inter, system-ui, sans-serif) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }

  .vdp-product-card__price,
  .woocommerce ul.products li.product .vdp-product-card__price,
  .woocommerce ul.products li.product .vdp-product-card .price {
    font-size: 0.875rem !important;
  }

  .vdp-product-card__actions {
    padding-top: 8px;
  }

  .vdp-product-card__actions .button,
  .vdp-product-card__btn,
  .woocommerce ul.products li.product .vdp-product-card .button {
    min-height: 40px !important;
    font-size: 0.75rem !important;
    padding: 0 8px !important;
  }

  .vdp-hb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .vdp-hb-grid > .vdp-product-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .vdp-cat-card__body {
    padding: 12px;
  }

  .vdp-cat-card__title {
    font-size: 1.15rem !important;
  }
}

@media (max-width: 379px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .woocommerce ul.products.oceanwp-row,
  .vdp-hb-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
