@use '../../base/token';
@use '../../abstract';

.cds-notification {
  $this: &;

  &.floating {
    @include abstract.absolute();
    padding: 22px 18px;
    width: clamp(343px, 100%, 430px);
    background-color: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    color: var(--gray-400);
    font-size: 16px;

    #{$this}__ico {
      margin-block-end: 16px;
    }

    #{$this}__title {
      margin-block-end: 4px;
      color: var(--gray-600);
      font-weight: abstract.font-weight-to-number(token.$font-weights-commerce-sans-2);
    }

    #{$this}__desc {
      white-space: pre-wrap;
    }

    #{$this}__close {
      @include abstract.absolute($top: 8px, $right: 8px);

      padding: 0;
      width: 44px !important;
      height: 44px;

      svg {
        width: 24px;
        height: 24px;
      }
    }
  }

  &.full {
    &.neutral {
      background: var(--secondary-gray-blue-50);
      border-bottom: 1px solid var(--secondary-gray-blue-300);
      color: var(--secondary-gray-blue-600);
    }
    &.error {
      background: var(--primary-red-50);
      border-bottom: 1px solid var(--primary-red-300);
      color: var(--primary-red-600);
    }
    &.warning {
      background: var(--orange-50);
      border-bottom: 1px solid var(--orange-300);
      color: var(--orange-600);

    }
    &.success {
      background: var(--green-50);
      border-bottom: 1px solid var(--green-300);
      color: var(--green-600);
    }

    #{$this}__content-wrap {
      position: relative;
      display: flex;
      align-items: center;
      max-width: 1280px;
      width: 100%;
      margin: 0 auto;
      padding: 12px 32px;
    }

    #{$this}__content {
      flex: auto;
      display: inline-block;
    }

    #{$this}__ico {
      margin-inline-end: 16px;
    }

    #{$this}__title {
      margin-block-end: 6px;
      font-weight: abstract.font-weight-to-number(token.$font-weights-commerce-sans-2);
    }

    #{$this}__desc {
      display: inline-block;
      font-weight: 400;
      margin-left: 6px;

      a {
        text-decoration: underline;
      }
    }

    #{$this}__children {
      float: right;
      > * {
        margin-inline-end: 12px;

        &:last-child {
          margin-inline-end: 8px;
        }
      }
    }
  }

  @include abstract.media-bp-up('md') {
    &.floating {
      padding: 16px;
      min-height: 118px;
      font-size: 12px;
    }

    &__ico {
      width: 36px;
      height: 36px;
    }

    &__close.only-icon {
      padding: 8px;
      width: 36px;
      height: 36px;
    }
  }
}
