.subscription-form {
  --size-height: 2rem;
  --size-width: 2rem;

  display: block;

  .loading__spinner {
    display: none;
  }

  .errorMessage {
    align-items: center;
    background: rgb(248, 215, 218);
    border: 1px solid rgb(241, 174, 181);
    border-radius: 0.5rem;
    color: rgb(88, 21, 28);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding: 1.6rem;
    position: relative;
  }

  &[processing] {
    opacity: 0.75;
    pointer-events: none;

    .product-form__atc-text {
      display: none;
    }

    .loading__spinner {
      display: block;
    }
  }

  .product-form__body {
    background: var(--background);
    margin-bottom: 2.4rem;

    display: flex;
    flex-direction: column;
    gap: 1.2rem;

    .product-form__product {
      background-color: #fff;
      border: 1px solid rgb(20 27 77 / 20%);
      border-radius: 1.2rem;
      order: 3;

      &:first-child {
        order: 1;
      }

      &:has(.product-form__product-input:checked) {
        border-color: rgb(20 27 77 / 100%);

        .product-form__check-icon::before {
          background-color: #141c4a;
        }
      }
    }

    .product-form__option-other__wrapper {
      display: none;
      order: 2;

      &:has(.product-form__product-input:checked) {
        border-color: rgb(20 27 77 / 100%);

        .product-form__check-icon::before {
          background-color: #141c4a;
        }
      }
    }

    .product-form__context-text,
    .product-form__option-other__wrapper .product-form__content {
      border-top: 1px solid rgb(12 12 13 / 20%);
      padding-top: 1.6rem;

      .product-form__context-text {
        border: none;
        padding: 0;
      }
    }

    .product-form__option-other__wrapper .product-form__content-context:not(:has(.product-form__context-active)) .product-form__context-text {
      display: none;

      &:first-child {
        display: block;
      }
    }

    .product-form__context-text {
      display: flex;
      flex-direction: column;
      gap: 0.8rem;
      line-height: 1.3;

      p {
        align-items: center;
        display: grid;
        gap: 1.4rem;
        grid-template-columns: auto 1fr;

        span span {
          background-color: #E7F0F9;
          border-radius: 0.5em;
          font-weight: 700;
          padding: 0.25em 0.75em 0.125em;
        }
      }

      .product-form__context-text__extra {
        border-top: 1px solid rgb(12 12 13 / 20%);
        margin-top: 1.2rem;
        padding-top: 1.6rem;

        .product-form__context-text__inner {
          background: var(--extra-bg, #e7f0f9);
          border-radius: .6em;
          font-size: var(--extra-size, 1.8rem);
          padding: 1.4rem 2rem 1.1rem 3rem;
          position: relative;
        }

        .product-form__context-text__inner::before {
          background: #141b4d;
          border-radius: .4rem;
          content: "";
          display: inline-block;
          left: 2rem;
          height: calc(100% - 0.9em);
          position: absolute;
          top: 50%;
          translate: -50% -50%;
          width: .4rem;
        }
      }
    }

    .product-form__product {
      align-items: center;
      display: flex;
      flex-wrap: wrap;
      gap: 1.5rem;
      justify-content: space-between;
      padding: 1.6rem;
      position: relative;

      .product-form__card-badge {
        background-color: #F5C49B;
        border-radius: 0.6rem;
        color: #141B4D;
        font-size: 1.4rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.5em 1em;
        position: absolute;
        right: 1.6rem;
        top: -1.2rem;
        white-space: nowrap;
        z-index: 1;

        &:empty {
          display: none;
        }
      }

      &:has(.product-form__product-input:focus-visible) {
        outline: -webkit-focus-ring-color auto 1px;
      }

      .product-form__product-input,
      .product-form__option-other__check {
        height: 100%;
        left: 0;
        opacity: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: -1;
      }

      .product-form__left {
        align-items: center;
        display: flex;
        gap: 2rem;

        &,
        & * {
          cursor: pointer;
        }

        .product-form__context {
          max-width: 300px;
          width: 100%;

          .product-form__context-title {
            font-size: var(--context-title, 2rem);
            font-style: normal;
            font-weight: 600;
            letter-spacing: normal;
            line-height: 1;
          }

          .product-form__context-text {
            font-style: normal;
            font-weight: 400;
            font-size: 1.2rem;
            letter-spacing: normal;
            line-height: 1.75;
            margin: 0;
          }
        }
      }

      .product-form__check-icon {
        align-items: center;
        background: transparent;
        border: 1px solid #141c4a;
        border-radius: var(--check-radius, 50%);
        display: flex;
        height: var(--size-height);
        justify-content: center;
        position: relative;
        transition: all 0.3s;
        width: var(--size-width);

        &::before {
          background-color: transparent;
          border-radius: var(--check-mark-radius, 50%);
          content: '';
          height: var(--size-mark-height, 70%);
          left: 50%;
          position: absolute;
          top: 50%;
          translate: -50% -50%;
          width: var(--size-mark-width, 70%);
        }

        svg {
          opacity: 0;
        }
      }

      .product-form__right {
        align-items: center;
        display: flex;
        gap: 1.5rem;
        text-align: right;

        &.savings-icon {
          display: none;
        }

        svg {
          margin-top: -0.25em;
        }

        .product-form__context-text__extra-text {
          text-decoration: underline;
        }

        .product-form__label {
          background: var(--BG);
          border-radius: 0.8rem;
          font-size: var(--form-label, 1.6rem);
          font-style: normal;
          font-weight: 400;
          letter-spacing: normal;
          line-height: 1.3125;
          margin-left: auto;
          padding: 0.8rem 1.2rem;
        }

        .product-form__price {
          color: #141b4d;
          display: flex;
          font-size: var(--form-price, 1.8rem);
          font-style: normal;
          font-weight: 400;
          gap: .75em;
          line-height: 0.95;
          margin-left: auto;

          s {
            opacity: .5;
          }
        }
      }

      .product-form__content {
        flex: 1 1 100%;
      }
    }

    &.product-form__show-image {
      --check-radius: .5rem;
      --size-height: calc(var(--size-width) * .75);
      --size-width: 5rem;
      --check-mark-radius: .5rem;
      --size-mark-height: calc(100% - .5rem);
      --size-mark-width: calc(100% - .5rem);

      .product-form__check-icon::before {
        background-image: var(--image);
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        border-radius: var(--check-radius);
      }
    }
  }

  .product-form__footer {
    display: flex;
    gap: 2rem;

    .product-form__atc-wrapper {
      flex: 1;

      .button--primary {
        background: var(--button);
        color: var(--button_label);
        cursor: pointer;
        font-family: 'MaisonNeue', serif;
        font-size: 2.4rem;
        font-style: normal;
        font-weight: 500;
        height: 100%;
        letter-spacing: normal;
        line-height: 1.3;
        padding: 0.5em 2em;
        width: 100%;
      }
    }
  }

  .product-form__content-selector {
    --context-title: 1.6rem;
    --form-label: 1.6rem;
    --form-price: 1.6rem;
    margin-bottom: 1.6rem;
    position: relative;

    .product-form__content-value {
      background: rgb(242 240 235 / 40%);
      border: 1px solid currentColor;
      border-radius: 0.8rem;
      align-items: center;
      color: inherit;
      cursor: pointer;
      display: grid;
      gap: 1.2rem;
      grid-template-columns: auto 1.6rem;
      padding: 1.2rem;
      width: 100%;

      .product-form__content-value-icon {
        align-items: center;
        display: flex;
        height: 100%;
        justify-content: center;
        width: 100%;
      }
    }

    .product-form__content-item {
      display: flex;
      justify-content: space-between;

      * {
        pointer-events: none;
      }
    }

    .product-form__content-items {
      background: rgb(242 240 235 / 100%);
      border: 1px solid currentColor;
      border-radius: 0rem 0rem 0.8rem 0.8rem;
      position: absolute;
      width: 100%;
      z-index: 2;

      .product-form__content-item {
        padding: 1.2rem;

        &+& {
          border-top: 1px solid rgb(12 12 13 / 20%);
        }

        .product-form__label {
          display: none;
        }
      }
    }

    &:not([open]) .product-form__content-items {
      display: none;
    }

    &[open] .product-form__content-value {
      border-radius: 0.8rem 0.8rem 0rem 0rem;
    }
  }

  .product-form__option-other__wrapper .product-form__context-text:not(.product-form__context-active) {
    display: none;
  }

  .product-form__opener .product-form__product-input:not(:checked)~.product-form__content {
    display: none;
  }

  @media screen and (width < 768px) {
    .product-form__body .product-form__product {
      flex-direction: column;
      align-items: start;

      .product-form__left {
        --context-title: 1.6rem;
        gap: 1.5rem;
      }

      .product-form__right {
        /* flex: 1 0 7em; */
        flex-direction: column-reverse;
        gap: 0.5rem;
        flex-direction: row;
        justify-content: start;

        .product-form__label {
          font-size: 1.2rem;
          line-height: 1.75;
          padding: .2rem 0.8rem .1em;
          text-align: center;

          &:not(.product-form__subscription-label) {
            background: transparent;
            border: 1px solid;
            border-radius: 2em;
          }

          &.product-form__subscription-label {
            font-size: 1.6rem;
            margin-left: auto;
            order: 2;
          }
        }

        .product-form__label,
        .product-form__price {
          margin-left: 0;
        }

        .product-form__price:first-child {
          margin-left: auto;
        }
      }

      .product-form__context-text {
        font-size: 1.4rem;
      }
    }

    .product-form__body .product-form__context-text .product-form__context-text__extra .product-form__context-text__inner {
      font-size: 1.23rem;
    }

    .product-form__body .product-form__option-other__wrapper .product-form__product>.product-form__right {
      flex-direction: row;
      justify-content: end;

    }

    .product-form__content-selector .product-form__content-item {
      display: flex;
      justify-content: start;
      flex-direction: column;
      gap: .5em;

      .product-form__right {
        flex: 1 0 auto;
      }
    }

    .product-form__footer {
      gap: 1.2rem;

      .product-form__atc-wrapper .button--primary {
        font-size: 1.6rem;
        height: auto;
        line-height: 1;
        padding: 1rem;
      }
    }
  }
}