@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";

///////////////////////////////
// Footer Accordion
///////////////////////////////

.c-footer-wrapper {
  background-color: $color-grey-700;
}

.c-footer-wrapper__inner {
  margin: 0 auto;
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 2px 0;
}

.c-footer-accordion {
  background-color: $color-grey-500;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-direction: column;

  ///////////////////////////////////////////////////
  // accordion buttons
  ///////////////////////////////////////////////////
  .c-control-accordion--footer {
    display: inline-block;
    width: 100%;
  }

  .c-footer-accordion-button {
    cursor: pointer;
    display: flex;
    background-color: $color-grey-700;
    border: none;
    width: 100%;
    align-items: center;
    padding: 0 10px;

    &:hover,
    &:focus {
      z-index: $z-index-focused-button;
      background-color: $color-grey-800;
    }
  }
}

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

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

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

.c-footer-accordion__item__container {
  @include font-gm-sans-bold;
  cursor: pointer;
  display: flex;
  font-size: rem(12);
  height: rem(43);
  margin: 0;
  padding: 0;
}

.c-footer-accordion__item {
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid $color-grey-500;

  &:last-child {
    border-bottom: none;
  }
}

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

.c-footer-accordion__link {
  color: $color-white;
  line-height: rem(44);
  letter-spacing: rem(0.4);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  flex: 1;
  margin: auto;
  padding: 0 0 0 rem(10);

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

  &:hover {
    text-decoration: underline;
  }

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

  &:active {
    &.c-footer-accordion__link {
      text-decoration: underline;
      color: $color-grey-600;
    }
  }

  @include mq($from: mobile) {
    &:hover {
      &.c-footer-accordion__link {
        text-decoration: underline;
        background-color: $color-grey-500;
      }
    }
    &:active {
      &.c-footer-accordion__link {
        text-decoration: underline;
        background-color: $color-grey-800;
      }
    }
  }

  .c-footer-accordion--level-2 &  {
    background-color: $color-grey-600;
    @include font-gm-sans;
    text-transform: none;
    color: $color-white;
    padding: 0 0 0 rem(20);
  }
}

.c-footer-accordion__title {
  color: $color-white;
  line-height: rem(44);
  letter-spacing: rem(0.4);
  text-transform: uppercase;
  text-decoration: none;
  pointer-events: none;
  flex: 1;
  font-size: rem(12);
  text-align: left;
  margin: 0;
  padding: 0;

  &:hover, &:focus {
    text-decoration: none;
  }

  &.c-footer-accordion__title--column {
    font-size: rem(12);
    letter-spacing: rem(1);
    padding-left: 0;
  }
}

.c-footer-accordion__link {
  font-size: rem(14);
}

@include mq($from: tablet) {
  .c-footer-accordion {
    max-width: $break-tablet;
    margin: 0 auto;
  }
  .c-footer-accordion__link {
    font-size: rem(14);
  }
}

@include mq($from: desktop) {
  .c-footer-accordion {
    max-width: $break-desktop;
    margin: 0 auto;
  }
}

///////////////////////////////
// Footer column - for desktop/tablet wide
///////////////////////////////

.c-footer-wrapper--column {
  display: inline-flex;
  width: 100%;
}

.c-footer-column-heading__item {
  @include font-gm-sans-bold;
  list-style: none;
  flex: 1;
  margin: rem(25) 0 rem(50) 0;
}

.c-footer-column__item {
  list-style: none;
  color: $color-white;
  border-top: 1px solid $color-grey-500;
  &:last-child {
    border-bottom: 1px solid $color-grey-500;
  }
}

.c-footer-column-level-2 {
  @include font-gm-sans;
  padding: 0 rem(20) 0 0;
}

.c-footer-accordion__link {
  &.c-footer-accordion__link--column {
    text-transform: none;
    padding: rem(15) 0;
    line-height: line-height(14, 16);
    display: block;
  }
  &:hover {
    &.c-footer-accordion__link--column {
      background-color: $color-grey-700;
      text-decoration: underline;
    }
  }
  &:active {
    &.c-footer-accordion__link--column {
      text-decoration: underline;
      color: $color-grey-500;
    }
  }
}

.c-footer-column {
  display: flex;
  flex-wrap: wrap;
  flex: 100%;
  @include mq($from: tabletWide) {
    max-width: $break-tablet-wide;
  }
  @include mq($from: desktop) {
    max-width: $break-desktop;
  }
  @include mq($from: desktopWide) {
    max-width: $break-desktop-wide;
  }
  margin: 0 auto;
}
