@layer component {
  theme-carousel {
    position: relative;
    display: block;
  }

  theme-carousel .carousel__track {
    position: relative;
    display: flex;
    flex-wrap: inherit;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
  }

  theme-carousel .carousel__track::-webkit-scrollbar {
    display: none;
  }

  theme-carousel .carousel__track>* {
    flex-shrink: 0;
    list-style: none;
    scroll-snap-align: start;
  }

  theme-carousel .carousel__track-scroll-behavior--auto {
    scroll-behavior: auto;
  }

  theme-carousel .carousel__track-scroll-snap-type--none {
    scroll-snap-type: none;
  }

  theme-carousel[data-scroll-snap-align="center"] .carousel__track>* {
    scroll-snap-align: center;
  }

  theme-carousel[data-scroll-snap-align="end"] .carousel__track>* {
    scroll-snap-align: end;
  }

  theme-carousel[data-direction="vertical"] .carousel__track {
    flex-direction: column;
    overflow-x: unset;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
  }

  theme-carousel .slide__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    border-radius: var(--button-border-radius);
    gap: .5rem;
    margin: 10px auto;
    padding: .5rem;
    background: rgba(var(--color-secondary-background), .2);
  }

  theme-carousel .slide__dots .slide__dot {
    position: relative;
    width: .5rem;
    height: .5rem;
    border: 0;
    border-radius: var(--button-border-radius);
    background: rgba(var(--color-background), .2);
    cursor: pointer;
    transition: width 0.3s ease;
  }

  theme-carousel .slide__dots .slide__dot.is-active {
    background: rgba(var(--color-text), 1);
    width: 1.5rem;
  }

  theme-carousel .slide__nav {
    position: absolute;
    top: 50%;
    width: 100%;
    max-width: var(--page-width);
    padding: 0 var(--page-padding);
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: space-between;
    z-index: 10;
  }

  theme-carousel .slide__nav .slide__arrow {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(var(--color-background));
    border: 1px solid rgba(var(--color-text), 0.1);
    border-radius: var(--button-border-radius);
    color: rgb(var(--color-text)) !important;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  }

  theme-carousel .slide__nav .slide__arrow svg {
    width: 2rem;
    height: 2rem;
  }

  theme-carousel .slide__nav .slide__arrow:hover:not([disabled]) {
    background: rgb(var(--color-text));
    color: rgb(var(--color-background)) !important;
    border-color: rgb(var(--color-text));
  }

  theme-carousel .slide__nav .slide__arrow--prev {
    transform: rotate(180deg);
  }

  @media (min-width: 960px) {
    theme-carousel[data-desktop-direction="vertical"] .carousel__track {
      flex-direction: column;
      overflow-x: unset;
      overflow-y: auto;
      scroll-snap-type: y mandatory;
    }
  }

  @media (max-width: 959px) {
    theme-carousel[data-mobile-direction="vertical"] .carousel__track {
      flex-direction: column;
      overflow-x: unset;
      overflow-y: auto;
      scroll-snap-type: y mandatory;
    }

    theme-carousel .slide__nav .slide__arrow {
      width: 2.5rem;
      height: 2.5rem;
    }

    theme-carousel .slide__nav .slide__arrow svg {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
}