.eu-owb-order-withdrawal-request {
  display: block;
  clear: both;
  margin-top: 1.33em;

  h3 {
    margin-top: 0;
  }

  .eu-owb-order-withdrawal-request-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;

    .eu-owb-reject-withdrawal-request-start {
      color: #a00;
      cursor: pointer;
      text-decoration: underline;
    }

    .eu-owb-reject-withdrawal-request-form {
      p.form-field:first-child {
        margin-top: 0 !important;
      }

      #eu-owb-reject-withdrawal-request-submit {
        margin-top: 12px;
      }

      &.hidden {
        display: none !important;
      }
    }
  }
}

.withdrawal-quantity {
  background: #eba3a3;
  border: none;
  padding: 4px;
  color: #a00;
  border-radius: 4px;
  font-size: .92em !important;

  &.withdrawal-requested {
    background: #f8dda7;
    color: #573b00;
  }
}

.eu-owb-settings-additional-desc {
  margin-top: 1em;
  line-height: 1.5em;
  background: #fff;
  padding: .5em;
  font-style: normal;
  font-size: 14px;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.post-type-shop_order .wp-list-table .column-withdrawal_request .description,
.woocommerce_page_wc-orders .wp-list-table .column-withdrawal_request .description {
  display: block;
  color: #999;
  margin-top: 5px;

  a {
    color: #999;
    text-decoration: underline;
  }
}

tr.wc-settings-row-withdrawal-period td.forminp-number .description {
  display: inline-block;
  margin-top: 5px;
}

.order-status {
  &.status-withdrawn,
  &.status-full-withdrawal,
  &.status-owb-rejected,
  &.withdrawal-request-status-unverified {
    background: #eba3a3;
    color: #570000;
  }
  &.status-pending-wdraw,
  &.status-partial-withdrawal,
  &.status-owb-type-partial,
  &.status-owb-requested {
    background: #f8dda7;
    color: #573b00;
  }
  &.withdrawal-request-status-verified,
  &.status-owb-confirmed {
    background-color: #C6E1C6;
    color: #13550F;
  }
  &.status-owb-type-full {
    background: #c8d7e1;
    color: #003d66;
  }
}

a.wc-action-button.wc-action-button-reject:after {
  content: "\f158";
}

a.wc-action-button.wc-action-button-delete:after {
  content: "\f182";
}

#eu-owb-order-withdrawals {
  display: none;
}

#eu-owb-order-withdrawals:has(.withdrawals) {
  display: block;
}

#eu-owb-order-withdrawals {
  .inside {
    margin: 0;
    padding: 0;
  }

  ul.withdrawals {
    li {
      padding: 0 10px;

      p.meta {
        padding: 10px;
        color: #999;
        margin: 0;
        font-size: 11px;

        a.delete_withdrawal {
          color: #a00;
        }
      }

      .withdrawal-content {
        padding: 10px;
        position: relative;
        background: #d7cad2;

        p {
          margin-top: 0;
          padding: 0;
          word-wrap: break-word;

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

          &.withdrawal-items {
            font-size: 12px;
          }
        }

        &::after {
          border-color: #d7cad2 transparent;
          content: "";
          display: block;
          position: absolute;
          bottom: -10px;
          left: 20px;
          width: 0;
          height: 0;
          border-width: 10px 10px 0 0;
          border-style: solid;
        }
      }

      &.withdrawal-confirmed .withdrawal-content {
        background: #cdd7ca;

        &::after {
          border-color: #cdd7ca transparent;
        }
      }
    }
  }
}

.wp-core-ui {
  a.eu-owb-order-toggle-order-search {
    padding: 10px 4px 4px 4px;
    overflow: hidden;
    position: relative;
    float: right;
    border: 2px solid transparent;
    border-radius: 4px;

    &::before {
      font-family: "Dashicons" !important;
      content: "\f464" !important;
      font-size: 17px !important;
    }

    &:hover {
      border: 2px solid var(--wp-admin-theme-color, #00a0d2);
    }
  }
}

.woocommerce_page_wc-orders,
.post-type-shop_order {
  table.wp-list-table {
    .eu-owb-order-inline-edit-wrapper {
      box-sizing: border-box;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;

      &.hidden {
        display: none !important;
      }

      &.inline-single-row {
        flex-wrap: nowrap;
        justify-content: flex-start;

        .eu-owb-order-withdrawal-order-save {
          margin-top: 0;
        }
      }

      margin-top: 10px;

      .eu-owb-order-search,
      .select2-container {
        width: 240px !important;
        font-size: 14px;
        vertical-align: middle;
      }

      .eu-owb-order-withdrawal-order-save {
        position: relative;
        margin-left: 10px;
        margin-top: 10px;
        display: inline-flex !important;
        justify-content: center;
        line-height: 1;
        vertical-align: middle;
        align-items: center;

        .dashicons, .dashicons::before {
          line-height: 1;
        }

        &.eu-owb-woocommerce-success {
          background: #008a20;
        }

        &.eu-owb-woocommerce-is-loading {
          .btn-text {
            opacity: .3;
            z-index: 0;
          }

          .spinner {
            position: absolute;
            z-index: 5;
            background-size: 16px 16px;
            float: none;
            text-align: center;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            margin: 0;
          }
        }
      }
    }
  }
}

.woocommerce_page_wc-owb-withdrawals {
  table.wp-list-table {
    td.order_number {
      .eu-owb-woocommerce-verified-status {
        margin-left: 3px;
        line-height: inherit;
      }
    }
  }
}