.conditional-wrap {
  & > h3 {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
  }

  & > .description {
    margin-bottom: 15px;
  }

  .add-rule-btn {
    margin-top: 15px;
  }

  .conditional-rule {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;

    &-header {
      display: flex;
      align-items: center;
      background: #fff;
      padding: 15px 20px;
      line-height: 1.5;

      i {
        cursor: pointer;
        line-height: 1;


        &.duplicate {
          margin-left: auto;
          color: $eacf7_color;
          margin-right: 15px;

          img {
            width: 20px;
            height: 20px;
          }
        }

        &.delete {
          img {
            width: 20px;
            height: 20px;
          }
        }
      }

      .header-title {
        font-size: 1rem;
        color: #333;
        font-weight: 400;
        margin-left: 7px;

        .rule-text {
          margin: 0 5px;
        }

        .rule-field {
          font-size: 16px;
          color: #555;
          margin: 0;
          font-weight: 400;
        }

      }

    }

    &-body {
      display: none;
      padding: 15px;
      background: #f9f9f9;
      border-top: 1px solid #ddd;
    }

    .settings-field {
      margin-bottom: 0;
      border: none;
      padding: 10px 15px;
    }

    .conditions-wrap {
      background: #fff;
      border: 1px solid #eee;
      padding: 20px;
      border-radius: 10px;

      & > h4 {
        font-size: 1.2rem;
        color: #333;
        margin-top: 0;
        margin-bottom: 15px;
        line-height: 1;
      }

      .condition-item {
        display: flex;
        align-items: center;
        margin-bottom: 15px;

        .components-input-control__container {
          width: 100%;

          .components-input-control__backdrop {
            border-color: #ddd !important;
            border-radius: 5px !important;
            height: 35px;
          }
        }

        .components-base-control {
          width: 28%;
          margin-right: 20px;

          &:nth-child(1) {
            width: 35%;
          }

          &:nth-child(2) {
            width: 25%;
          }

          &:nth-child(3) {
            width: 40%;
          }

          input {
            border-color: #ddd !important;
            border-radius: 5px;

            &:focus {
              border-color: #ddd !important;
              box-shadow: none;
            }
          }
        }

        .dashicons {
          margin-right: 7px;
          padding: 7px;
          border-radius: 50%;
          border: 1px solid #ddd;
          cursor: pointer;
          height: 30px;
          width: 30px;
          font-size: 20px;
          display: flex;
          align-items: center;
          justify-content: center;

          &:last-child {
            margin-right: 0;
          }
        }

        &:nth-child(2) {
          .dashicons {
            margin-top: 20px;
          }
        }


        &:last-child {
          margin-bottom: 0;
        }
      }

    }

    .rule-fields {
      display: flex;
      align-items: center;
      margin-bottom: 20px;

      .rule-field {
        display: flex;
        flex-direction: column;
        flex: 1;
        margin-right: 30px;

        .conditional-field {
          .components-input-control__backdrop {
            height: 35px;
          }
        }

        h4 {
          font-size: .9rem;
          color: #333;
          margin-top: 0;
          margin-bottom: 10px;
          font-weight: 400;

          i {
            margin-left: 5px;
          }
        }

        &:first-child {
          flex: 1.5;
        }

        &:last-child {
          margin-right: 0;
        }

      }

    }

    &.active {
      .conditional-rule-header {
        .dashicons-arrow-down-alt2 {
          &:before {
            content: "\f343";
          }
        }
      }

      .conditional-rule-body {
        display: block;
      }
    }
  }
}

@media screen and (max-width: 767px) {
  .conditional-wrap {
    .conditional-rule {
      .conditional-rule-header {
        .header-title {
          .rule-text {
            font-size: 14px;
          }
        }
      }

      .conditional-rule-body {
        .rule-fields {
          align-items: flex-start;
          justify-content: flex-start;
          flex-direction: column;

          .rule-field {
            margin-bottom: 15px;

            &:last-child {
              margin-bottom: 0;
            }

            .components-input-control__container {
              width: 100%;
            }
          }
        }
      }

      .conditions-wrap {
        .condition-item {
          align-items: flex-start;
          justify-content: center;
          flex-wrap: nowrap;
          flex-direction: column;

          .components-base-control {
            width: 100%;
            margin-right: 0;
            margin-bottom: 15px;

            &:last-child {
              margin-bottom: 0;
            }
          }
        }
      }
    }
  }
}