/* #region Order List page */
.ywhs_order_type_badge {
  .ywhs_order_type_wholesale {
    background: #f8dda7;
    color: #573b00;
  }

  .ywhs_order_type_retail {
    background: #c6e1c6;
    color: #2c4700;
  }

  > span {
    padding: 0 1em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    line-height: 2.5em;
    color: #454545;
    background: #e5e5e5;
    border-radius: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin: -0.25em 0;
    cursor: inherit !important;
    white-space: nowrap;
    max-width: 100%;
  }
}
/* #endregion */

/* #region Custom Pricing (Product, Category) page */

/* #region General Layout for Product and Category */
.ywhs_wholesale_rules {
  margin-top: 25px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0px 1px 1px 0px #0000000d;
  overflow: hidden;
  font-family: "SF Pro", sans-serif;

  p,
  input[type="checkbox"],
  input[type="radio"] {
    margin: 0 !important;
    padding: 0 !important;
  }

  select, label{
    max-width: 100% !important;
    width: 100% !important;
  }

  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  input[type="number"] {
    -moz-appearance: textfield;
  }

  .ywhs_header {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #171719;
    padding: 12px;
  }

  .ywhs_header > p {
    font-weight: 700;
    font-size: 14px;
    line-height: 24px;
    color: #fff;
  }

  .ywhs_header .ywhs_separator {
    width: 0px;
    height: 16px;
    border: 1px solid #ffffff2e;
  }

  .ywhs_body {
    padding: 12px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .ywhs_body > p {
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #070707;
  }

  .ywhs_field,
  .ywhs_select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #1e1e1e;
  }

  .ywhs_field > p:first-child,
  .ywhs_select > label,
  .ywhs_discount_value_header > p {
    font-weight: 500;
    font-size: 11px;
    line-height: 16px;
    text-transform: uppercase;
  }

  .ywhs_field_inputs_wrapper {
    display: flex;
    gap: 20px;
  }

  .ywhs_field_inputs_wrapper > div {
    flex: 1;
  }

  .ywhs_radios {
    border-radius: 2px;
    border: 1px solid #949494;
    margin: 0;
  }

  .ywhs_radios label {
    display: flex;
    align-items: center;
    padding: 10px 12px 10px 12px;
    gap: 8px;
    box-sizing: border-box;
    height: 100%;
  }

  .ywhs_helptip {
    font-size: 12px;
    color: #757575;
    line-height: 16px;
  }

  .ywhs_field_inputs_list {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    border: 1px solid #949494;
    box-shadow: 0px 1px 2px 0px #0000000D;

    div {
      border-bottom: 1px solid #F0F0F0;
      padding-bottom: 16px;
    }

    label {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    div:last-child {
      border: none;
      padding: 0;
    }
  }

  .ywhs_discount_values, .ywhs_access_enable_by_role{
    display: none;
    padding: 0;
    flex-direction: column;
    gap: 20px;
  }

  .ywhs_discount_value_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .ywhs_discount_value_header label {
    display: flex;
    align-items: center;
    gap: 12px;
  }
}

/* Product and Category List page */
.ywhs_access_rule_column, .ywhs_discount_rule_column{
  span {
    word-break: normal !important;
    margin-bottom: 4px;
    font-weight: 600;
    cursor: default;
  }

  .ywhs_access_rule_visible {
    color: #1f751f;
  }

  .ywhs_access_rule_hidden {
    color: #be0010;
  }

  .ywhs_access_rule_mixed {
    color: #f4a20a;
  }
}
/* #endregion */

/* #region Layout: Category page */
.ywhs_category_based_wholesale_rules_wrapper {
  border-top: 1px solid #DDDDDD;
  box-shadow: 0px -1px 0px 0px #FFFFFFB2;

  .ywhs_discount_roles_value {
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fafafa;

    input {
      position: relative;
      z-index: 1;
      width:  100% !important;
    }

    .ywhs_discount_role_value_item {
      display: flex;
      border-bottom: 1px solid #ddd;
      justify-content: space-between;
      align-items: center;
      padding: 12px;
      gap: 20px;
    }

    .ywhs_discount_role_value_item:last-child {
      border: none;
    }

    .ywhs_discount_role_value_item > div {
      flex: 1;
    }

    .ywhs_value_input {
      position: relative;
    }

    .ywhs_input_suffix {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      font-weight: 500;
      font-size: 13px;
      line-height: 20px;
      z-index: 2;
    }
  }
}

@media (max-width: 1024px) {
  .ywhs_category_based_wholesale_rules_wrapper {
    .ywhs_field_inputs_grid {
      grid-template-columns: 1fr;
    }

    .ywhs_field_inputs_wrapper {
      flex-direction: column;
      gap: 8px;
    }
  }
}

/* #endregion */

/* #region Layout: Product page (single) */
.ywhs_product_based_wholesale_rules_wrapper {
  margin: 12px;
  width: 70%;

  .ywhs_wholesale_rules {
    border: 1px solid #ddd;
  }

  label {
    margin: 0 !important;
  }


  .ywhs_discount_value_header label p {
    text-wrap-mode: nowrap;
    width: fit-content;
  }
}

.ywhs_product_based_wholesale_rules_wrapper, .ywhs_variable_product_based_wholesale_rules_wrapper{
  .ywhs_discount_roles_value {
    border-collapse: collapse;
    border: 1px solid #949494;
    font-size: 12px;
    line-height: 20px;

    th, td {
      border: 1px solid #949494 !important;
    }

    th {
      padding: 16px;
      text-transform: uppercase;
      background: #FAFAFA;
      text-align: left;
      font-weight: 600;
    }

    td {
      padding: 10px 16px !important;
    }

    .ywhs_discount_role_cell { width: 209px; }
    .ywhs_tier_base_price_cell { width: 127px; }
    .ywhs_volume_tier_cell { width: 336px; }

    .ywhs_tier_cell {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    td:first-child {
      padding: 20px 16px;
      font-size: 13px;
    }

    input {
      position: relative;
      z-index: 1;
      width:  100% !important;
    }

    .ywhs_value_input {
      position: relative;
      height: 40px;
    }

    .ywhs_input_suffix {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      font-weight: 500;
      font-size: 13px;
      line-height: 20px;
      z-index: 2;
    }

    .ywhs_tier_volume_container {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .ywhs_tier_volume {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;

      > div {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      > div > span {
        font-weight: 400;
        color: #757575;
      }

      input {
        width: 95px !important;
        min-width: 10px !important;
      }
    }

    .ywhs_add_tier_volume{
      color: #3858E9;
      font-weight: 600;
      display: flex;
      align-items: center;
      cursor: pointer;
      gap: 4px;
      border-radius: 2px;
      width: fit-content;
      padding: 0px 4px;
    }

    .ywhs_add_tier_volume:hover{
      background: #fafafa;
    }

    .ywhs_tier_volume_delete {
      color: #757575;
      cursor: pointer;
      transition: all 0.3;
    }

    .ywhs_tier_volume_delete:hover {
      color: #d50719;
    }

    .ywhs_fixed_rate_type {
      display: none;
    }
  }

  .ywhs_discount_type_trigger {
    position: absolute;
    cursor: pointer;
    padding: 0px 4px;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    z-index: 2;
    border-radius: 2px;
  }

  .ywhs_discount_type_trigger:hover {
    color: #3858E9;
    background: #f4f4f5;
  }

  .ywhs_discount_type_switcher {
    position: relative;
    display: none;
    z-index: 3;
    padding: 0;

    .ywhs_discount_type_menu {
      position: absolute;
      top: 41px;
      right: 0;
      background: #fff;
      box-shadow: 1px 2px 2px 0px #0000000d;
      border-radius: 2px;
      overflow: hidden;
      border: 1px solid #949494;
      transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .ywhs_discount_type_menu > div {
      width: 86px;
      padding: 7px;
      display: flex;
      gap: 8px;
      align-items: center;
      cursor: pointer;
      font-size: 12px;
    }

    .ywhs_discount_type_menu > div:hover{
      background: #f4f4f5;
      color: #3858E9;
    }
  }
}

@media (max-width: 1500px) {
  .ywhs_product_based_wholesale_rules_wrapper {
    width: calc(100% - 24px);
  }
}

/* #endregion  */

/* #region Layout: Product page (variable) */
.ywhs_variable_product_based_wholesale_rules_wrapper {
  display: table;
  width: 100%;

  .ywhs_wholesale_rules {
    border: 1px solid #DDD;

    .ywhs_discount_role_cell { width: 105px; }
    .ywhs_tier_base_price_cell { width: 63px; }
    .ywhs_volume_tier_cell { width: 168px; }
  }
}

/* #endregion */

/* #endregion */

/* #region User page */
/* User wholesaler information */
.ywhs_wholesaler_user_wrapper {
  border-top: none;
  max-width: 575px;

  input:not([type="radio"]):not([type="checkbox"]),
  textarea {
    width: 350px !important;
    resize: none;
  }
}
/* #endregion */
