/* =========================================================
   Homepage product rails — premium storefront treatment
   Scoped intentionally so legacy .spg-strip/.spg-card users stay unchanged.
   ========================================================= */
.home-products {
  --rail-gap: 24px;
  --rail-columns: 4;
  min-width: 0;
  max-width: 100%;
  margin-block: 48px;
  padding-inline: 32px;
  color: #222;
  background: #fff;
}

.home-products,
.home-products * {
  box-sizing: border-box;
}

.home-products--discount {
  margin-block: 56px 0;
  padding-block: 42px;
  background: #fcf8fc;
}
.home-products--best {
  padding-block: 38px;
  background: #faf7fb;
}
.home-products__inner {
  min-width: 0;
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.home-products__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  min-width: 0;
  margin-bottom: 22px;
}

.home-products__header h2 {
  margin: 0;
  min-width: 0;
  color: #222;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.45;
}

.home-products__actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
}

.home-products__all {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding-inline: 2px;
  color: #994099;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}

.home-products__track {
  /* Keep absolute screen-reader labels inside the scroll clipping boundary. */
  position: relative;
  min-width: 0;
  max-width: 100%;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 2px 2px 6px;
  gap: var(--rail-gap);
  justify-content: start;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  list-style: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.home-products__track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.home-products__item {
  flex: 0 0 calc(
    (100% - (var(--rail-columns) - 1) * var(--rail-gap))
    / var(--rail-columns)
  );
  min-width: 0;
  scroll-snap-align: start;
}

.home-product {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  padding: 11px 11px 13px;
  border: 1px solid #eceef1;
  border-radius: 20px;
  background: #fff;
  color: #222;
  text-align: right;
  text-decoration: none;
}

.home-product__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 15px;
  background: #f6f7f8;
}

.home-products--discount .home-product__image {
  background: #fafafa;
}

.home-product__image img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 9px;
  object-fit: contain;
}

.home-product__title {
  display: -webkit-box;
  min-height: 3.15em;
  margin: 14px 4px 0;
  overflow: hidden;
  color: #222;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.58;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Homepage merchandising stays intentionally uncluttered. */


.home-product__price {
  margin: 9px 4px 0;
}

.home-product__previous {
  min-height: 0;
  margin-bottom: 2px;
  color: #777;
  font-size: 12.5px;
  line-height: 1.7;
}

.home-product__previous:empty,
.home-product__saving:empty {
  display: none;
}

.home-product__previous del {
  text-decoration-thickness: 1px;
}

.home-product__current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  color: #222;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.55;
}

.home-product__currency {
  font-size: 12.5px;
  font-weight: 400;
}

.home-product__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #994099;
  color: #fff;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.home-product__saving {
  min-height: 0;
  margin-top: 3px;
  color: #666;
  font-size: 12.5px;
  line-height: 1.7;
}

.home-product__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin: 8px 4px 1px;
  padding-block: 4px;
  color: #994099;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.7;
}

.home-products :is(a, button):focus-visible {
  outline: 2px solid #994099;
  outline-offset: 3px;
}

.home-products .home-product:focus-visible {
  border-radius: 20px;
}


@media (hover: hover) and (pointer: fine) {
  .home-product {
    transition: border-color 150ms ease, background-color 150ms ease;
  }

  .home-product:hover {
    border-color: #dcd5df;
  }

  .home-product:hover .home-product__cta,
  .home-products__all:hover {
    color: #773177;
    text-decoration: underline;
  }

}

@media (max-width: 1199px) {
  .home-products {
    --rail-columns: 3;
    --rail-gap: 16px;
    margin-block: 42px;
    padding-inline: 32px;
  }

  .home-products--discount {
    margin-block: 48px 0;
    padding-block: 34px;
  }

  .home-products__header h2 {
    font-size: 24px;
  }
}

@media (max-width: 899px) {
  .home-products {
    --rail-columns: 2;
    padding-inline: 24px;
  }
}

@media (max-width: 599px) {
  .home-products {
    --rail-gap: 12px;
    margin-block: 36px;
    padding: 0 16px;
  }

  .home-products--discount {
    margin-block: 40px 0;
    padding-block: 26px;
  }

  .home-products__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    margin-bottom: 15px;
  }

  .home-products__header h2 {
    font-size: 21px;
    line-height: 1.45;
  }

  .home-products__actions {
    gap: 0;
  }

  .home-products__all {
    min-height: 32px;
    padding: 2px 0;
    font-size: 12.5px;
  }


  .home-products--discount {
  padding-block: 26px;
  background: #fcf8fc;
  }

  .home-product {
    padding: 9px 9px 11px;
    border-radius: 18px;
  }

  .home-product__image {
    border-radius: 14px;
  }

  .home-product__image img {
    padding: 7px;
  }

  .home-product__title {
    min-height: 3.2em;
    margin-top: 11px;
    font-size: 14.5px;
    line-height: 1.6;
  }

  .home-product__price {
    margin-top: 7px;
  }

  .home-product__current {
    gap: 4px 7px;
    font-size: 17.5px;
  }

  .home-product__previous,
  .home-product__saving {
    font-size: 12px;
  }

  .home-product__cta {
    margin-top: 6px;
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  .home-products {
  padding-inline: 14px;
  width: min(calc(100% - 48px), 1180px);
  margin-inline: auto;
  border-radius: 28px;
  }

  .home-products__header h2 {
    font-size: 20px;
  }

  .home-products__item {
    flex-basis: 84%;
  }
}

@media (max-width: 599px) {
  .home-products--best,
  .home-products--discount {
    padding-block-start: 24px;
  }
}

/* Preserve the inner spacing while variant backgrounds stay on the section. */
@media (min-width: 900px) {
  .home-products__inner {
    position: relative;
    isolation: isolate;
    padding-block: 24px 16px;
  }
}

/* Calculate card width against the full rail before narrowing sparse tracks. */
@media (min-width: 900px) {
  .home-products[data-product-count="1"] { --sparse-count: 1; }
  .home-products[data-product-count="2"] { --sparse-count: 2; }
  .home-products[data-product-count="3"] { --sparse-count: 3; }

  .home-products:is([data-product-count="1"], [data-product-count="2"], [data-product-count="3"]) {
    --sparse-card-width: calc((min(960px, calc(100vw - 64px)) - 4px - (var(--rail-columns) - 1) * var(--rail-gap)) / var(--rail-columns));
    padding-block-end: 16px;
    margin-block-end: 0;
  }

  .home-products:is([data-product-count="1"], [data-product-count="2"], [data-product-count="3"]) .home-products__header {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .home-products:is([data-product-count="1"], [data-product-count="2"], [data-product-count="3"]) .home-products__track {
    width: calc(var(--sparse-count) * var(--sparse-card-width) + (var(--sparse-count) - 1) * var(--rail-gap) + 4px);
    max-width: 100%;
  }

  .home-products:is([data-product-count="1"], [data-product-count="2"], [data-product-count="3"]) .home-products__item {
    flex-basis: var(--sparse-card-width);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-product {
    transition: none;
  }
}
/* Final minimal "View all" */
.home-products__header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.home-products__actions {
  justify-self: start;
  margin-top: 2px;
}

.home-products__all {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  min-height: auto;
  padding: 0;

  border: 0;
  border-radius: 0;
  background: transparent;

  color: #994099;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;

  text-decoration: none;
  white-space: nowrap;
}

.home-products__all::after {
  content: "←";
  font-size: 12px;
  opacity: .75;
}

@media (hover: hover) and (pointer: fine) {
  .home-products__all:hover {
    background: transparent;
    border: 0;
    color: #773177;
    text-decoration: none;
  }
}

@media (max-width: 599px) {
  .home-products__all {
    font-size: 11.5px;
  }

  .home-products__all::after {
    font-size: 11px;
  }
}