/* === Scoped overrides for "You may also like" + "Recently viewed" cards === */

/* Nuclear reset: kill ANY border/outline/box-shadow on ALL descendants —
   some elements get borders via inline style attrs or high-specificity selectors
   that don't match standard CSS overrides. */
.section-recommended-product *,
.section-recommended-product *::before,
.section-recommended-product *::after,
.section-recently-viewed-product *,
.section-recently-viewed-product *::before,
.section-recently-viewed-product *::after {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Re-allow the quick-add button border (the 40x40 + bag icon) */
.section-recommended-product .block-product-card__quick-add,
.section-recently-viewed-product .block-product-card__quick-add {
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Remove the gray image-background */
.section-recommended-product .block-product-card__image-wrapper,
.section-recommended-product .block-product-image__image-wrapper,
.section-recently-viewed-product .block-product-card__image-wrapper,
.section-recently-viewed-product .block-product-image__image-wrapper {
  background-color: transparent !important;
  border-radius: 0 !important;
}

/* Square (1:1) image — matches reference related-products aspect */
.section-recommended-product .block-product-card__layer-image-wrapper,
.section-recommended-product .block-product-image__layer-image-wrapper,
.section-recently-viewed-product .block-product-card__layer-image-wrapper,
.section-recently-viewed-product .block-product-image__layer-image-wrapper {
  aspect-ratio: 1 / 1 !important;
}
.section-recommended-product .block-product-card__image-wrapper,
.section-recommended-product .block-product-image__image-wrapper,
.section-recently-viewed-product .block-product-card__image-wrapper,
.section-recently-viewed-product .block-product-image__image-wrapper {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
}

/* Product image: contain (no crop), centered */
.section-recommended-product .block-product-card__image,
.section-recommended-product .block-product-image__image,
.section-recently-viewed-product .block-product-card__image,
.section-recently-viewed-product .block-product-image__image {
  object-fit: contain !important;
  object-position: center !important;
}

/* Card backgrounds transparent */
.section-recommended-product .block-product-card,
.section-recently-viewed-product .block-product-card {
  background: transparent !important;
}
.section-recommended-product .block-product-card .block-product-title,
.section-recommended-product .block-product-card .block-product-price,
.section-recently-viewed-product .block-product-card .block-product-title,
.section-recently-viewed-product .block-product-card .block-product-price {
  padding-inline: 0 !important;
}

/* Hide subtitle placeholder "Describe your product" — matches compact reference card */
.section-recommended-product .block-product-card__description,
.section-recommended-product .block-product-card .block-product-description,
.section-recommended-product .block-product-card .block-product-subtitle,
.section-recently-viewed-product .block-product-card__description,
.section-recently-viewed-product .block-product-card .block-product-description,
.section-recently-viewed-product .block-product-card .block-product-subtitle {
  display: none !important;
}

/* Tighten badges */
.section-recommended-product .product-card-badges .block-tag,
.section-recommended-product .product-card-badges [class*="badge"],
.section-recently-viewed-product .product-card-badges .block-tag,
.section-recently-viewed-product .product-card-badges [class*="badge"] {
  padding: 2px 8px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
}

/* Section heading gap */
.section-recommended-product .recommended-product__heading,
.section-recommended-product h2,
.section-recently-viewed-product h2 {
  margin-block-end: 24px;
}

@media (max-width: 959px) {
  .section-recommended-product .block-product-card__image-wrapper,
  .section-recommended-product .block-product-image__image-wrapper,
  .section-recommended-product .block-product-card__layer-image-wrapper,
  .section-recommended-product .block-product-image__layer-image-wrapper,
  .section-recently-viewed-product .block-product-card__image-wrapper,
  .section-recently-viewed-product .block-product-image__image-wrapper,
  .section-recently-viewed-product .block-product-card__layer-image-wrapper,
  .section-recently-viewed-product .block-product-image__layer-image-wrapper {
    aspect-ratio: 1 / 1 !important;
  }
  /* 12px gap between cards on mobile */
  .section-recommended-product .block-product-list.grid,
  .section-recently-viewed-product .block-product-list.grid {
    gap: 12px !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
  }
}
