/* Reserve the same image space before the public image script runs. */
.ug-product-card[data-ug-amazon-asin] > .ug-product-image[data-ug-amazon-image="primary"],
.ug-product-card [data-ugabamz-image-slot] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 220px !important;
  min-height: 220px !important;
  max-height: 220px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
}

.ug-product-card [data-ugabamz-image-slot] > a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Only runtime-verified, text-only merchant groups receive these classes. */
.ug-product-card .ugabamz-purchase-links {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
  clear: both !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.ug-product-card .ugabamz-purchase-links > .ugabamz-purchase-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  clear: none !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 12px 8px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Only ancestors of verified purchase groups receive this class. Legacy
   inline min-widths must not force the card's flex children past its edges. */
.ug-product-card .ugabamz-purchase-container,
.ug-product-card .ugabamz-purchase-container > div {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.ug-product-card .ugabamz-purchase-links.ugabamz-purchase-links-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* Standalone explanatory images use the readable article width, never the card frame. */
figure.ug-amazon-subimage {
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin: 24px auto;
  padding: 0;
}
figure.ug-amazon-subimage > .ugabamz-variant-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  max-width: 100%;
  text-align: center;
}
figure.ug-amazon-subimage img { max-width: 100% !important; height: auto !important; }
figure.ug-amazon-subimage > figcaption { margin-top: 8px; font-size: 0.9em; line-height: 1.6; }
