@import "settings.breakpoints";
@import "settings.colors";
@import "settings.vars";
@import "settings.z-index";

@import "mixins/settings.fonts";
@import "mixins/tools.mixins";

@import "mixins/components.controls";

///////////////////////////////////////////////////
// accordion rows
///////////////////////////////////////////////////
.c-accordion {
  padding: 0;
  margin: 0;
  list-style: none;
  flex-direction: column;

  ///////////////////////////////////////////////////
  // accordion buttons
  ///////////////////////////////////////////////////
  .c-control--accordion {
    @include c-control--accordion-default;
    @include c-control--accordion-top;
  }

  .c-accordion--level-2,
  .c-footer-accordion--level-2 {
    @include c-control--accordion-sub;
    @include c-control--accordion-sub-2;
  }

  .c-accordion--level-3 {
    @include c-control--accordion-sub;
    @include c-control--accordion-sub-3;
  }

  .c-accordion--level-4 {
    @include c-control--accordion-sub;
    @include c-control--accordion-sub-4;
  }
}

.c-accordion--level-2 {
  display: none;
}

.c-accordion--level-3 {
  display: none;
}

.c-accordion--level-4 {
  display: none;
}

.c-accordion__item--open {
  z-index: $z-index-focused-button;
  > .c-accordion__item__container {
    z-index: $z-index-focused-button + 1;
    .c-control--accordion {
      z-index: $z-index-focused-button + 2;
      .c-control__icon {
        transform: rotate(-180deg);
      }
    }
  }

  > .c-accordion--level-2, > .c-accordion--level-3 {
    display: flex;
  }

  > .c-accordion--level-3, > .c-accordion--level-4 {
    display: flex;
  }
}

.c-accordion__item {
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.c-accordion__item--empty {
  .c-control--accordion {
    display: none;
    visibility: hidden;
  }
}

.c-accordion__item__container {
  @include font-gm-sans-bold;
  background-color: $color-grey-700;
  cursor: pointer;
  display: flex;
  font-size: rem(12);
  height: rem(44);
  margin: 0 0 1px 0;
  padding: 0;

  .c-accordion--level-2 & {
    background-color: $color-grey-300;
  }

  .c-accordion--level-3 & {
    background-color: $color-grey-200;
  }

  .c-accordion--level-4 & {
    background-color: $color-grey-100;
  }
}

.c-accordion__item__link {
  color: $color-white;
  cursor: pointer;
  flex: 1;
  letter-spacing: rem(1);
  margin: 0 rem(20) 0 0;
  padding: 0 0 0 rem(10);
  text-transform: uppercase;
  height: 100%;
  line-height: rem(44);
  text-decoration: none;

  @include mobile-only {
    font-size: rem(12);
  }

  &:hover {
    text-decoration: underline;
  }

  &:hover, &:focus {
    z-index: $z-index-focused-button;
  }

  .c-accordion--level-2 & {
    background-color: $color-grey-300;
    color: $color-grey-900;
    padding: 0 0 0 rem(20);
  }

  .c-accordion--level-3 & {
    background-color: $color-grey-200;
    padding: 0 0 0 rem(30);
  }

  .c-accordion--level-4 & {
    background-color: $color-grey-100;
    padding: 0 0 0 rem(40);
  }
}
