@use "sass:math";

@import '~styles/config';

.claimListItem {
  @include grid-col();

  margin-bottom: $gutter*2;

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

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

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

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

  &.selected &__background,
  &:not(.disabled):hover &__background,
  &:not(.disabled):focus &__background {
    box-shadow: inset 0 0 0 4px;
  }

  &:hover &__background {
    cursor: pointer;
  }

  &__inner {
    position: relative;

    z-index: 4;
    height: 100%;

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

    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);
      }
    }
  }

  &__background {
    display: flex;
    align-content: space-between;
    flex-wrap: wrap;

    position: relative;

    z-index: 5;
    height: 100%;

    background-color: #fff;

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

    @include colorify('color');

    .disabled & {
      background-color: $color-grey100;
    }
  }

  &__head {
    padding: $gutter $gutter 0;
    width: 100%;
  }

  &__bottom {
    padding: 0 $gutter 20px;
    width: 100%;
  }

  &__info {
    margin-bottom: math.div($gutter, 2);
    color: $font-color;
    display: flex;
  }

  &__extraCharge {
    @include responsive-font(12, 14);
    position: relative;

    line-height: 17px;
    color: $font-color;

    @media (max-width: $max-tablet) {
      display: none;
    }

    &.warning {
      color: $color-yellow;

      .disabled & {
        color: $color-grey400;
      }
    }
  }

  &__extraBreakdown {
    display: flex;
    flex-direction: column;
  }

  &__extraHeaderButton {
    @include reset-button;
    margin-bottom: 10px;
    border-bottom: 1px solid $color-grey500;
    
    cursor: pointer;

    &:hover,
    &:focus {
      @include colorify('color');
      @include colorify('border-color');
    }
  }

  &__extraLine {
    display: flex;
    justify-content: space-between;

    font-size: 12px;
    color: $color-grey500;

    &.total {
      padding-top: 10px;
      margin-top: 10px;
      border-top: 1px solid $color-grey100;
      font-weight: 700;
      color: $font-color;

      @media (max-width: $max-tablet) {
        display: none;
      }
    }

    &.original {
      @media (min-width: $min-tablet) {
        display: none;
      }
    }
  }

  &__extraLabel {
    text-transform: capitalize;
  }

  &__extraChargeMobile {
    margin-bottom: 10px;
    @media (min-width: $min-tablet) {
      display: none;
    }
  }

  &__invoices {
    margin-bottom: 10px;
  }

  &__button {
    @include reset-button;
    @include responsive-font(16, 18);

    margin: $gutter (-$gutter) (-$gutter);

    width: calc(100% + #{$gutter}*2);
    height: $gutter*3;

    cursor: pointer;

    font-weight: 700;
    color: $color-white;

    @include colorify('background');

    &.disabled {
      pointer-events: none;

      background-color: #aaa;
    }
  }

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

    position: absolute;
    top: 35px;
    right: 10px;

    width: 40px;
    height: 40px;
    cursor: pointer;
  }
}


/*

&__invoices {
    margin-bottom: 10px;
    font-size: 14px;
    color: $font-color;
  }

  &__invoice {
    display: flex;
    justify-content: space-between;

    position: relative;
  }

  &__month {
    position: relative;
  }

  &__invoiceIcon {
    position: absolute;
    right: -15px;
    top: 5px;

    height: 12px;
    width: 10px;
    fill: $font-color;
  }



*/
