/* Shared product carousel — home + journal pages */

.home-product-stack {
  background: #fff;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .home-section-head {
    padding: 0 40px;
    margin-bottom: 32px;
  }
}

.home-section-head h2 {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #000;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .home-section-head h2 {
    font-size: 22px;
  }
}

.home-section-head a {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  background: #000;
  color: #fff;
  padding: 10px 18px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: background 200ms ease;
}

.home-section-head a:hover {
  background: #222;
}

@media (min-width: 768px) {
  .home-section-head a {
    font-size: 12px;
    padding: 10px 22px;
  }
}

.home-product-section {
  max-width: 1410px;
  margin: 0 auto;
  padding: 40px 12px 56px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .home-product-section {
    padding: 56px 15px 72px;
  }
}

.journal-product-section {
  max-width: 1600px;
  padding-top: 0;
  padding-bottom: 48px;
}

.journal .journal-product-section {
  padding-left: 0;
  padding-right: 0;
}

.home-product-carousel {
  position: relative;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .home-product-carousel {
    padding: 0 40px;
  }
}

.home-product-carousel__viewport {
  overflow: hidden;
}

@media (max-width: 767px) {
  .home-product-carousel {
    padding: 0 0 0 16px;
  }

  .home-product-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .home-product-carousel__viewport::-webkit-scrollbar {
    display: none;
  }

  .home-product-carousel__track {
    transition: none;
    will-change: auto;
  }

  .home-product-carousel__slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .home-product-carousel__slide:last-child {
    margin-right: 16px;
  }

  .home-product-carousel__arrow {
    display: none;
  }
}

.home-product-carousel__track {
  display: flex;
  gap: 32px;
  transition: transform 300ms ease;
  will-change: transform;
}

.home-product-carousel__slide {
  flex: 0 0 calc((100% - 32px) / 2);
  min-width: 0;
}

@media (min-width: 768px) {
  .home-product-carousel__slide {
    flex: 0 0 calc((100% - 64px) / 3);
  }
}

@media (min-width: 1024px) {
  .home-product-carousel__slide {
    flex: 0 0 calc((100% - 128px) / 5);
  }
}

.home-product-carousel__arrow {
  position: absolute;
  top: 38%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #000;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease, border-color 200ms ease;
}

.home-product-carousel:hover .home-product-carousel__arrow:not(:disabled),
.home-product-carousel:focus-within .home-product-carousel__arrow:not(:disabled) {
  opacity: 1;
}

.home-product-carousel__arrow:hover:not(:disabled) {
  border-color: #000;
}

.home-product-carousel__arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.home-product-carousel__arrow--prev {
  left: 0;
}

.home-product-carousel__arrow--next {
  right: 0;
}

@media (min-width: 768px) {
  .home-product-carousel__arrow--prev {
    left: 8px;
  }

  .home-product-carousel__arrow--next {
    right: 8px;
  }
}

.home-product-carousel__arrow svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.article-product-carousel .home-product-carousel__slide {
  flex: 0 0 calc((100% - 32px) / 2);
}

@media (min-width: 768px) {
  .article-product-carousel .home-product-carousel__slide {
    flex: 0 0 calc((100% - 96px) / 4);
  }
}

@media (min-width: 1024px) {
  .article-product-carousel .home-product-carousel__slide {
    flex: 0 0 calc((100% - 160px) / 6);
  }
}
