/*--------------------------------------------------------------
WooCommerce Checkout
--------------------------------------------------------------*/

// Reset coupon collapse
.woocommerce form {
  &.checkout_coupon,
  &.login,
  &.register {
    border: none;
    padding: 0;
    margin: 0;
  }
}

// Hide Paypal img and link
#payment .payment_method_paypal img,
.woocommerce-checkout #payment .payment_method_paypal .about_paypal {
  display: none;
}

// Override WC border-radius: 5px; in #payment card
#add_payment_method #payment, .woocommerce-cart #payment,
.woocommerce-checkout #payment {
  border-radius: $border-radius;
}

// Set shipping table to top
.woocommerce-shipping-totals th {
  vertical-align: top;
}

// Terms & conditions collapse box
.woocommerce .woocommerce-terms-and-conditions,
.woocommerce-page .woocommerce-terms-and-conditions {
  border: none;
  box-shadow: none;
  border-radius: $border-radius;
  margin-bottom: 1rem;
  padding: 1rem;
}

// Adjust terms checkboxes
.woocommerce form .form-row .input-checkbox {
  margin: 0.25em 0 0 -1.5rem;
  vertical-align: top;
}

// Place order button
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 0;
  float: none;
}

// Custom styles
.wpstream-billing-fields {
  padding: 72px;
  border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
  border-radius: 8px;

  label {
    margin-bottom: 4px;
  }

  input {
    border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
    border-radius: 24px;
    background-color: var(--wpstream-eerie-black);
  }
}

.woocommerce-checkout {
  .select2-dropdown {
    background-color: var(--wpstream-eerie-black) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
    border-radius: 0 0 24px 24px !important;

    input {
      border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
      color: var(--bs-body-color);
      background-color: var(--wpstream-eerie-black);
    }
  }

  .select2-search--dropdown {
    padding: 4px 16px;
  }

  .select2-container {
    background-color: var(--wpstream-eerie-black);
    border-radius: 24px;
    height: 44px;
  }

  .select2-container--open .select2-dropdown--above {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  .select2-results__option {
    padding: 6px 16px;
  }

  .select2-results__option[data-selected=true] {
    background-color: var(--bs-body-color) !important;
    color: var(--wpstream-eerie-black) !important;
  }

  .select2-container--default {
    .select2-selection--single {
      background-color: var(--wpstream-eerie-black);
      height: 44px;
      border-radius: 24px;
      border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;

      .select2-selection__rendered {
        color: var(--bs-body-color) !important;
        line-height: 44px;
        padding-left: 16px;
      }

      .select2-selection__arrow {
        top: 10px;
        right: 16px;
      }
    }
  }

  .select2-results__option--highlighted[data-selected] {
    background-color: #4e2ee5 !important;
    color: #f1f1f1 !important;
  }
}

.select2-selection__arrow {
  &:before {
    top: 0;
    position: absolute;
    content: url("../img/icons/select_arrow.svg");
    transition: all 300ms ease;
  }

  b {
    display: none;
  }
}

.select2-container--default.select2-container--open .select2-selection--single {
  .select2-selection__arrow {
    &:before {
      top: -10px;
      transform: rotate(180deg);
    }
  }
}

// Order review
.woocommerce-checkout {
  .shop_table {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid #2f2f35;
    border-radius: 8px;
  }

  .shop_table_header,
  .cart_item {
    padding: 13px 16px;
    border-bottom: 1px solid #2f2f35;
    display: grid;
  }

  .shop_table_header {
    grid-template-columns: 1fr 1fr;
  }

  .cart_item {
    grid-template-columns: 2fr 1fr;

    .product-total {
      color: #4CBB17;
    }
  }

  .product-total {
    text-align: right;
    color: #4CBB17;
  }

  .cart-subtotal,
  .order-total {
    padding: 13px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cart-subtotal,
  .order-total {
    span:nth-child(2) {
      text-align: right;
    }
  }

  .cart-subtotal {
    border-bottom: 1px solid #2f2f35;
  }

  #place_order {
    background: var(--add-to-cart-button-normal);
    border-radius: 24px;
    transition: all 300ms ease;
    border: none;

    &:hover {
      background: var(--add-to-cart-button-hover);
    }
  }

  .woocommerce-checkout-payment {
    margin-top: 32px;

    .card-body {
      padding: 0;

      .wc_payment_methods {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        border-bottom: none !important;

        .payment_box {
          background-color: var(--bs-body-bg) !important;

          &:before {
            content: none !important;
          }
        }
      }

      .form-check {
        padding: 0;

        .form-check-input {
          display: none;
        }

        .form-check-label {
          padding: 10px 20px;
          border-radius: 24px;
          border: 1px solid #67676b;
          transition: all 300ms ease;

          &:hover {
            background-color: var(--secondary-white-color);
            border: 1px solid var(--secondary-white-color);
            color: var(--night-color);
            cursor: pointer;
          }
        }

        input.form-check-input[type="radio"]:checked {
          + {
            .form-check-label {
              background-color: var(--secondary-white-color);
              border: 1px solid var(--secondary-white-color);
              color: var(--night-color);
            }
          }
        }
      }
    }

    .woocommerce-privacy-policy-text {
      a {
        color: var(--argintinian-blue);
      }
    }
  }
}

.woocommerce-additional-fields {
  margin-top: 16px;

  label{
    margin-bottom: 4px;
  }
}

.woocommerce table.shop_table tfoot th {
  border-color: #2F2F35 !important;
}

.woocommerce-order-received .wpstream-order-details-table{
  max-width: 100%;
}