/* One decorative WA mark per product card. Full-size photos remain untouched. */
:is(.az-discovery-photo, .v21-item-photo, .store-photo) {
  container-type: inline-size;
}

:is(.az-discovery-photo, .v21-item-photo, .store-photo) > .az-accessory-wa {
  display: none;
}

:is(.az-discovery-photo, .v21-item-photo, .store-photo)::after {
  content: "";
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  width: 44px;
  height: 44px;
  background: url("images/wa-logo.png") center / contain no-repeat;
  pointer-events: none;
  z-index: 2;
}

/* The two packshots have the same 1000 × 1220 dimensions and a centred mark
   in the upper margin. Clip that margin only in the card's image element. */
:is(.az-discovery-photo, .v21-item-photo, .store-photo)
  > img[src$="-packshot-v18.webp"] {
  --packshot-height: min(100%, 122cqw);
  --wa-cut: calc((100% - var(--packshot-height)) / 2 + var(--packshot-height) * .16);
  clip-path: polygon(0 0, 38% 0, 38% var(--wa-cut), 62% var(--wa-cut), 62% 0,
    100% 0, 100% 100%, 0 100%);
}

/* Gallery slides already carrying WA retain their original treatment. */
.store-photo:has(> img[src$="-promo-v18.webp"], > img[src$="-nutrition-v18.webp"])::after,
body.az-zoom-is-open :is(.az-discovery-photo, .v21-item-photo, .store-photo)::after,
body:has(dialog.az-product-zoom[open]) :is(.az-discovery-photo, .v21-item-photo, .store-photo)::after {
  display: none;
}

/* The accessory photo link sits over the photo, but below the zoom button. */
.page-store-v15 .store-view-full {
  z-index: 4;
}

.az-product-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  margin-block-end: 10px;
  border: 1px solid #d8cce6;
  border-radius: 10px;
  background: #fff;
  color: #59298d;
  font-weight: 750;
  text-decoration: none;
}
.az-product-back:focus-visible { outline: 3px solid #59298d; outline-offset: 2px; }
.az-back-arrow { display: inline-block; }
[dir="rtl"] .az-back-arrow { transform: scaleX(-1); }
