.webform-submission-bike-chosing-aid-form {
  &:not(:has(.hero)) {
    margin-bottom: 8rem;
  }

  .progress-step {
    position: relative;

    &:first-child {
      .progress-text {
        padding-left: 0
      }
    }

    &:last-child {
      .progress-marker::after {
        display: block;
      }
    }
  }

  .progress-marker {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;

    &::before {
      display: none;
    }
  }

  .webform-progress-tracker {
    .progress-step {
      .progress-marker {
        &::after {
          background-color: #D9D9D9;
        }
      }

      &.is-active {
        .progress-marker {
          &::after {
            background-color: #000000;
          }
        }
      }
    }
  }

  .progress-tracker--center {
    text-align: left;

    .progress-marker {
      &::after {
        right: unset;
      }
    }
  }

  .progress-tracker {
    margin-bottom: 130px;
  }

  fieldset {
    text-align: center;

    legend {
      font-size: 33px;
      font-weight: 300;
      text-transform: uppercase;
      margin-bottom: 40px;
    }
  }

  label[for="edit-select-bike-usage"],
  label[for="edit-select-bike-frame-type"],
  label[for="edit-select-body-height"],
  label[for="edit-select-drive-type"],
  .webform-confirmation__message {
    font-size: 33px;
    font-weight: 300;
    text-transform: uppercase;
    margin-bottom: 40px;
    display: block;
    width: 100%;
    text-align: center;
  }

  ul.thumbnails.image_picker_selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    li {
      margin: 1px 12.5px 25px 12.5px;
      width: calc(20% - 25px);

      .thumbnail {
        border: none;
        padding: 0;
        transition: all .2s ease;

        img {
          /* background-color: #F5F5F5; */
          border: 4px solid rgba(0, 0, 0, 0);
          transition: all .2s ease;
        }

        p {
          margin-top: 1em;
        }

        &.selected {
          color: inherit;
          background: unset;

          img {
            border: 4px solid var(--bs-primary);
          }
        }

        &:not(.selected):hover img {
          cursor: pointer;
          border: 4px solid var(--bs-primary-bg-subtle);
        }
      }
    }
  }

  #edit-select-budget,
  #edit-select-distance,
  #edit-select-body-height {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0 3em;

    >.form-item {
      width: calc(50% - 1.5em);
    }
  }

  .form-check {
    min-height: 1.78em;
  }

  .webform-confirmation {
    margin-top: 90px;
  }

  .badge {
    position: absolute;
    left: 1em;
    top: 1em;
    z-index: 1;
  }

  /* Results: the best match and the other bikes, with the reasons. */
  .bike-selection-results {
    display: grid;
    gap: 3rem 1.5rem;
  }

  /* Every reason starts with a capital, also for the (lowercase) English
     source strings. */
  .bike-selection-results__reasons li::first-letter {
    text-transform: uppercase;
  }

  .bike-selection-results__card {
    position: relative;

    /* The teaser is a link around the image box and the name/price row. */
    > a {
      display: block;
    }

    /* The image box: the bike stands at the bottom of the grey box. */
    > a > :first-child {
      display: flex;
      align-items: flex-end;
      justify-content: center;
    }

    .image,
    img {
      display: block;
      width: 100%;
      height: auto;
    }
  }

  /*
   * From tablet width: the best match takes the left half, the reasons and
   * the other bikes the right half. The cards share the rows of the grid
   * (subgrid), so the bottoms of the images, the names and the links are
   * aligned. The image box of the best match spans the row of the reasons
   * and the image row of the other bikes.
   */
  @media (min-width: 768px) {
    .bike-selection-results {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      grid-template-rows: auto auto auto auto;
      row-gap: 0;
    }

    .bike-selection-results__card {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: 2 / span 3;

      /* Let the image box and the name/price row take a row of the grid. */
      > a {
        display: contents;
      }

      > a > :first-child {
        grid-row: 1;
      }

      > a > :nth-child(2) {
        grid-row: 2;
      }

      > .bike-selection-results__more {
        grid-row: 3;
      }
    }

    .bike-selection-results__card.best-matching-product {
      grid-column: 1 / span 2;
      grid-row: 1 / span 4;

      > a > :first-child {
        grid-row: 1 / span 2;
      }

      > a > :nth-child(2) {
        grid-row: 3;
      }

      > .bike-selection-results__more {
        grid-row: 4;
      }
    }

    /* The space below the reasons equals the column gap on their left. */
    .bike-selection-results__reasons {
      grid-column: 3 / span 2;
      grid-row: 1;
      margin-bottom: 1.5rem;
    }
  }

  .form-check-input {
    transform: translateY(7px);
  }

  .hero {
    position: relative;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
  }
}

.ui-dialog.download-bike-pdf {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 2rem);
}

html[data-admin-toolbar="collapsed"] .ui-dialog.download-bike-pdf {
  left: calc(50% + 73px) !important;
}

@media (max-width: 1200px) {
  .webform-submission-bike-chosing-aid-form {
    & ul.thumbnails.image_picker_selector {
      & li {
        width: calc(33.333% - 25px);
      }
    }
  }
}

@media (max-width: 768px) {
  .webform-submission-bike-chosing-aid-form {
    & ul.thumbnails.image_picker_selector {
      & li {
        margin: 1px 0 25px 0;
        width: 100%;
      }
    }
  }
}