.shop-by-category-section {
  --sbc-accent: 45, 79, 53;
  --sbc-section-bg: 228, 235, 228;
  --sbc-card-bg: 245, 245, 245;
  --sbc-card-hover: 45, 79, 53;
  --sbc-muted: rgb(var(--color-text) / 0.55);
  --sbc-columns: 4;
  --sbc-gap: 20px;
  --sbc-progress-height: 3px;
  --sbc-progress: 0.2;

  overflow-x: clip;
  /* Override theme .page-section white background layer */
  background: rgb(var(--sbc-section-bg)) !important;
  background-color: rgb(var(--sbc-section-bg)) !important;
}

.shop-by-category-section.page-section::before {
  background: rgb(var(--sbc-section-bg)) !important;
  background-color: rgb(var(--sbc-section-bg)) !important;
}

.shop-by-category {
  --sbc-columns: inherit;
  --sbc-gap: inherit;
}

.shop-by-category__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.shop-by-category__header {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.shop-by-category__heading-group {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.shop-by-category__heading {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: rgb(var(--color-text));
  letter-spacing: -0.01em;
}

.shop-by-category__heading-accent {
  color: rgb(var(--sbc-accent));
}

.shop-by-category__subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--sbc-muted);
}

.shop-by-category__arrows.carousel-indicator__arrows {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 0;
  visibility: visible;
}

.shop-by-category__arrows .carousel-indicator__arrow {
  width: 44px;
  height: 44px;
  opacity: 1;
  border: 1px solid rgb(var(--color-text) / 0.35);
  border-radius: 50%;
  background: transparent;
  color: rgb(var(--color-text));
  box-shadow: none;
}

.shop-by-category__arrows .carousel-indicator__arrow:not([disabled]):hover {
  opacity: 1;
  border-color: rgb(var(--color-text));
  background: rgb(var(--color-text));
  color: #fff;
}

.shop-by-category__arrows .carousel-indicator__arrow[disabled] {
  opacity: 0.35;
  cursor: default;
}

.shop-by-category__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--sbc-gap) * (var(--sbc-columns) - 1))) / var(--sbc-columns));
  grid-template-columns: none;
  gap: var(--sbc-gap);
  width: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.shop-by-category__track::-webkit-scrollbar {
  display: none;
}

.shop-by-category__track > li {
  min-width: 0;
  scroll-snap-align: start;
}

.shop-by-category__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 24px 16px 28px;
  border-radius: 12px;
  background: rgb(var(--sbc-card-bg));
  color: rgb(var(--color-text));
  text-decoration: none;
  text-align: center;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.shop-by-category__card-media {
  width: 100%;
}

.shop-by-category__card-media .media {
  background: transparent !important;
}

/* Soften white studio photos on light grey cards only */
.shop-by-category__card-media :is(img, svg) {
  mix-blend-mode: multiply;
  transition: transform 0.35s ease, mix-blend-mode 0.2s ease;
}

.shop-by-category__card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}

/* Progress bar — mobile only */
.shop-by-category__progress {
  display: none;
  position: relative;
  width: 100%;
  height: var(--sbc-progress-height);
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  background: transparent;
}

.shop-by-category__progress-track,
.shop-by-category__progress-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  display: block;
  border-radius: inherit;
}

.shop-by-category__progress-track {
  inset-inline-end: 0;
  background-color: rgb(var(--color-text) / 0.18);
}

.shop-by-category__progress-bar {
  width: calc(var(--sbc-progress, 0.2) * 100%);
  max-width: 100%;
  background-color: rgb(var(--sbc-accent));
  transition: width 0.2s ease-out;
}

@media (pointer: fine) {
  .shop-by-category__card:hover {
    background: rgb(var(--sbc-card-hover));
    color: #fff;
  }

  /* Multiply on green darkens the whole photo — use normal on hover.
     Best match to Figma: upload transparent PNG cutouts in the category block. */
  .shop-by-category__card:hover .shop-by-category__card-media :is(img, svg) {
    mix-blend-mode: normal;
    transform: scale(1.04);
  }
}

@media (max-width: 1199px) {
  .shop-by-category__track {
    --sbc-columns: 3;
  }
}

@media (max-width: 959px) {
  .shop-by-category-section {
    --sbc-gap: 12px;
  }

  /* Design: show ~1.2 cards with next card peeking (override inline columns) */
  .shop-by-category__track {
    --sbc-columns: 1.4;
  }

  .shop-by-category__inner {
    gap: 24px;
  }

  /* Mobile design: title → subtitle → arrows (own row, right-aligned) */
  .shop-by-category__header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .shop-by-category__heading-group {
    flex: none;
    width: 100%;
  }

  .shop-by-category__arrows.carousel-indicator__arrows {
    align-self: flex-end;
  }

  .shop-by-category__card {
    padding: 16px 12px 20px;
    gap: 12px;
  }

  .shop-by-category__card-title {
    font-size: 0.875rem;
  }

  .shop-by-category__arrows .carousel-indicator__arrow {
    width: 40px;
    height: 40px;
  }

  .shop-by-category__progress {
    display: block;
  }
}

@media (max-width: 549px) {
  .shop-by-category__heading {
    font-size: 1.5rem;
  }

  .shop-by-category__subtitle {
    font-size: 0.875rem;
  }
}
