/*
 * A2Z E-Com Store — isolated card-image presentation upgrade.
 * Only product, brand and product-category card media is affected here.
 * Product and category imagery stays uncropped; brand marks stay contained.
 */

/* Product cards: portrait image stage inspired by the reference storefront. */
body .product-card .product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-width: 0;
  padding: 0 !important;
  overflow: hidden;
  background: var(--a2z-color-hex-faf6f8);
}

body .product-card .product-image > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

body .product-card .product-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}

/* Native WooCommerce loop cards use their own markup rather than .product-card. */
body .woocommerce ul.products li.product a img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  margin: 0 0 10px;
  padding: 0;
  background: var(--a2z-color-hex-faf6f8);
  object-fit: contain;
  object-position: center;
}

/* Small product recommendation cards retain their natural image proportions. */
body .sidebar-rated-card > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  background: var(--a2z-color-hex-faf6f8);
}
body .sidebar-rated-card > a img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 112px;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
body .a2z-saved-card > a {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  background: var(--a2z-color-hex-faf6f8);
}
body .a2z-saved-card > a img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}

/* Brand cards: give logos a stable square stage without cropping or stretching. */
body .brand-feature-card {
  min-width: 0;
}
body .brand-feature-card > img,
body .brand-feature-card > .a2z-brand-image-fallback {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 132px;
  justify-self: center;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  box-sizing: border-box;
  background: var(--a2z-color-hex-faf6f8);
  border-radius: 10px;
}
body .brand-feature-card > .a2z-brand-image-fallback {
  min-height: 0;
}

/* Homepage brand strip uses typographic wordmarks, not uploaded logo images. */
body .brand-strip > a {
  min-width: 0;
  overflow: hidden;
  text-align: center;
}
body .brand-strip > a b {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Category cards: consistent image window, full available width, no forced crop. */
body .category-feature-card {
  min-width: 0;
}
body .category-feature-card > img {
  display: block;
  flex: 0 0 auto;
  width: calc(100% + 32px);
  max-width: none;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: -16px -16px 10px;
  object-fit: contain;
  object-position: center;
  background: var(--a2z-color-hex-faf6f8);
}
body .category-feature-card > .a2z-category-image-fallback {
  width: calc(100% + 32px);
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  margin: -16px -16px 10px;
  border-radius: 0;
  background: var(--a2z-color-hex-faf6f8);
}

/* Category navigation cards also contain category thumbnails. */
body .a2z-nav-category-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  background: var(--a2z-color-hex-faf6f8);
}
body .a2z-nav-category-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 680px) {
  body .brand-feature-card > img,
  body .brand-feature-card > .a2z-brand-image-fallback {
    max-width: 100%;
    padding: 7px;
  }

  body .category-feature-card > img,
  body .category-feature-card > .a2z-category-image-fallback {
    width: calc(100% + 22px);
    margin: -11px -11px 9px;
  }
}

@media (max-width: 360px) {
  body .product-card .product-image {
    aspect-ratio: 3 / 4;
  }
  body .product-card .product-image img {
    min-width: 0;
  }
  body .brand-feature-card > img,
  body .brand-feature-card > .a2z-brand-image-fallback {
    padding: 5px;
  }
}

body .brand-strip > a .a2z-home-brand-logo {
  display: block;
  width: min(100%, 108px);
  height: 58px;
  margin: 0 auto 8px;
  padding: 5px;
  object-fit: contain;
  object-position: center;
  background: var(--a2z-color-hex-faf6f8);
  border-radius: 8px;
}
@media (max-width: 680px) {
  body .brand-strip > a .a2z-home-brand-logo {
    width: min(100%, 96px);
    height: 52px;
  }
}
