@use "sass:math";

@import '~styles/config';

.buttonBox {
  margin-bottom: $gutter *2;

  width: 100%;

  &__button:hover &,
  &__button:focus & {
    &__buttonText,
    &__buttonSubtext {
      color: $color-white;
      transition: color 160ms ease-in-out;
    }
  }

  &__container {
    position: relative;
    z-index: 4;

    &::after {
      content: '';

      position: absolute;
      top: 40px;
      right: -$gutter * 0.5;
      bottom: -20px;
      left: $gutter * 0.5;
      z-index: 1;

      width: 100%;

      pointer-events: none;

      opacity: 0.2;
      background: url('/assets/black-dot-opaque.svg') repeat;
      background-size: 10px;
    }
  }

  &__shadow {
    position: relative;
    z-index: 2;

    border-width: 1px;
    border-style: solid;
    border-color: $color-grey100;

    &::after {
      content: '';

      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 1;

      height: 60px;

      box-shadow: 0 3px 65px 0 rgba(32, 32, 32, 0.125);

      @media (min-width: $min-tablet) {
        box-shadow: 0 5px 65px 0 rgba(32, 32, 32, 0.125);
      }
    }
  }

  &__wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 5;

    background-color: $color-white;

    .selectedBorder & {
      @include box-shadow-colors;
    }
  }

  &__content {
    padding: $gutter;
    padding-bottom: $gutter * 2;

    &.button {
      padding: ($gutter*0.5) $gutter;

      .buttonTextSmaller & {
        padding: $gutter;
      }
    }
  }

  &__icon {
    height: 40px;

    svg { // stylelint-disable-line
      height: 40px;
    }
  }

  &__title {
    @include responsive-font(28, 32);
    @include colorify('color');

    z-index: 5;

    font-family: $font-heading;
    font-weight: 700;
    line-height: math.div(32, 32);
    color: $color-dark;

    transition: color 120ms ease-in;
    hyphens: auto;
  }

  &__subtitle {
    z-index: 5;

    margin-top: $gutter * 0.65;

    font-size: 14px;
    font-family: $font-heading;
    font-weight: 500;
    color: $color-dark;
  }

  &__button {
    @include reset-button;
    margin-top: $gutter*0.5;

    width: 100%;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: $color-grey100;

    cursor: pointer;

    transition: background-color 160ms ease-in-out;

    .selectedBorder & {
      margin: $gutter*0.5 4px 0;
      width: calc(100% - 8px);
    }

    .selected & {
      @include colorify('background-color');
    }

    &:hover {
      @include colorify('background-color');

      border-top-color: rgba($color-grey100, 0.2);
    }
  }

  &__buttonText {
    @include responsive-font(20, 28);

    width: 100%;

    font-family: $font-heading;
    font-weight: 700;
    color: $color-dark;

    transition: color 160ms ease-in-out;

    .buttonTextSmaller & {
      font-size: 15px;
      text-align: center;
    }

    .selected & {
      color: $color-white;
    }

    .selectedBorder:not(:hover) & {
      @include colorify('color');
    }
  }

  &__buttonSubtext {
    font-size: 13px;
    font-family: $font-heading;
    color: $color-grey500;
    transition: color 160ms ease-in-out;

    .selected & {
      color: $color-white;
    }
  }

  &__edit {
    display: flex;
    justify-content: center;
    align-items: center;

    position: absolute;

    top: 23px;
    right: 10px;

    height: 40px;
    width: 40px;

    cursor: pointer;
  }
}
