/*#############################################################################
# CARDS
#############################################################################*/

$card-padding: 30px;

.card {
  background-color: #fff;
  border: 1px solid #E9EAEA;
  margin: 0 0 30px 0;
  @include box-shadow(-10px 10px 20px 0 rgba(black, 0.05));
  // @extend %transition-all;

  .card-header {
    padding: $card-padding $card-padding 0;
    // @extend %transition-all;
    @include pie-clearfix;

    .card-title {
      margin: 0;
      @include float(left);

      &.small {
        font-size: 1.1rem
      }
    }

    .card-icon {
      @include float(right);
    }

    .header-baseline {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
    }
  }

  .card-body {
    padding: $card-padding;
    // @extend %transition-all;

    > :last-child {
      margin-bottom: 0;
    }

    &.small {
      font-size: 12.8px;
    }
  }

  // CREDIT OPTION CARD
  &.credit-option {
    cursor: pointer;
    border: none;
    overflow: hidden;
    position: relative;
    @include border-radius(4px);

    .card-body {
      padding: 20px 30px;

      h5 {
        font-size: rem-calc(14px);
        margin: 0;
      }

      h6.credit-option-amount {
        font-size: rem-calc(26px);
        margin: 0;
      }

      p.option-info-line {
        color: $color-secondary;
        font-size: rem-calc(14px);
        margin: 0;

        span {
          display: inline-block;
          padding-right: 12px;
          margin-right: 3px;
          position: relative;

          &::after {
            content: "";
            display: block;
            background-color: $color-secondary-light;
            width: 5px;
            height: 5px;
            position: absolute;
            top: 50%;
            right: 0;
            @include border-radius(100%);
            @include transform(translateY(-50%));
          }

          &:last-child {
            padding: 0;
            margin: 0;

            &::after {
              display: none;
            }
          }
        }
      }
    }

    &::before {
      content: "";
      display: block;
      background-color: $color-secondary-light;
      height: 100%;
      width: 7px;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      // @extend %transition-all;
    }

    // HOVER STATE
    &:hover {
      @include box-shadow(-10px 10px 20px 0 rgba(black, 0.1));

      &::before {
        background-color: $color-secondary;
      }
    }

    // SELECTED STATE
    &.selected {
      width: 370px;
      @include border-right-radius(0);
      @include box-shadow(-20px 10px 20px 0 rgba(black, 0.15));

      .card-body {
        padding-right: $card-padding * 2;
      }

      &::before {
        background-color: $color-primary;
      }

      // HOVER STATE
      &:hover {
        @include box-shadow(-20px 10px 20px 0 rgba(black, 0.2));

        &::before {
          background-color: $color-primary-dark;
        }
      }
    }
  }
}

.detail-section-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e3e8ee;
  padding: 1.75rem;
  box-shadow: rgb(0 55 112 / 4%) 0 2px 4px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;

  &:hover {
    box-shadow: rgb(0 55 112 / 6%) 0 4px 12px;
  }

  .detail-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d253d;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .detail-section-content {
    display: flex;
    flex-direction: column;
    flex: 1;

    &.payment-projection {
      justify-content: space-between;
    }

    .projection-desc {
      font-size: 0.9rem;
      color: #64748d;
      margin: 0 0 0.5rem;
    }

    .payment-preview {
      margin-bottom: 0.75rem;

      .payment-amount {
        font-size: 1.5rem;
        font-weight: 800;
        color: #0d253d;
      }
    }

    .btn-payment-plan {
      width: fit-content;
      font-size: 0.8rem;
      padding: 0.45rem 1rem;
      border-radius: 9999px;
      color: $color-primary !important;
      border: 1px solid $color-primary;
      background: transparent;
      margin-top: auto;

      &:hover {
        background-color: rgba($color-primary, 0.05);
      }
    }
  }

  .detail-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    li {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.9rem;
      border-bottom: 1px solid #f1f5f9;
      padding-bottom: 0.5rem;

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

      .bullet-label { color: #64748d; font-weight: 500; }
      .bullet-value { color: #0d253d; font-weight: 700; }
    }
  }
}

.app-hero-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e3e8ee;
  padding: 2rem;
  box-shadow: rgb(0 55 112 / 8%) 0 2px 4px;
  margin-bottom: 2rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  &:hover {
    box-shadow: rgb(0 55 112 / 8%) 0 8px 24px;
    border-color: rgba($color-primary, 0.2);
  }

  .hero-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e3e8ee;

    .hero-card-title {
      font-size: 0.85rem;
      font-weight: 700;
      color: #0d253d;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
  }

  .hero-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.5rem;
    align-items: center;

    .hero-col {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;

      h3 {
        font-size: 1.25rem;
        font-weight: 700;
        color: #0d253d;
        margin: 0;
      }

      p {
        font-size: 0.95rem;
        color: #0d253d;
        margin: 0;
      }

      .column-label {
        font-size: 0.7rem;
        color: #64748d;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
      }
    }
  }

  .hero-actions-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;

    .input-group.guarantee-check {
      width: auto;
      display: flex;
      justify-content: flex-start;
      margin: 0;
    }

    .action-buttons-wrapper {
      display: flex;
      gap: 0.75rem;
      align-items: center;
      justify-content: flex-end;
      margin-left: auto;
    }

    .error-tooltip {
      position: absolute;
      top: -2.25rem;
      right: 0;
      font-size: 0.78rem;
      color: #dc3545;
      font-weight: 500;
      white-space: nowrap;
      background: #fff;
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
      border: 1px solid #dc3545;

      &::after {
        content: "";
        position: absolute;
        bottom: -4px;
        right: 1.5rem;
        width: 8px;
        height: 8px;
        background: #fff;
        border-right: 1px solid #dc3545;
        border-bottom: 1px solid #dc3545;
        transform: rotate(45deg);
      }
    }
  }

  @include responsive-max($breakpoint-large) {
    padding: 1.25rem;

    .hero-card-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
    }

    .hero-details {
      grid-template-columns: 1fr;
      gap: 1.25rem;

      .hero-col {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;

        h3 {
          text-align: right;
        }
      }
    }

    .hero-actions-section {
      flex-direction: column;
      align-items: flex-start;
      gap: 1.5rem;

      .input-group.guarantee-check {
        width: 100%;
      }

      .action-buttons-wrapper {
        flex-direction: column-reverse;
        width: 100%;

        .button {
          width: 100%;
          text-align: center;
          margin: 0;
        }
      }
    }
  }
}
