/* Scoped to the homepage/category templates that load this stylesheet. */
.category-grid,
.product-band .product-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.category-grid::-webkit-scrollbar,
.product-band .product-row::-webkit-scrollbar {
  display: none;
}

.category-grid {
  grid-template-columns: none;
  gap: 12px;
}

.category-grid .category-card {
  flex: 0 0 calc((100% - 48px) / 5.2);
  width: auto;
  min-width: 0;
  scroll-snap-align: start;
}

.product-band .product-row {
  gap: 9px;
}

.product-band .product-row .product-card {
  flex: 0 0 calc((100% - 27px) / 4.5);
  width: auto;
  min-width: 0;
  max-width: none;
  scroll-snap-align: start;
}

.home-carousel-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.best-layout > .home-carousel-wrap--products {
  min-width: 0;
  direction: rtl;
}

.home-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  transform: translateY(-50%);
  margin: 0;
  opacity: 0.94;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.home-carousel-arrow--previous {
  right: 4px;
}

.home-carousel-arrow--next {
  left: 4px;
}

.home-carousel-wrap:dir(ltr) .home-carousel-arrow--previous {
  right: auto;
  left: 4px;
}

.home-carousel-wrap:dir(ltr) .home-carousel-arrow--next {
  left: auto;
  right: 4px;
}

.home-carousel-arrow:disabled {
  opacity: 0.32;
  cursor: default;
}

.home-carousel-arrow:focus-visible,
.category-grid:focus-visible,
.product-band .product-row:focus-visible {
  outline: 2px solid #ED2025;
  outline-offset: 2px;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .category-grid .category-card {
    flex-basis: calc((100% - 36px) / 4.2);
  }

  .product-band .product-row .product-card {
    flex-basis: calc((100% - 18px) / 3.2);
  }
}

@media (max-width: 760px) {
  .category-grid .category-card {
    flex-basis: calc((100% - 18px) / 3.15);
  }

  .product-band .product-row .product-card {
    flex-basis: calc((100vw - 61px) / 2.45);
    max-width: 200px;
  }

  .home-carousel-arrow {
    opacity: 0.88;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-grid,
  .product-band .product-row {
    scroll-behavior: auto;
  }
}
