@import '../helpers/helpers';

.pdp-price-container {
  position: relative;

  .pdp__badges-wrapper {
    &:has(.pdp__badges--static) {
      display: flex;
      flex-wrap: wrap;
      justify-content: end;
      gap: 8px;
      margin: -20px 0 10px;
      background: none;
    }

    .pdp__badges {
      &--static {
        position: static;
        width: fit-content;
        max-width: 100%;
        min-width: auto;
        margin-right: 0;
      }
    }
  }

  &__badges.pdp-price-container__badges {
    @include price-block-badge;

    @include media-breakpoint-down(sm) {
      margin-right: 15px;
    }
  }

  .pdp-price {
    padding: 20px;
    background: $gray-bg;

    &__klarna-payment {
      border: 1px solid $gray;
      margin-bottom: 8px;
    }

    &__billie-payment {
      margin-bottom: 8px;
    }

    &_bw {
      outline: 4px solid $warm-grey;
      border-left: 0;
    }

    &__excluding-delivery {
      @include font-size(12);
      @include line-height(16);
      font-weight: 400;
      display: block;
      margin-bottom: 8px;
    }

    @include media-breakpoint-down(md) {
      margin-bottom: 20px;
    }
  }

  .pdp-price__price,
  .pdp-price__terms,
  .pdp-price__description {
    font-weight: bold;
  }

  .pdp-price__price {
    font-size: 2.125rem;
    line-height: 2.25rem;
    padding: 8px 0;
    color: $blue-dark;
    padding-top: 0;
  }

  .pdp-price__description {
    font-size: 1.1428em;
    padding-bottom: $btn-padding-y;
    color: $red;

    p {
      margin-bottom: 0;
    }
  }

  .pdp-price__sqm {
    font-weight: 500;
    font-size: 1.1428em;
    padding-bottom: $btn-padding-y;
  }

  .pdp-price-sale__value {
    .pdp-price__sqm {
      color: $red;
    }
  }

  //sass-lint:disable no-mergeable-selectors

  .pdp-price__sqm {
    color: $blue-dark;
  }

  .pdp-price__remainder {
    padding-bottom: $btn-padding-y;
  }

  .pdp-price__terms {
    & a:hover {
      color: $gray-dark;
    }
  }

  .pdp-price__control-installation {
    & > .btn-secondary {
      &:focus {
        background-color: $white;
        border-color: $blue;
        color: $blue;
      }
    }
  }
}

.pdp--ripple {
  .pdp-price {
    &__message-wrapper {
      display: flex;
      flex-direction: column;
      row-gap: 8px;
      padding: 12px 0;
      margin: 16px 0;
      border-bottom: 1px solid $gray;
      border-top: 1px solid $gray;
    }

    &__delivery-message {
      font-weight: 500;
    }

    &__control-holder {
      padding-top: 16px;
    }
  }
}

@include media-breakpoint-up(md) {
  .pdp-price-container {
    .pdp__badges-wrapper {
      &:has(.pdp__badges--static) {
        margin-right: -20px;
        margin-left: -20px;
      }
    }
  }
}
