/* v1.1.4 - isolated Warehouse grid normalization for the inserted product list.
 * PrestaShop's product.tpl may apply a bootstrap percentage width to an outer
 * .js-product wrapper.  A grid cell is NOT a Bootstrap row; its direct child
 * must fill the cell, or the whole product card collapses to ~20% width.
 * ALL overrides are limited to the edstar module grid.
 */
#edstar-recent-activations {
  clear: both;
  max-width: 1320px;
  margin: 18px auto 40px;
  padding: 0 16px;
}
#edstar-recent-activations .edstar-recent-heading {
  text-align: center;
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 22px;
}

.edstar-recent-grid[data-edstar-grid] {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  align-items: stretch;
}
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell {
  display: block !important;
  position: relative;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* IMPORTANT: Warehouse and Classic add .col-* / .product wrappers to product.tpl.
 * On a grid cell those percentage widths made the cards 60 px wide.
 */
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell > *,
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell > .js-product,
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell > .product,
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell > .product-miniature,
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell .product-miniature,
.edstar-recent-grid[data-edstar-grid] > .edstar-recent-cell .js-product-miniature {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  float: none !important;
}
.edstar-recent-grid[data-edstar-grid] .thumbnail-container,
.edstar-recent-grid[data-edstar-grid] .product-thumbnail,
.edstar-recent-grid[data-edstar-grid] .product-miniature .thumbnail {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0;
  max-width: 100% !important;
}
.edstar-recent-grid[data-edstar-grid] .product-thumbnail img,
.edstar-recent-grid[data-edstar-grid] .thumbnail-container img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 200px !important;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
}

/* Show tidy, scannable cards like the existing Warehouse New Arrivals block. */
.edstar-recent-grid[data-edstar-grid] .product-miniature,
.edstar-recent-grid[data-edstar-grid] .js-product-miniature {
  height: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.edstar-recent-grid[data-edstar-grid] .product-description-short,
.edstar-recent-grid[data-edstar-grid] .description-short,
.edstar-recent-grid[data-edstar-grid] .product-desc,
.edstar-recent-grid[data-edstar-grid] [itemprop="description"] {
  display: none !important;
}
.edstar-recent-grid[data-edstar-grid] .product-title,
.edstar-recent-grid[data-edstar-grid] .product-name,
.edstar-recent-grid[data-edstar-grid] .h3 {
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal !important;
}
.edstar-recent-grid[data-edstar-grid] .btn,
.edstar-recent-grid[data-edstar-grid] button[data-button-action="add-to-cart"] {
  max-width: 100%;
  width: auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: normal;
}

@media (max-width: 1199px) {
  .edstar-recent-grid[data-edstar-grid] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .edstar-recent-grid[data-edstar-grid] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 767px) {
  .edstar-recent-grid[data-edstar-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .edstar-recent-grid[data-edstar-grid] .product-thumbnail img,
  .edstar-recent-grid[data-edstar-grid] .thumbnail-container img { height: 155px !important; }
}
@media (max-width: 360px) {
  .edstar-recent-grid[data-edstar-grid] { grid-template-columns: minmax(0, 1fr); }
}
