/* Each card owns its grid position. Keep the image stage independent of its text. */
.product-photo {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: clamp(8px, 1.2vw, 18px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dae3e8;
  border-radius: 12px;
}

.product-photo > a,
.product-photo picture {
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.product-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.product-photo-link {
  position: relative;
}

.product-photo-arrow {
  position: absolute;
  inset: auto 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dae3e8;
  border-radius: 50%;
  background: #fff;
  color: #263a33;
  font-size: 17px;
  line-height: 1;
}

.product-photo-link:is(:hover,:focus-visible) .product-photo-arrow {
  border-color: #263a33;
  background: #263a33;
  color: #fff;
}

.product-photo a:focus-visible {
  outline: 2px solid #4b584a;
  outline-offset: 2px;
}

.product-photo-block{margin:0 0 12px}
.product-photo-credit{margin:5px 0 0;color:#5d665c;font-size:.79rem;line-height:1.4;text-align:right}
.candidate-with-photo .product-photo{aspect-ratio:1/1}
.card .product-photo{max-width:465px;margin-inline:auto}

@media (min-width: 751px) {
  .candidate-grid:has(> .candidate-with-photo):not(:has(> .candidate-with-photo ~ .candidate-with-photo)):has(> :nth-child(3)) {
    grid-template-columns:minmax(0,1.18fr) minmax(0,1fr);
    grid-template-rows:auto 1fr;
    align-items:start;
  }
  .candidate-grid:has(> .candidate-with-photo):not(:has(> .candidate-with-photo ~ .candidate-with-photo)):has(> :nth-child(3)) > .candidate-with-photo {
    grid-column:1;
    grid-row:1 / span 2;
  }
  .candidate-grid:has(> .candidate-with-photo):not(:has(> .candidate-with-photo ~ .candidate-with-photo)):has(> :nth-child(3)) > :not(.candidate-with-photo) {
    grid-column:2;
  }
  .candidate-with-photo .product-photo{aspect-ratio:5/4}
}

@media (max-width: 600px) {
  .product-photo {
    aspect-ratio: 5 / 4;
    padding: 10px;
  }
}

/* Inline comparisons use the same full-width photo stage as the sizing guides. */
.product.product-with-photo {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
}

.product-with-photo .product-photo,
.card .product-photo {
  max-width: none;
  background: #fff;
}

.card .product-photo {
  max-height: clamp(240px, 42vw, 460px);
}
.affiliate-product{display:grid;justify-items:start;gap:4px;max-width:100%;min-width:0;overflow-wrap:anywhere}
.affiliate-product .affiliate-label{font-size:.8125rem;color:#41524b}
.affiliate-product img{max-width:100%}
.affiliate-photo-offer{max-width:100%;overflow-x:auto;margin-block:12px 24px}

.category-offer {
  margin-block: clamp(24px, 4vw, 48px);
  padding: clamp(14px, 2.5vw, 28px);
  border: 1px solid #dae3e8;
  border-radius: 12px;
  background: #fff;
}

.category-offer > h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 550;
  letter-spacing: -.02em;
}

.category-offer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-offer-item {
  min-width: 0;
  align-self: start;
  overflow-x: auto;
  scroll-margin-top: 16px;
}

.category-offer-item > .product-photo-block {
  max-width: 340px;
}

.category-offer a:focus-visible {
  outline: 2px solid #07563f;
  outline-offset: 2px;
}

@media (max-width: 360px) {
  .category-offer {
    margin-inline: -14px;
    padding-inline: 0;
  }

  .category-offer > h2 { padding-inline: 8px; }
}
