/* Sprint 41 — Enterprise Product Card alignment system.
   Loaded after Sprint 40. It standardises image scale, text rows, commerce rows,
   controls and hover motion without changing routes, markup or business logic. */

article.pcv2-card {
  --pcv2-card-height: 604px;
  --pcv2-media-height: 246px;
  --pcv2-body-pad: 12px;
  border-color: #dbe5ef !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .10) !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}

article.pcv2-card:hover {
  transform: translateY(-3px) !important;
  border-color: #bed2e6 !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .15) !important;
}

/* Normalised visual stage: products retain their aspect ratio and no longer
   visually compete because of inconsistent source-image whitespace. */
article.pcv2-card > .pcv2-media {
  padding: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

article.pcv2-card .pcv2-image-link {
  padding: 4px !important;
}

article.pcv2-card .pcv2-main-img,
article.pcv2-card .pcv2-hover-img {
  width: 88% !important;
  height: 88% !important;
  max-width: 88% !important;
  max-height: 88% !important;
  margin: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: scale(1) !important;
  transition: opacity .2s ease, transform .2s ease !important;
}

article.pcv2-card .pcv2-hover-img {
  inset: 6% !important;
  width: 88% !important;
  height: 88% !important;
}

article.pcv2-card:hover .pcv2-main-img,
article.pcv2-card:hover .pcv2-hover-img {
  transform: scale(1.025) !important;
}

/* One action-control language across wishlist and quick preview. */
article.pcv2-card .pcv2-wishlist,
article.pcv2-card .pcv2-preview {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid #d8e2ec !important;
  background: rgba(255,255,255,.97) !important;
  color: #174a67 !important;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .12) !important;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease !important;
}

article.pcv2-card .pcv2-wishlist:hover,
article.pcv2-card .pcv2-preview:hover {
  transform: translateY(-2px) !important;
  border-color: #0b9666 !important;
  background: #ecfdf5 !important;
  color: #087c57 !important;
}

/* Fixed internal rhythm means every price, delivery row and action area shares
   a common horizontal baseline even when titles/specifications differ. */
article.pcv2-card > .pcv2-body {
  padding: var(--pcv2-body-pad) !important;
}

article.pcv2-card .pcv2-content {
  flex: 0 0 130px !important;
  height: 130px !important;
  min-height: 130px !important;
  max-height: 130px !important;
  gap: 4px !important;
}

article.pcv2-card .pcv2-meta {
  flex: 0 0 26px !important;
  height: 26px !important;
  min-height: 26px !important;
}

article.pcv2-card .pcv2-category,
article.pcv2-card .pcv2-brand {
  height: 26px !important;
  min-height: 26px !important;
  line-height: 26px !important;
}

article.pcv2-card h3.pcv2-title {
  flex: 0 0 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: 1.42 !important;
}

article.pcv2-card .pcv2-spec {
  flex: 0 0 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  line-height: 24px !important;
}

article.pcv2-card .pcv2-price {
  flex: 0 0 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  align-items: center !important;
}

article.pcv2-card .pcv2-commerce {
  display: grid !important;
  flex: 1 1 auto !important;
  grid-template-rows: 20px 30px 20px 30px minmax(76px, auto) !important;
  gap: 5px !important;
  min-height: 0 !important;
  padding-top: 5px !important;
  overflow: hidden !important;
}

article.pcv2-card .pcv2-promo,
article.pcv2-card .pcv2-activity {
  display: flex !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  overflow: hidden !important;
}

article.pcv2-card .pcv2-promo.is-empty,
article.pcv2-card .pcv2-activity.is-empty {
  display: flex !important;
  visibility: hidden !important;
}

article.pcv2-card .pcv2-delivery {
  align-self: stretch !important;
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  border-radius: 10px !important;
}

article.pcv2-card .pcv2-stock-row {
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  gap: 6px !important;
}

article.pcv2-card .pcv2-stock,
article.pcv2-card .pcv2-shipping {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 9px !important;
  line-height: 28px !important;
}

article.pcv2-card .pcv2-actions {
  align-self: end !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  grid-template-rows: 36px 36px !important;
  gap: 4px 8px !important;
  margin-top: 0 !important;
}

article.pcv2-card .pcv2-btn,
article.pcv2-card .pcv2-buy {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  border-radius: 11px !important;
}

article.pcv2-card .pcv2-view {
  border-color: #d4dfeb !important;
  background: #fff !important;
  color: #19324f !important;
}

article.pcv2-card .pcv2-cart {
  border-color: #12a36f !important;
  background: #fff !important;
  color: #087c57 !important;
}

article.pcv2-card .pcv2-buy {
  border-color: #07895e !important;
  background: linear-gradient(135deg, #0aa06f, #07895e) !important;
  box-shadow: 0 6px 14px rgba(7, 137, 94, .21) !important;
}

article.pcv2-card .pcv2-buy:hover:not(.is-disabled) {
  background: linear-gradient(135deg, #07895e, #066c4b) !important;
  box-shadow: 0 8px 18px rgba(7, 137, 94, .28) !important;
}

/* Rails must always reserve the whole enterprise card. */
.ps-product-slider-shell,
[data-product-slider],
.ps-product-slider-track,
.products-grid,
.products-row,
.product-grid,
.jumia-products-grid,
.ps-product-grid {
  min-height: 628px !important;
}

@media (max-width: 767.98px) {
  article.pcv2-card {
    --pcv2-card-height: 532px;
    --pcv2-media-height: 192px;
    --pcv2-body-pad: 10px;
  }

  article.pcv2-card > .pcv2-media { padding: 11px !important; }
  article.pcv2-card .pcv2-content {
    flex-basis: 120px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
  }
  article.pcv2-card h3.pcv2-title {
    flex-basis: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
  }
  article.pcv2-card .pcv2-commerce {
    grid-template-rows: 18px 28px 18px 28px minmax(70px, auto) !important;
    gap: 4px !important;
  }
  article.pcv2-card .pcv2-delivery,
  article.pcv2-card .pcv2-stock-row {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
  article.pcv2-card .pcv2-stock,
  article.pcv2-card .pcv2-shipping {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    line-height: 26px !important;
  }
  article.pcv2-card .pcv2-actions {
    height: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    grid-template-rows: 33px 33px !important;
  }
  article.pcv2-card .pcv2-btn,
  article.pcv2-card .pcv2-buy {
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;
  }
  .ps-product-slider-shell,
  [data-product-slider],
  .ps-product-slider-track,
  .products-grid,
  .products-row,
  .product-grid,
  .jumia-products-grid,
  .ps-product-grid {
    min-height: 552px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  article.pcv2-card,
  article.pcv2-card .pcv2-main-img,
  article.pcv2-card .pcv2-hover-img,
  article.pcv2-card .pcv2-wishlist,
  article.pcv2-card .pcv2-preview {
    transition: none !important;
  }
  article.pcv2-card:hover,
  article.pcv2-card:hover .pcv2-main-img,
  article.pcv2-card:hover .pcv2-hover-img {
    transform: none !important;
  }
}
