.carousel {
  position: relative;

  .items {
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    align-items: center;
    height: 100%;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }

    & > * {
      scroll-snap-align: start;
      flex: 1 0 100%;
      // Fixes an issue on Firefox and Safari where the initial scroll position is
      // determined by the first child with a non-zero width.
      min-height: 1px;
    }
  }

  .arrow {
    padding: spacer(3);
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    z-index: z-index(overlay);

    &::before {
      content: "";
      padding: spacer(4);
      border: $border;
      background: full-color(filled);
      border-radius: border-radius(3);
    }
    &::after {
      content: "";
      @extend %icon;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }

    &.previous {
      left: 0;
      &::after {
        @extend .icon-arrow-left;
      }
    }

    &.next {
      right: 0;
      &::after {
        @extend .icon-arrow-right;
      }
    }
  }

  &:hover .arrow {
    display: flex;
  }

  [role="tablist"] {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: spacer(2);
    padding: spacer(3);
    flex-wrap: wrap;

    & > [role="tab"] {
      display: block;
      border: $border;
      padding: spacer(2);
      border-radius: border-radius(3);
      background: full-color(filled);
      &[aria-selected="true"] {
        background: currentColor;
      }
    }
  }

  [role="tabpanel"] {
    display: flex;
    justify-content: center;
    padding: unset;
    margin-top: unset;
  }
}
