@use "sass:math";

@import '~styles/config';

.profileBoxItem {
  margin-bottom: $gutter;
  height: 100%;

  &.inGrid {
    @include grid-col;
    @media (min-width: $min-tablet) {
      @include grid-col(percentage(math.div(6, 12)));
    }

    @media (min-width: $min-desktop) {
      @include grid-col(percentage(math.div(4, 12)));
    }
  }

  &__container {
    position: relative;
    height: 100%;

    &::after {
      content: '';

      position: absolute;
      top: 20px;
      right: -20px;
      bottom: -20px;
      left: 20px;

      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;
    height: 100%;

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

    &::after {
      content: '';

      z-index: -1;

      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;

      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-wrap: wrap;
    align-content: space-between;

    z-index: 1;
    position: relative;

    height: 100%;
    background-color: #fff;

    transition: box-shadow 220ms ease-in-out;
    box-shadow: inset 0 0 0 0 transparent;

    @include colorify('color');
  }

  &__topWrapper {
    @include grid-col;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    position: relative;
  }

  &__rateplan {
    &.withSummary {
      max-width: calc(100% - 70px);
    }
  }

  &__top {
    display: flex;
    flex-direction: column;
    position: relative;

    width: 100%;
    min-height: $gutter*2;
  }

  &__headtext {
    @include reset-button;
    @include colorify('background-color');

    display: block;
    padding: $gutter;

    width: 100%;

    cursor: pointer;
    text-align: left;
    color: #fff;

    &:hover,
    &:focus {
      @include buttons-hover();
      outline: none;
    }

    .isDisabled & {
      background-color: $color-grey400;
    }

    .isDisabled &:hover,
    .isDisabled &:focus {
      background-color: darken($color-grey400, 8%);
      outline: none;
    }
  }

  &__title {
    @include responsive-font(28, 32);
    margin-bottom: 15px;
    font-family: $font-heading;
    font-weight: 600;
    line-height: 1em;
  }

  &__info {
    @include grid-row;
    @include responsive-font(12, 14);
    font-family: $font-heading;
    font-weight: 500;
  }

  &__status {
    @include grid-col;
  }

  &__button {
    margin: 0 -1px -1px;

    width: calc(100% + 2px);
  }

  &__editMenu {
    position: absolute;
    top: $gutter;
    right: $gutter*0.5;
  }

  // *******************************
  // Styles for ProfileBoxItemLoading

  &.loading &__head {
    padding: 40px $gutter 35px;
    cursor: auto;
  }

  &.loading &__title {
    @include loadingText(28, 130);
  }

  &.loading &__rateplan {
    @include loadingText(15, 180);
    margin: 10px 0 0 $gutter*0.5;
  }
}
