// @import '../_utils.scss';
// @import './icon.scss';

.#{$carousel-prefix-cls} {
  position: relative;
  display: block;
  box-sizing: border-box;
  user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  &-track,
  &-list {
    transform: translate3d(0, 0, 0);
  }

  &-list {
    position: relative;
    display: block;
    overflow: hidden;
    margin: $carousel-list-margin;
    padding: $carousel-list-padding;
  }

  &-track {
    position: relative;
    top: $carousel-track-top;
    left: $carousel-track-left;
    display: block;
    overflow: hidden;
    z-index: 1;
  }

  &-item {
    float: left;
    height: 100%;
    min-height: 1px;
    display: block;
  }

  &-arrow {
    border: none;
    outline: none;
    padding: 0;
    margin: 0;
    width: $carousel-arrow-width;
    height: $carousel-arrow-height;
    border-radius: $carousel-arrow-border-radius;
    cursor: pointer;
    display: none;
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(-50%);
    transition: $transition-time;
    background-color: $carousel-arrow-background-color;
    @include theme-background-color($__carousel-arrow_background-color);
    color: $carousel-arrow-color;
    @include theme-color($__carousel-arrow_font-color);
    text-align: center;
    font-size: 1em;
    font-family: inherit;
    line-height: inherit;

    &:hover {
      background-color: $carousel-arrow-hover-background-color;
      @include theme-background-color($__carousel-arrow_hover_background-color);
    }

    & > * {
      vertical-align: baseline;
    }

    &.left {
      left: 16px;
    }

    &.right {
      right: 16px;
    }

    &-always {
      display: inherit;
    }

    &-hover {
      display: inherit;
      opacity: 0;
    }
  }

  &:hover &-arrow-hover {
    opacity: 1;
  }

  &-dots {

    $padding: 7px;
    z-index: 10;
    display: none;
    position: relative;
    list-style: none;
    text-align: center;
    padding: 0;
    width: 100%;
    height: 3px + $padding * 2;

    &-inside {
      display: block;
      position: absolute;
      bottom: 10px - $padding;
    }

    &-outside {
      display: block;
      margin-top: 10px - $padding;
    }

    li {
      position: relative;
      display: inline-block;
      vertical-align: top;
      text-align: center;
      margin: $carousel-dots-li-margin;
      padding: $padding 0;
      cursor: pointer;

      button {
        border: 0;
        cursor: pointer;
        background: $carousel-dots-button-background;
        @include theme-background-color($__carousel-dots_background-color);
        opacity: $carousel-dots-button-opacity;
        @include theme-opacity($__carousel-dots_opacity);
        display: block;
        width: $carousel-dots-button-width;
        height: $carousel-dots-button-height;
        border-radius: $carousel-dots-button-border-radius;
        outline: none;
        font-size: 0;
        color: transparent;
        transition: all 0.5s;
      }

      &:hover > button {
        opacity: 0.7;
        @include theme-opacity($__carousel-dots_opacity);
        @include theme-background-color($__carousel-dots_hover_background-color);
      }

      &.#{$carousel-prefix-cls}-active > button {
        opacity: 1;
        @include theme-opacity($__carousel-dots_opacity);
        width: 24px;
        @include theme-background-color($__carousel-dots_active_background-color);
      }
    }
  }
}
