.results__gallery-controls {
  display: none;
}

/* Risks carousel uses the same restrained, non-overlapping controls. */
.theme-apple .marketplace-risks__controls {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
  padding-right: clamp(24px, 4vw, 56px);
}

.theme-apple .marketplace-risks__controls .marketplace-risks__arrow {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  color: var(--apple-accent, #c70c2f);
  background: #fff;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.08);
  cursor: pointer;
  transform: none !important;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.theme-apple .marketplace-risks__controls .marketplace-risks__arrow svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-apple .marketplace-risks__controls .marketplace-risks__arrow:hover:not(:disabled),
.theme-apple .marketplace-risks__controls .marketplace-risks__arrow:focus-visible {
  color: #fff;
  background: var(--apple-accent, #c70c2f);
  border-color: var(--apple-accent, #c70c2f);
}

.theme-apple .marketplace-risks__controls .marketplace-risks__arrow:focus-visible {
  outline: 3px solid rgba(199, 12, 47, 0.2);
  outline-offset: 3px;
}

.theme-apple .marketplace-risks__controls .marketplace-risks__arrow:disabled {
  opacity: 0.34;
  cursor: default;
}

@media (max-width: 600px) {
  .theme-apple .marketplace-risks__controls {
    margin-bottom: 14px;
    padding-right: 14px;
  }

  .theme-apple .marketplace-risks__controls .marketplace-risks__arrow {
    width: 42px;
    height: 42px;
  }

  .theme-apple .marketplace-risks__controls .marketplace-risks__arrow svg {
    width: 18px;
    height: 18px;
  }
}

@media (min-width: 601px) {
  .theme-apple .results__inner {
    overflow: hidden;
  }

  .results__gallery-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
  }

  .results__gallery-button {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--apple-accent, #c70c2f);
    background: #fff;
    border: 1px solid rgba(29, 29, 31, 0.14);
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(29, 29, 31, 0.08);
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
  }

  .results__gallery-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .results__gallery-button:hover:not(:disabled),
  .results__gallery-button:focus-visible {
    color: #fff;
    background: var(--apple-accent, #c70c2f);
    border-color: var(--apple-accent, #c70c2f);
  }

  .results__gallery-button:focus-visible {
    outline: 3px solid rgba(199, 12, 47, 0.2);
    outline-offset: 3px;
  }

  .results__gallery-button:disabled {
    opacity: 0.34;
    cursor: default;
  }

  .theme-apple .results-carousel {
    margin-top: 16px;
  }

  .theme-apple .results-carousel .mobile-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .theme-apple .results-carousel .mobile-carousel__viewport::-webkit-scrollbar {
    display: none;
  }

  .theme-apple .results-carousel .results__grid {
    display: flex;
    grid-template-columns: none;
    width: max-content;
    margin-top: 0;
    gap: 16px;
    background: transparent;
  }

  .theme-apple .results-carousel__slide {
    display: block;
    flex: 0 0 clamp(340px, 29vw, 380px);
    width: clamp(340px, 29vw, 380px);
    scroll-snap-align: start;
  }

  .theme-apple .results-carousel__slide .result-card {
    height: 100%;
  }

  .theme-apple .results-carousel .mobile-carousel__arrow,
  .theme-apple .results-carousel .mobile-carousel__dots,
  .theme-apple .results-carousel__age {
    display: none;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .theme-apple .results-carousel__slide {
    flex-basis: min(68vw, 376px);
    width: min(68vw, 376px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .results__gallery-button {
    transition: none;
  }
}

/* Keep the desktop risk gallery inside the same content grid as other blocks. */
@media (min-width: 901px) {
  .theme-apple .marketplace-risks__stage {
    position: relative !important;
    width: 100% !important;
    margin: 40px 0 0 !important;
    padding: 62px 0 0 !important;
    overflow: visible !important;
  }

  .theme-apple .marketplace-risks__controls {
    position: absolute !important;
    inset: 0 0 auto auto !important;
    z-index: 7;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
  }

  .theme-apple .marketplace-risks__controls .marketplace-risks__arrow {
    position: static !important;
    inset: auto !important;
    transform: none !important;
  }

  .theme-apple .marketplace-risks__rail {
    width: 100% !important;
    overflow: hidden !important;
  }

  .theme-apple .marketplace-risks__cards {
    width: 100% !important;
    padding: 0 !important;
    gap: 18px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .theme-apple .marketplace-card {
    flex: 0 0 300px !important;
  }
}

/* Risk cards use full-bleed photos with restrained edge shading for labels. */
.theme-apple .marketplace-risks {
  background: var(--apple-accent) !important;
}

.theme-apple .marketplace-card {
  position: relative;
  height: auto !important;
  aspect-ratio: 3 / 4;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #fff !important;
  background: #2b1719;
  box-shadow: none !important;
}

.theme-apple .marketplace-card__meta {
  position: absolute !important;
  z-index: 3;
  inset: 18px 18px auto !important;
  color: #fff !important;
  text-shadow: 0 1px 12px rgba(24, 8, 10, 0.48);
}

.theme-apple .marketplace-card__placeholder {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 64px 20px 22px !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: inherit !important;
  background: transparent !important;
  text-align: left !important;
}

.theme-apple .marketplace-card__placeholder::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(22, 7, 10, 0.34) 0%,
    transparent 24%,
    transparent 68%,
    rgba(22, 7, 10, 0.48) 100%
  );
  content: "";
  pointer-events: none;
}

.theme-apple .marketplace-card__placeholder > .marketplace-card__image {
  position: absolute !important;
  z-index: 0;
  inset: 0 !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border-radius: inherit !important;
  object-fit: cover !important;
  object-position: center;
}

.theme-apple .marketplace-card__placeholder > .marketplace-card__condition {
  position: relative;
  z-index: 2;
  max-width: min(25ch, 100%);
  color: #fff !important;
  font-size: 17px !important;
  line-height: 1.22 !important;
  text-shadow: 0 1px 12px rgba(24, 8, 10, 0.58);
}
