@media (prefers-reduced-motion: reduce) {
  .afp-product-card:hover .afp-product-card__media,
  .afp-product-card:focus-visible .afp-product-card__media {
    transform: none;
  }
}

.afp-products {
  min-height: 631px;
  overflow: hidden;
}

.afp-products__carousel {
  position: relative;
  margin-top: 44px;
}

.afp-products__track {
  display: grid;
  grid-auto-columns: 282px;
  grid-auto-flow: column;
  gap: var(--afp-homepage-gap);
  overflow-x: auto;
  padding: 0 max(24px, calc((100vw - var(--afp-homepage-container)) / 2)) 36px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.afp-products__track::-webkit-scrollbar {
  display: none;
}

.afp-product-card {
  position: relative;
  display: flex;
  height: 282px;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 4px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
}

.afp-product-card:hover,
.afp-product-card:focus-visible {
  color: inherit;
  text-decoration: none;
}

.afp-product-card:hover *,
.afp-product-card:focus-visible * {
  text-decoration: none;
}

.afp-product-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 4px;
  background-color: #c8d4ee;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: transform 0.35s ease;
}

.afp-product-card:hover .afp-product-card__media,
.afp-product-card:focus-visible .afp-product-card__media {
  transform: scale(1.05);
}

.afp-product-card__label {
  display: none;
}

.afp-product-card__body {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0;
}

.afp-product-card__title {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  background: #fff;
  color: var(--afp-homepage-text);
  font-family: source-sans-pro, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.afp-product-card__subtitle {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  width: 100%;
  max-height: 0;
  margin: 0;
  padding: 0 12px;
  opacity: 0;
  overflow: hidden;
  background: #202020;
  color: #fff;
  font-family: source-sans-pro, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
  transition: opacity 0.25s ease, max-height 0.25s ease, padding 0.25s ease;
}

.afp-product-card__subtitle-text {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.afp-product-card__subtitle-arrow {
  display: inline-flex;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.afp-product-card__subtitle-arrow img {
  display: block;
  width: 20px;
  height: 20px;
}

.afp-product-card:hover .afp-product-card__subtitle,
.afp-product-card:focus-visible .afp-product-card__subtitle,
.afp-product-card.is-expanded .afp-product-card__subtitle {
  max-height: 77px;
  padding: 12px;
  opacity: 1;
}

/* YOG-1125: on touch devices, subtitle opens via first tap (is-expanded). */
@media (hover: none) {
  .afp-product-card:hover .afp-product-card__subtitle {
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
  }

  .afp-product-card.is-expanded .afp-product-card__subtitle {
    max-height: 77px;
    padding: 12px;
    opacity: 1;
  }
}

.afp-products__control {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  line-height: 0;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.afp-products__control:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.afp-products__control:focus-visible {
  outline: 2px solid var(--afp-homepage-blue);
  outline-offset: 2px;
}

.afp-products__control img {
  display: block;
  width: 24px;
  height: 24px;
}

.afp-products__control--prev {
  left: min(84px, max(20px, calc((100vw - var(--afp-homepage-container)) / 2 + 24px)));
}

.afp-products__control--next {
  right: min(84px, max(20px, calc((100vw - var(--afp-homepage-container)) / 2 + 24px)));
}

.afp-products__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0 0;
}

.afp-products__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
  flex-shrink: 0;
}

.afp-products__dot.is-active {
  width: 20px;
  background: var(--afp-homepage-blue);
  transform: none;
}

@media (max-width: 1023px) {
  .afp-products {
    min-height: 0;
  }

  .afp-products__carousel {
    margin-top: 32px;
  }

  .afp-products__track {
    grid-auto-columns: 242px;
    padding-left: 40px;
    padding-right: 40px;
  }

  .afp-product-card {
    height: 242px;
  }
}

@media (max-width: 767px) {
  .afp-products__carousel {
    margin-top: 24px;
  }

  .afp-products__track {
    grid-auto-columns: min(327px, calc(100vw - 48px));
    padding-left: 24px;
    padding-right: 24px;
  }

  .afp-product-card {
    height: 327px;
  }

  .afp-products__control {
    display: none;
  }
}
