x-modal.helferline-modal {
  display: none;
}

x-modal.helferline-modal:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

x-modal.helferline-modal .overlay {
  background: rgb(var(--color-overlay) / 0.55);
}

html.js x-modal.helferline-modal.drawer .drawer__inner,
html.js x-modal.helferline-modal.drawer.helferline-flow-popup .drawer__inner {
  position: static;
  inset: auto;
  inset-block-start: auto;
  inset-block-end: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  max-height: 90vh;
  max-width: 56rem;
  margin: 0;
  transform: scale(0.96);
  opacity: 0;
  border-radius: var(--sp-4);
  background-color: rgb(var(--color-total-white));
  box-shadow: 0 12px 40px rgba(7, 14, 33, 0.18);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

html.js x-modal.helferline-modal.drawer[active] > .drawer__inner {
  opacity: 1;
  transform: scale(1);
}

.loaded x-modal.helferline-modal.drawer .drawer__inner {
  transition-property: transform, opacity;
  transition-duration: 0.35s;
  transition-timing-function: ease;
}

.helferline-flow {
  --helferline-navy: #001e6e;
  --helferline-cyan: rgb(var(--color-blue-light));
  --helferline-text: #131416;
  --helferline-muted: #646a72;
  --helferline-muted-alt: #5f6d76;
  --helferline-border: #e2e5e9;
  --helferline-track: #cbcfd4;
  --helferline-disabled: #8a9097;
  --helferline-panel: #f6f8fa;

  .helferline-flow__shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    position: relative;
  }

  .helferline-flow__header {
    position: relative;
    padding: var(--sp-8) var(--sp-16) 0;
    text-align: center;
    flex-shrink: 0;

    @media screen and (max-width: 749px) {
      padding: var(--sp-6) var(--sp-5) 0;
    }
  }

  .helferline-flow__title {
    margin: 0;
    font-size: var(--sp-7d5);
    font-weight: 700;
    line-height: 1.2;
    color: var(--helferline-text);

    @media screen and (max-width: 749px) {
      font-size: var(--sp-5d5);
      padding-inline: var(--sp-6);
    }
  }

  .helferline-flow__close {
    position: absolute;
    top: var(--sp-7);
    right: var(--sp-6);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--sp-6);
    height: var(--sp-6);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--helferline-navy);

    @media screen and (max-width: 749px) {
      top: var(--sp-5d5);
      right: var(--sp-5);
    }

    svg {
      width: var(--sp-4);
      height: var(--sp-4);
    }
  }

  .helferline-flow__body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-16) var(--sp-8);
    min-width: 0;
    width: 100%;

    @media screen and (max-width: 749px) {
      gap: var(--sp-4);
      padding: var(--sp-4) var(--sp-5) var(--sp-6);
    }
  }

  .helferline-flow__stepper-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    width: 100%;
    flex-shrink: 0;
    padding-bottom: var(--sp-3);

    @media screen and (max-width: 749px) {
      gap: var(--sp-5);
      padding-bottom: var(--sp-4);
    }

    &.is-step-2 {
      gap: 0;
      padding-bottom: var(--sp-3);

      .helferline-flow__intro {
        display: none;
      }
    }
  }

  .helferline-flow__steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    position: relative;
    flex-shrink: 0;
  }

  .helferline-flow__steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 115px;
    right: 115px;
    height: 1px;
    background: var(--helferline-track);
    pointer-events: none;

    @media screen and (max-width: 749px) {
      left: 62px;
      right: 62px;
    }
  }

  .helferline-flow__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    position: relative;
    z-index: 1;
    width: 200px;
    flex-shrink: 0;

    @media screen and (max-width: 749px) {
      width: 110px;
      gap: var(--sp-2);
    }
  }

  .helferline-flow__step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 2px solid var(--helferline-navy);
    background: rgb(var(--color-total-white));
    color: var(--helferline-navy);
    font-size: var(--sp-3d5);
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
  }

  .helferline-flow__step-label {
    font-size: 0.8125rem;
    line-height: normal;
    color: var(--helferline-muted-alt);
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
  }

  .helferline-flow__step.is-active .helferline-flow__step-num {
    background: var(--helferline-cyan);
    border-color: var(--helferline-cyan);
    color: var(--helferline-navy);
  }

  .helferline-flow__step.is-active .helferline-flow__step-label {
    color: var(--helferline-navy);
    font-weight: 600;
  }

  .helferline-flow__intro {
    margin: 0;
    font-size: 0.9375rem;
    line-height: normal;
    color: var(--helferline-muted-alt);

    @media screen and (max-width: 749px) {
      font-size: var(--sp-3d5);
      line-height: 1.43;
    }
  }

  .helferline-flow__panel {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;

    @media screen and (max-width: 749px) {
      gap: var(--sp-4);
    }

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__groups {
    display: flex;
    flex-direction: column;
  }

  .helferline-flow__groups-panel {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-6);
    background: var(--helferline-panel);
    border-radius: var(--sp-2);

    @media screen and (max-width: 749px) {
      gap: var(--sp-3);
      padding: var(--sp-3);
    }

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__group {
    display: flex;
    flex-direction: column;
    gap: 10px;

    @media screen and (max-width: 749px) {
      gap: var(--sp-2);
    }

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__group-heading {
    margin: 0;
    font-size: var(--sp-4);
    font-weight: 600;
    line-height: 1.5;
    color: var(--helferline-text);

    @media screen and (max-width: 749px) {
      font-size: var(--sp-3d5);
      line-height: 1.43;
    }
  }

  .helferline-flow__group-description {
    margin: 0;
    font-size: var(--sp-3d5);
    line-height: 1.43;
    color: var(--helferline-muted-alt);
  }

  .helferline-flow__cards {
    display: flex;
    flex-direction: column;
    gap: 10px;

    @media screen and (max-width: 749px) {
      gap: var(--sp-2);
    }
  }

  .helferline-flow__card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-4);
    padding: 14px 20px;
    border: 1px solid var(--helferline-border);
    border-radius: var(--sp-3);
    background: rgb(var(--color-total-white));
    cursor: pointer;
    transition: border-color 0.2s ease;

    @media screen and (max-width: 749px) {
      grid-template-columns: auto auto minmax(0, 1fr);
      grid-template-areas:
        "radio media body"
        "radio media price";
      gap: var(--sp-2d5);
      padding: 14px 12px;
      align-items: center;
    }

    &.is-selected {
      border-color: var(--helferline-navy);
    }
  }

  .helferline-flow__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .helferline-flow__radio-ui {
    width: var(--sp-5);
    height: var(--sp-5);
    border-radius: 50%;
    border: 1.5px solid #d0d5dd;
    flex-shrink: 0;
    background: rgb(var(--color-total-white));

    @media screen and (max-width: 749px) {
      grid-area: radio;
    }
  }

  .helferline-flow__radio:checked + .helferline-flow__radio-ui {
    border: 6px solid var(--helferline-cyan);
  }

  .helferline-flow__card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--helferline-panel);

    @media screen and (max-width: 749px) {
      grid-area: media;
      width: 40px;
      height: 40px;
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  .helferline-flow__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    min-width: 0;

    @media screen and (max-width: 749px) {
      grid-area: body;
    }
  }

  .helferline-flow__card-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    min-width: 0;
  }

  .helferline-flow__card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.41;
    color: var(--helferline-text);

    @media screen and (max-width: 749px) {
      font-size: 0.9375rem;
      line-height: 1.33;
    }
  }

  .helferline-flow__card-subtitle {
    font-size: var(--sp-3d5);
    line-height: 1.43;
    color: var(--helferline-muted);

    @media screen and (max-width: 749px) {
      font-size: 0.8125rem;
      line-height: 1.38;
    }
  }

  .helferline-flow__card-price {
    flex-shrink: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.41;
    color: var(--helferline-text);
    white-space: nowrap;
    text-align: right;

    @media screen and (max-width: 749px) {
      grid-area: price;
      font-size: 0.9375rem;
      line-height: 1.33;
      text-align: left;
    }
  }

  .helferline-flow__info-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--helferline-navy);
    cursor: pointer;
    flex-shrink: 0;

    .icon-info-helferline,
    svg {
      width: 15px;
      height: 15px;
      display: block;
    }
  }

  .helferline-flow__info-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: min(280px, 70vw);
    padding: var(--sp-3d5);
    border-radius: var(--sp-2);
    background: rgb(var(--color-total-white));
    box-shadow: 0 8px 24px rgba(7, 14, 33, 0.16);
    text-align: left;
    color: var(--helferline-text);

    @media screen and (max-width: 749px) {
      left: auto;
      right: 0;
      transform: none;
      width: min(260px, calc(100vw - 48px));
    }

    p {
      margin: 0 0 var(--sp-1d5);
      font-size: var(--sp-3);
      line-height: 1.4;
      color: var(--helferline-text);
    }

    ul {
      margin: 0;
      padding-left: 1.1em;
      list-style: disc outside;
    }

    li {
      display: list-item;
      font-size: var(--sp-3);
      line-height: 1.4;
      color: var(--helferline-text);
    }

    li + li {
      margin-top: var(--sp-1d5);
    }

    li::marker {
      color: #000;
    }
  }

  @media (hover: hover) and (pointer: fine) {
    .helferline-flow__info-button:hover .helferline-flow__info-popover[hidden],
    .helferline-flow__info-button:focus-visible .helferline-flow__info-popover[hidden] {
      display: block;
    }
  }

  .helferline-flow__summary {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2d5);
    padding: var(--sp-4);
    background: var(--helferline-panel);
    border-radius: var(--sp-2d5);

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__summary-heading {
    margin: 0;
    font-size: var(--sp-3d5);
    font-weight: 600;
    line-height: 1.4;
    color: var(--helferline-text);
  }

  .helferline-flow__summary-rows {
    display: flex;
    flex-direction: column;
  }

  .helferline-flow__summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-2d5) 0;
  }

  .helferline-flow__summary-label {
    font-size: var(--sp-3d5);
    color: var(--helferline-muted);
    flex-shrink: 0;
  }

  .helferline-flow__summary-value {
    font-size: var(--sp-3d5);
    font-weight: 400;
    color: #070e21;
    text-align: right;
  }

  .helferline-flow__summary-row--price .helferline-flow__summary-value {
    font-size: var(--sp-4d5);
    font-weight: 700;
  }

  .helferline-flow__summary-dual-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2d5);
  }

  .helferline-flow__summary-block {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  .helferline-flow__summary-group-title {
    margin: 0;
    font-size: var(--sp-3);
    font-weight: 600;
    line-height: 1.33;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--helferline-muted);
  }

  .helferline-flow__summary-divider {
    height: 1px;
    background: var(--helferline-border);
    flex-shrink: 0;
  }

  .helferline-flow__summary-total {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-top: var(--sp-1d5);
  }

  .helferline-flow__summary-total-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .helferline-flow__summary-total-label {
    margin: 0;
    font-size: var(--sp-3d5);
    font-weight: 600;
    line-height: 1.4;
    color: var(--helferline-text);
  }

  .helferline-flow__summary-total-note {
    margin: 0;
    font-size: var(--sp-3);
    line-height: 1.33;
    color: var(--helferline-muted);
  }

  .helferline-flow__summary-total-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-1);
    text-align: right;
  }

  .helferline-flow__summary-total-primary {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #070e21;
  }

  .helferline-flow__summary-total-subline {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.31;
    color: #070e21;
  }

  .helferline-flow__summary--dual .helferline-flow__summary-value {
    flex: 1 1 auto;
    min-width: 0;
  }

  @media screen and (max-width: 749px) {
    .helferline-flow__summary--dual .helferline-flow__summary-row {
      align-items: flex-start;
    }
  }

  .helferline-flow__warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--helferline-panel);
    border-radius: var(--sp-2);
    overflow: hidden;

    &[hidden] {
      display: none;
    }

    .helferline-flow__warning-content {
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    p {
      margin: 0;
      min-width: 0;
      font-size: var(--sp-3);
      font-weight: 400;
      line-height: 1.417;
      color: var(--helferline-text);
    }

    .icon-info-helferline,
    svg {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      display: block;
      margin-top: 1px;
    }

    @media screen and (max-width: 749px) {
      p {
        font-size: 0.6875rem;
        line-height: 1.45;
      }
    }
  }

  .helferline-flow__accordions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__accordion {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1.5px solid var(--helferline-border);
    border-radius: var(--sp-2);
    overflow: hidden;
    padding: 14px 16px;
    background: rgb(var(--color-total-white));

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__accordion-summary {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: 0;
    cursor: pointer;
    list-style: none;

    &::-webkit-details-marker {
      display: none;
    }
  }

  .helferline-flow__accordion-label {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .helferline-flow__accordion-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.385;
    color: var(--helferline-text);
  }

  .helferline-flow__accordion-title-suffix {
    @media screen and (max-width: 749px) {
      display: none;
    }

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__accordion-desc {
    margin: 0;
    font-size: var(--sp-3);
    font-weight: 400;
    line-height: 1.417;
    color: var(--helferline-muted);

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__accordion-chevron {
    display: inline-flex;
    flex-shrink: 0;
    width: var(--sp-5);
    height: var(--sp-5);
    align-items: center;
    justify-content: center;
    color: var(--helferline-navy);
    transition: transform 0.2s ease;

    svg path {
      stroke: var(--helferline-navy);
    }
  }

  .helferline-flow__accordion[open] .helferline-flow__accordion-chevron {
    transform: rotate(180deg);
  }

  .helferline-flow__accordion-body {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: var(--sp-3d5);
    padding-top: var(--sp-3d5);
    border-top: 1px solid var(--helferline-border);
  }

  .helferline-flow__accordion-content,
  .helferline-flow__accordion-content.rte {
    font-size: var(--sp-3);
    line-height: 1.417;
    color: var(--helferline-text);

    > * {
      margin: 0;
    }

    .metafield-rich_text_field > p,
    > p {
      margin: 0 0 var(--sp-2);
      font-size: var(--sp-3);
      line-height: 1.4;
    }

    .metafield-rich_text_field > ul,
    > ul {
      margin: 0;
      padding-left: 1.1em;
      display: flex;
      flex-direction: column;
      gap: var(--sp-1d5);
      list-style: disc;
    }

    .metafield-rich_text_field > ul li,
    > ul li {
      display: list-item;
      padding: 0;
      padding-inline-start: var(--sp-1d5);
      font-size: var(--sp-3);
      font-weight: 400;
      line-height: 1.4;
      color: var(--helferline-text);
    }
  }

  .helferline-flow__accordion--plz .helferline-flow__accordion-body {
    max-height: 220px;
    padding-right: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #999ea8 var(--helferline-border);

    &::-webkit-scrollbar {
      width: 3px;
    }

    &::-webkit-scrollbar-track {
      background: var(--helferline-border);
      border-radius: 2px;
    }

    &::-webkit-scrollbar-thumb {
      background: #999ea8;
      border-radius: 2px;
    }

    &::after {
      content: '';
      position: sticky;
      display: block;
      flex: 0 0 0;
      left: 0;
      right: 0;
      bottom: 0;
      height: 36px;
      margin-top: -36px;
      pointer-events: none;
      background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgb(var(--color-total-white)));
    }
  }

  .helferline-flow__plz-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-height: 0;

    h1, h2, h3, h4, h5, h6,
    .helferline-flow__plz-col > p {
      margin: 0 0 4px;
      font-size: 0.6875rem;
      font-weight: 600;
      line-height: 16px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--helferline-muted);
    }

    ul + h1,
    ul + h2,
    ul + h3,
    ul + h4,
    ul + h5,
    ul + h6,
    ul + p {
      margin-top: var(--sp-4);
    }

    ul {
      margin: 0;
      padding: 0;
      list-style: none;
    }

    li {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 3px 0;
      font-size: var(--sp-3);
      margin-block-start: 5px;
      font-weight: 400;
      line-height: 17px;
      color: var(--helferline-text);
      list-style: none;
    }

    li::marker {
      content: none;
    }

    strong,
    b {
      flex: 0 0 44px;
      width: 44px;
      font-weight: 600;
    }
  }

  .helferline-flow__plz-col {
    flex: 1 1 0;
    min-width: 0;
  }

  @media screen and (min-width: 750px) {
    .helferline-flow__accordion--plz .helferline-flow__accordion-body {
      max-height: min(42vh, 320px);
    }

    .helferline-flow__plz-list {
      flex-direction: row;
      align-items: flex-start;
      gap: 40px;
    }
  }

  .helferline-flow__error {
    width: 100%;
    margin: 0;
    padding: var(--sp-4) var(--sp-4d5);
    border-radius: var(--sp-2);
    background: #fceded;
    color: #bf122e;
    font-size: var(--sp-3d5);
    font-weight: 500;
    line-height: 1.4;
    text-align: center;

    &[hidden] {
      display: none;
    }
  }

  .helferline-flow__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    width: 100%;
    margin-top: var(--sp-3);
    padding-top: var(--sp-8);
    flex-shrink: 0;

    @media screen and (max-width: 749px) {
      gap: var(--sp-3);
      padding-top: var(--sp-5);
    }
  }

  .helferline-flow__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    min-height: 56px;
    width: 168px;
    min-width: 168px;
    padding: 16px;
    border: 0;
    border-radius: 6px;
    background: var(--helferline-cyan);
    color: var(--helferline-navy);
    font-size: var(--sp-4);
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: none;

    &:disabled,
    &[aria-disabled='true'] {
      background: rgb(var(--color-total-white));
      color: var(--helferline-disabled);
      cursor: not-allowed;
      opacity: 1;
      box-shadow: 0 0 1.5px rgba(0, 0, 0, 0.14);
    }

    @media screen and (max-width: 749px) {
      flex: 1;
      width: auto;
      min-width: 0;
    }
  }

  .helferline-flow__button--secondary {
    background: rgb(var(--color-total-white));
    color: var(--helferline-navy);
    border: 1px solid var(--helferline-navy);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);

    &:disabled,
    &[aria-disabled='true'] {
      background: rgb(var(--color-total-white));
      border-color: var(--helferline-border);
      color: var(--helferline-disabled);
      box-shadow: none;
    }
  }
}
