@import '../helpers/mixins';

.footer {
  &-menu {
    border-bottom: 1px solid $gray-light;
    display: flex;
    padding: 30px 15px 40px;

    &__list {
      padding: 0;
      text-align: center;
    }

    &__heading {
      margin: 0 20px 20px;
      list-style-type: none;
      font-size: 1rem;
      font-weight: 500;
      letter-spacing: 0.15px;
    }

    &__item {
      margin: 0 20px;
      line-height: $line-height-base;
      list-style-type: none;
    }

    &__inner {
      @include make-col(10);
      @include make-col-ready;
      @include make-col-offset(1);
      padding: 0;
      display: flex;
      justify-content: space-between;
    }

    &__link {
      @include footer-link;
    }

    .accordion {
      border-bottom: 0;
      padding: 0;

      &__header,
      &__content {
        padding: 0;
        text-align: center;
      }

      &__content {
        display: block;
      }

      &__header {
        margin: 0 20px 20px;
        pointer-events: none;

        &-text {
          letter-spacing: .15px;
          color: $gray-dark;
        }

        &-icon {
          display: none;
        }
      }
    }
  }

  &__wrapper {
    @include make-container-max-widths;
    @include make-container;
    padding: 30px 0 0;
  }

  &-links {
    background: $footer-gray;
    padding: 30px 0;

    &__list {
      justify-content: space-between;
      display: flex;
      flex-flow: row;
      padding: 0;
      margin: 0;
    }

    &__item {
      padding-top: 5px;
      list-style: none;

      &:not(:last-child)::after {
        content: "\2022";
        color: $footer-bullet;
        font-weight: 700;
        display: inline-block;
        width: 1em;
        position: relative;
        left: 15px;
      }
    }

    &__link {
      @include footer-link;
    }
  }
}

.socials {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;

  &__list,
  &__young-minds {
    align-self: center;
  }

  &__young-minds {
    background: url("../img/young-minds-extended.png") no-repeat;
    width: 180px;
    height: 90px;
    background-size: contain;
  }

  &__list {
    @include clearfix;
    display: flex;
    font-size: 0;
    padding: 0;
    margin: 0;
  }

  &__item {
    display: inline-block;
    vertical-align: top;
    list-style-type: none;
    margin-left: 10px;
  }

  &__young-minds {
    margin: 20px 0;

    img {
      width: 180px;
    }
  }

  .icons {
    display: block;
    background: url("../img/sprite.png") no-repeat;
    background-size: 160px 150px;
    height: 30px;
    width: 30px;
    border-radius: 3px;
    text-indent: -9999px;

    &.instagram {
      background-position: 0 0;
    }

    &.facebook {
      background-position: -32px 0;
    }

    &.pinterest {
      background-position: -64px 0;
    }

    &.youtube {
      background-position: -96px 0;
    }

    &.twitter {
      background-position: -128px 0;
    }
  }

  .payments {
    left: 5px;

    .payments__item {
      margin-right: 10px;
      vertical-align: middle;

      &:last-child {
        margin-right: 0;
      }

      .payments__icons {
        display: block;
        background: url("../img/payments-sprite.png") no-repeat;
        border-radius: 3px;
        text-indent: -9999px;

        &.payments-maestro {
          background-position: -110px -49px;
          height: 33px;
          width: 36px;
          transform: translateY(3px);
        }

        &.payments-mastercard {
          background-position: -110px -9px;
          height: 28px;
          width: 36px;
        }

        &.payments-visa {
          background-position: -10px -54px;
          height: 22px;
          width: 68px;
        }

        &.payments-paypal {
          background-position: -10px -9px;
          height: 24px;
          width: 80px;
        }
      }
    }
  }
}

.copyright {
  background: $footer-gray;
  border-top: 1px solid $gray-light;
  width: 100%;
  text-align: center;
  font-size: .75rem;
  padding: 20px 0;
}

@include media-breakpoint-up(lg) {
  .footer {
    &-links {
      &__list {
        flex-wrap: wrap;
        justify-content: center;
      }

      &__item {
        padding: 0 10px;
      }
    }

    &-menu__inner {
      .accordion:not(:first-child) {
        position: relative;
        left: 20px;
      }

      .socials {
        position: relative;
        left: 20px;
      }
    }
  }

  .footer__wrapper {
    align-items: center;

    .footer {
      &-links {
        flex: 0 0 43%;
        max-width: 43%;
      }
    }

    .socials {
      flex: 0 0 25%;
      max-width: 25%;
    }

    .payments {
      flex: 0 0 32%;
      max-width: 32%;
    }
  }
}

@include media-breakpoint-up(md) {
  .footer-menu {
    &__inner {
      .accordion {
        &__content {
          display: block !important;
        }
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .footer {
    &-menu {
      &__inner {
        display: block;

        .accordion {
          width: 33%;
          float: left;
        }

        .socials {
          width: 100%;
        }
      }
    }

    &-links {
      .footer-links {
        &__item {
          &::after {
            left: 25px;
          }
        }
      }
    }
  }
}

@include media-breakpoint-down(md) {
  .footer {
    &-links {
      @include make-col(12);
      @include make-col-ready;
      text-align: center;
      padding-top: 15px;

      &__list {
        width: 80%;
        margin: 10px auto 0;
      }
    }
  }

  .socials {
    @include make-col(12);
    justify-content: center;
    padding-top: 25px;

    &__list {
      text-align: center;
    }

    &__item {
      margin-left: 20px;

      &:first-child {
        margin-left: 0;
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .sign-up {
    &__newsletter,
    &__link,
    &__email {
      display: none;

      &_mobile {
        display: block;
      }
    }
  }

  .footer {
    &-menu {
      padding: 0 0 40px;
      border-bottom: 0;

      &__inner {
        @include make-col(12);
        @include make-col-offset(0);
        display: block;
        flex-direction: column;
        margin-top: 30px;
      }

      &__wrap {
        @include make-col(12);
        @include make-container;
      }

      &__list {
        display: block;
        padding: 10px 0;
      }

      &__item {
        display: block;
        text-align: center;
        margin: 0 13px;
      }

      .accordion {
        padding: 10px 0;

        &__header {
          pointer-events: unset;
          margin-bottom: 0;
          text-align: left;
          position: relative;

          &::after {
            content: "+";
            font-weight: 700;
            display: inline-block;
            position: absolute;
            right: 0;
            color: $gray-dark;
          }
        }

        &__content {
          display: none;

          &-inner {
            padding: 20px 30px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            line-height: 1.875rem;
          }
        }
      }

      .accordion {
        border-top: 1px dashed;

        &:nth-last-child(2) {
          border-bottom: 1px dashed;
        }
      }
    }

    &__wrapper {
      padding-top: 20px;
    }

    &-links {
      margin-top: 5px;
      padding: 15px 40px 30px;

      &__list {
        display: block;
        width: 100%;
        text-align: center;

        .footer-links {
          &__item {
            padding-top: 15px;
            display: inline-block;

            &::after {
              left: 0;
            }

            &:nth-child(2)::after {
              content: none;
            }
          }
        }
      }
    }
  }

  .socials {
    justify-content: flex-start;

    &__list,
    &__young-minds {
      display: block;
      margin-bottom: 15px;
    }

    &__young-minds {
      margin-top: 0;
    }

    &__item {
      margin-left: 10px;
    }

    .payments {
      flex: 0;
    }
  }

  .copyright {
    font-size: .875rem;
    color: $footer-copyright;
  }
}
