/* Product card layout overrides loaded after the main stylesheet. */
/* Two readable product cards per row in mobile category/search listings. */
@media (max-width: 720px) {
  #productWedgeGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  #productWedgeGrid .product-wedge-card {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: 0;
    padding: 10px;
    border-radius: 9px;
  }

  #productWedgeGrid .product-wedge-media { display: block !important; min-width: 0; padding: 0; }
  #productWedgeGrid .product-wedge-media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 5px; }
  #productWedgeGrid .product-wedge-body { display: flex !important; flex: 1; flex-direction: column; gap: 10px; height: auto; padding: 12px 0 0; }
  #productWedgeGrid .product-wedge-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 39px;
    max-height: 39px;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
  }
  #productWedgeGrid .product-card-stock p { margin: 0; }
  #productWedgeGrid .product-card-stock.product-stock-status span { font-size: 12px !important; }
  #productWedgeGrid .product-wedge-price-row { margin-top: auto; }
  #productWedgeGrid .product-wedge-price-row strong { font-size: clamp(18px, 5vw, 22px); white-space: nowrap; }
}

.product-wedge-cart-button,
.product-recommendation-cart-button {
  width: 100%;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 12px !important;
  gap: 8px !important;
  border-radius: 6px !important;
  font-size: 0.92rem !important;
  line-height: 1 !important;
}

.product-wedge-cart-button svg,
.product-recommendation-cart-button svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px;
}

.product-wedge-cart-button span,
.product-recommendation-cart-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-wedge-card,
.product-recommendation-card:not(.home-best-seller-card) {
  display: grid !important;
  height: 100%;
  min-height: 0;
}

.product-wedge-card {
  grid-template-rows: auto 1fr !important;
}

.product-wedge-body {
  display: grid !important;
  grid-template-rows: auto auto auto auto 1fr 44px auto;
  height: 100%;
  min-height: 0;
}

.product-wedge-body .product-wedge-cart-button {
  grid-row: 6;
  align-self: end;
}

.product-recommendation-card:not(.product-wedge-card):not(.home-best-seller-card) {
  grid-template-rows: 1fr 44px !important;
}

.product-recommendation-card:not(.product-wedge-card):not(.home-best-seller-card) .product-recommendation-link {
  display: grid !important;
  grid-template-rows: auto auto auto auto 1fr;
  height: 100%;
  min-height: 0;
}

.product-recommendation-card:not(.product-wedge-card):not(.home-best-seller-card) .product-recommendation-link em {
  align-self: end;
}

.product-recommendation-card:not(.product-wedge-card):not(.home-best-seller-card) .product-recommendation-cart-button {
  align-self: end;
}

.home-best-sellers .home-best-seller-card {
  height: auto !important;
}

.home-best-sellers .home-best-seller-card .product-recommendation-link {
  grid-template-rows: none !important;
  height: auto !important;
  align-content: start;
}

.home-best-sellers .home-best-seller-card .product-recommendation-link em,
.home-best-sellers .home-best-seller-card .product-recommendation-cart-button {
  align-self: auto;
}

/* ------------------------------------------------------------------ */
/* Natuurlijkere prijzen en voorraadstatus.                            */
/* Prijzen in donkere inkt in plaats van rood — rood blijft alleen     */
/* voor uitverkocht en besparingen. Voorraadregel kleiner en rustiger. */
/* ------------------------------------------------------------------ */

/* Productkaarten: prijs in donkere inkt, iets minder zwaar. */
body.light-theme .product-recommendation-link em,
body.light-theme .product-recommendation-card em,
body.light-theme .home-best-seller-price-row strong,
body.light-theme .product-wedge-price-row strong,
body.light-theme .home-best-sellers .product-recommendation-link em,
body.light-theme .product-wedge-grid .product-wedge-price-row strong {
  color: #17212d !important;
  font-weight: 800 !important;
}

body:not(.light-theme) .product-recommendation-link em,
body:not(.light-theme) .product-recommendation-card em,
body:not(.light-theme) .home-best-seller-price-row strong,
body:not(.light-theme) .product-wedge-price-row strong,
body:not(.light-theme) .home-best-sellers .product-recommendation-link em {
  color: #f5f7fb !important;
  font-weight: 800 !important;
}

/* Productdetailpagina: grote prijs ook in donkere inkt. */
body.light-theme #productPrice,
body.light-theme .product-detail-buybox strong {
  color: #17212d !important;
}

body:not(.light-theme) #productPrice,
body:not(.light-theme) .product-detail-buybox strong {
  color: #f5f7fb !important;
}

/* Voorraadregel op kaarten: kleiner, rustiger groen, geen schreeuw. */
.product-card-stock.product-stock-status span {
  font-size: 0.85rem !important;
  font-weight: 650 !important;
  color: #1e8a45 !important;
}

body:not(.light-theme) .product-card-stock.product-stock-status span {
  color: #4cc072 !important;
}

/* Uitverkocht blijft rood — dat signaal moet juist opvallen. */
.product-card-stock.product-stock-status.is-out-of-stock span {
  color: #c22740 !important;
}

@media (max-width: 720px) {
  .product-wedge-card,
  .product-recommendation-card:not(.home-best-seller-card) {
    grid-template-rows: auto !important;
    align-content: start;
  }

  .product-wedge-body {
    grid-template-rows: auto auto auto auto auto auto auto !important;
    row-gap: 8px;
  }

  .product-wedge-body .product-wedge-cart-button,
  .product-recommendation-card:not(.product-wedge-card):not(.home-best-seller-card) .product-recommendation-cart-button,
  .home-best-sellers .home-best-seller-cart {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    align-self: stretch !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px 0 0 !important;
  }

  .home-best-sellers .home-best-seller-cart {
    width: calc(100% - 24px) !important;
    margin: 12px 12px 14px !important;
  }

  .home-best-sellers .home-best-seller-cart-inline {
    display: none !important;
  }

  .home-best-sellers .home-best-seller-cart-body {
    display: inline-flex !important;
  }
}
