$mc-carousel-centered-padding: 100px !default;
$scrollbar-max-width: 17px !default;

.mc-carousel {
  &--dots {
    padding-bottom: $grid-gutter-width;
  }

  &__slider {
    position: relative;
    pointer-events: auto;
    z-index: 0;
    transition: z-index 0ms 1s;

    // Make sure that when you hover on a carousel
    // row, the hover effects are z-indexed correctly
    // (they have to be set higher here to work)
    &:hover {
      z-index: 1;
      transition: z-index 0ms 0ms;
    }
  }

  &__container {
    margin: -999px calc(50% - 50vw + #{$scrollbar-max-width / 2});
    padding: 999px calc(50vw - 50% - #{$scrollbar-max-width / 2});
    overflow: hidden;
    pointer-events: none;
  }

  &__inner-container {
    position: relative;
  }

  // The padding hack above that allows us to have
  // overflowing content on hover in tiles
  // without affecting the flow of the document
  // causes issues when carousels are stacked on
  // one another.
  // Ask @jones and @stephen how they figufed this out.
  &__forced-spacing {
    height: 1px;
    margin-bottom: -1px;
  }

  .slick-list {
    overflow: hidden;
    transition: height 250ms ease;
  }

  .slick-slide {
    transition: opacity 250ms ease;
  }

  .slick-track {
    margin: 0;
  }

  .slick-dots {
    position: absolute;
    left: 50%;
    bottom: -$grid-gutter-width;
    transform: translateX(-50%);

    li {
      display: inline-block;
      margin: 0 3px;
    }

    button {
      width: 4px;
      height: 4px;
      background: var(--mc-theme-carousel-dot);
      border-radius: 4px;
      outline: 0;
      transition: background 250ms ease, width 500ms ease;
    }

    .slick-active {
      button {
        background: var(--mc-theme-carousel-dot-active);
        width: 16px;
      }
    }
  }

  &__arrow {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3em;
    height: 3em;
    border-radius: 3em;
    background: $mc-color-gray-200;
    color: $mc-color-gray-500;
    text-align: center;
    z-index: 1000;
    cursor: pointer;
    pointer-events: auto;
    transition:
      background 200ms ease,
      color 200ms ease,
      opacity 200ms ease;


    &:not(.slick-disabled):hover {
      background: $mc-color-gray-300;
      color: $mc-color-light;

      .mc-carousel__arrow-text {
        opacity: 1;
      }
    }

    &--prev {
      left: 0;
      transform: translate(-50%, -50%);
    }

    &--next {
      right: 0;
      transform: translate(50%, -50%);
    }

    // Disabled state for when you can't
    // advance the slide or "go back" anymore
    &.slick-disabled {
      opacity: 0;
      pointer-events: none;
    }
  }

  [tabindex]:focus {
    outline: none;
  }
}
