.configurator-btn-open {
  width: 100%;
  margin-top: 10px;
  line-height: 1;
}

.configurator-btn-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  border: 1px solid #231f20;
  border-radius: 50%;
  transition: 0.3s;

  &:before,
  &:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 50%;
    height: 2px;
    background: #231f20;
  }

  &:before {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  &:hover {
    background: #231f20;
    cursor: pointer;

    &:before,
    &:after {
      background: #ffffff;
    }
  }
}

.configurator-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  z-index: 100;

  .configurator-content {
    position: relative;
    background: #ffffff;
    width: 70vw;
    height: 70vh;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.3);
    overflow: auto;
  }
}

.configurator-steps-indicator {
  display: flex;
  justify-content: center;
  overflow: auto;

  .step-number-wrapper {
    position: relative;
    min-width: 15%;
    max-width: 15%;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #231f20;

    &:before {
      content: "";
      position: absolute;
      top: 20px;
      left: 0;
      width: 100%;
      height: 2px;
      background: #29aee1;
      z-index: 1;
    }

    &.current-step {
      cursor: pointer;

      .step-number:not(.final) {
        color: #231f20 !important;
        background: #ddf5ff !important;
      }
    }

    &.completed {
      cursor: pointer;

      .step-number {
        background: #29aee1;
        color: #ffffff;
        cursor: pointer;
      }
    }

    .step-number {
      position: relative;
      width: 40px;
      height: 40px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: #f5f5f5;
      border-radius: 50%;
      z-index: 10;
    }

    .step-title {
      text-align: center;
    }
  }
}

.configurator-step {
  .component-variations {
    padding: 30px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;

    .component-variation {
      border: 1px solid #d8d8d8;
      border-radius: 20px;
      color: #231f20;
      transition: 0.2s;

      &.selected {
        background: rgba(41, 170, 225, 0.1);
        border-color: #29aee1;
      }

      .variation-option {
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;

        input {
          display: none;
        }

        img {
          width: 60px;
          height: 60px;
          object-fit: contain;
        }
      }
    }
  }

  &.login {
    max-width: 70%;
    margin: auto;
    padding-top: 30px;

    p {
      font-size: 16px;
    }

    a {
      color: #29aee1;
    }

    input {
      outline: none;
      border: 1px solid #cbd4d8 !important;
      border-radius: 100px !important;
    }

    .woocommerce-form-login__rememberme {
      padding-bottom: 10px;
    }
  }

  &.final {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #d8d8d8;
    border-radius: 20px;

    h4 {
      margin-top: 0;
      text-align: center;
    }

    .summary-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 5px;
    }
  }

  .button {
    padding: 12px 20px 12px 20px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: #ffffff !important;
    border: 1px solid #8e888a !important;
    border-radius: 100px 100px 100px 100px !important;
    color: #231f20 !important;

    &:hover {
      background: #231f20 !important;
      border-color: #231f20 !important;
      color: #ffffff !important;

      img {
        filter: invert(1);
      }
    }

    &.next-step {
      float: right;
    }

    &.edit {
      padding: 0 !important;
      background: #ffffff !important;
      border: none !important;
      font-weight: 400 !important;
      color: #29aee1 !important;

      &:hover {
        opacity: 0.7;
      }
    }

    &.add-to-cart {
      width: 100%;
    }
    
    &.print, &.email {
      width: 100%;
      margin-top: 10px;
    }
  }
}

@media (max-width: 768px) {
  .configurator-wrapper {
    .configurator-content {
      width: 90vw;
      height: 90vh;
      padding: 40px 20px;
    }
  }

  .configurator-steps-indicator {
    padding-bottom: 5px;
    justify-content: flex-start;

    .step-number-wrapper {
      min-width: 40%;
      max-width: 40%;

      &:before {
        top: 16px;
      }

      .step-number {
        position: relative;
        width: 35px;
        height: 35px;
      }

      .step-title {
        font-size: 14px;
        line-height: 1.1;
      }
    }
  }

  .configurator-step {
    .component-variations {
      grid-template-columns: 1fr;

      .component-variation {
        .variation-option {
          img {
            width: 50px;
            height: 50px;
          }
        }
      }
    }

    &.login {
      max-width: 100%;
      padding-top: 20px;

      .form-row {
        width: 100% !important;
      }
    }

    &.final {
      .summary-item {
        padding-bottom: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-size: 16px;
        line-height: 1.3;
      }
    }
  }
}
