/*--------------------------------------------------------------
WooCommerce Cart
--------------------------------------------------------------*/

// Right align quantity input in mobile
// Woocommerce breakpoint is at 769px
@media (max-width: 768px) {
  .woocommerce-cart-form .product-quantity .quantity {
    margin-left: auto;
  }
}

// Cart totals
.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals {
  float: none;
  width: 100%;
}

// WooCommerce breakpoints are at 769px
@media (max-width: 768px) {

  // Update cart button
  .shop_table_responsive .actions button:not(.input-group button) {
    width: 100%;
  }

  // Coupon input in cart page
  .woocommerce table.cart td.actions .coupon input,
  .woocommerce-page #content table.cart td.actions .coupon input,
  .woocommerce-page table.cart td.actions .coupon input {
    width: 1%;
  }
}

// Proceed to checkout btn
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  @extend .btn-lg;
  display: block;
}

.wc-block-cart .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
  border-bottom: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default));

  & > *:not(:first-child){
  padding-left: 12px;
  padding-right: 12px;
  }
}

.wc-block-cart .wp-block-woocommerce-cart-order-summary-block{
  border-radius: 10px;
  border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default));
  margin-bottom: 24px;

  & > *:not(:first-child){
    border-top: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default))!important;
  }

  .wc-block-cart__totals-title.wp-block-woocommerce-cart-order-summary-heading-block{
    font-weight: 700;
    padding: 9px 12px !important;
    line-height: 1.5em;
    font-size: 12px;
    color: #9c9c9c;
    text-transform: capitalize;
  }

  .wc-block-components-totals-item__value,
  .wc-block-components-totals-item__label{
    font-size: inherit;
  }

}


.wc-block-components-totals-coupon__form{
  .wc-block-components-text-input.wc-block-components-totals-coupon__input{
    input {
      border: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
      background-color: var(--wpstream-eerie-black) !important;
      border-radius: 8px;
      //padding: 10px 15px !important;
      color: var(--bs-body-content-color) !important;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
      box-shadow: none !important;
    }
    label{
      color: var(--bs-body-content-color) !important;
    }
  }
  button.wp-element-button{
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--bc-body-color);
    font-weight: 500;
    transition: .15s ease-in-out;
    margin-left: unset;
    &:hover {
      background: var(--add-to-cart-button-normal);
      color: var(--bc-body-color);
      border: 1px solid var(--bs-body-color);
    }
  }
}

table.wc-block-cart-items.wp-block-woocommerce-cart-line-items-block {
  .wc-block-cart-items__row {
    td{
      border-top: 1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default))!important;
      padding: 9px 12px;
    }
    .wc-block-cart-item__prices {
      color: #4CBB17;
    }

    .wc-block-cart-item__image img {
      max-width: unset;
      width: 168px;
      height: 94px !important;
      border-radius: 8px;
      object-fit: cover;
    }
  }
}

.wc-block-cart-items.wp-block-woocommerce-cart-line-items-block,
.woocommerce table.shop_table {
  border:1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default))!important;
  border-radius: 10px!important;
  border-collapse: unset;
  overflow: hidden;
  

  th {
    font-size: 12px;
    color: #9c9c9c;
  }

  td {
    border-color: #2f2f35 !important;
  }

  td.product-price {
    .amount {
      color: #4CBB17;
    }
  }

  .cart_item {
    .product {
      display: flex;
      flex-direction: row;
      gap: 12px;
      align-items: center;

      .product-thumbnail {
        position: relative;

        img {
          width: 168px;
          height: 94px !important;
          border-radius: 8px;
          object-fit: cover;
        }

        .product-views {
          position: absolute;
          left: 8px;
          bottom: 8px;
          padding: 2px 8px;
          background-color: rgba(24, 24, 27, 0.75);
          color: $anti-flash-white;
          border-radius: 8px;
        }
      }

      .product-remove {
        a {
          padding: 6px 9px;
          border-radius: 8px;
          background-color: var(--wpstream-product-remove);
          color: var(--bs-body-color) !important;

          &:hover {
            color: rgb(255, 6, 6) !important;
          }
        }
      }
    }
  }

  .actions {
    padding: 24px;
  }
}

.quantity > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  border-top-left-radius: 24px;
  border-bottom-left-radius: 24px;
}

.wc-block-cart-item__quantity .wc-block-components-quantity-selector {

  input.wc-block-components-quantity-selector__input {
    border-left: 1px solid var(--wpstream-line-color);
    border-right: 1px solid var(--wpstream-line-color);
    background-color: var(--wpstream-eerie-black);
    padding: 10px 15px;
    color: var(--bs-body-content-color);
  }

  .wc-block-components-quantity-selector__button:focus {
    box-shadow: none;
  }
}

.woocommerce-mini-cart-item .quantity{
  margin-left: 5px;
}


.woocommerce .quantity,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input{

  flex-shrink: 0;

  .qty {
    width: 52px !important;
  }
}

.input-group-text.btn.btn-outline-primary {
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
  border-color: var(--middle-grey);
  background-color: transparent;
  color: var(--bc-body-color);
  font-weight: 500;

  &:hover {
    background-color: var(--bs-body-color);
    color: var(--bs-body-bg);
    border: 1px solid var(--bs-body-color);
  }
}

.btn-outline-primary {
  border-radius: 24px;
  padding: 10px 20px;
  border: none;
  background: var(--wpstream-button-color-bg);
  color:var(--wpstream-button-color-text);
  
  &:hover {
    color: $anti-flash-white!important;
    background: var(--add-to-cart-button-normal) !important;

  }
}

.woocommerce-mini-cart__buttons {
  gap: 10px;

  .btn-primary {
    border-radius: 24px;
    padding: 10px 20px;
  }
}

.btn-outline-primary:disabled {
  border: 1px solid var(--middle-grey);
  color: var(--middle-grey);
  font-weight: 500;
}

.woocommerce-cart .cart-collaterals .cart_totals tr th {
  border-color: #2f2f35 !important;
  font-size: 16px;
  color: var(--bs-body-color);
}

.woocommerce-cart .cart-collaterals .cart_totals .cart-subtotal {
  .amount {
    color: #9c9c9c;
  }
}

.wc-block-cart__submit-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  font-size: 16px;
  font-weight: 500;
  background: linear-gradient(
    var(--wpstream-type-1-button-background-color-gradient-angle, 90deg),
    var(--wpstream_type_1_button_background_color_gradient_first_color, rgba(78, 46, 229, 1)),
    var(--wpstream_type_1_button_background_color_gradient_second_color, rgba(89, 125, 250, 1))
  );
  border-radius: 24px;
  transition: all 300ms ease;
  border-width: var(--wpstream-type-1-button-border-width, 0);
  border-style: solid;
  border-color: var(--wpstream-type-1-button-border-color, transparent);
  padding: 12px 20px;
  color: var(--wpstream-type-1-button-text-color, $anti-flash-white);
  &:hover{
    background: linear-gradient(
      var(--wpstream-type-1-button-hover_background-color-gradient-angle, 90deg),
      var(--wpstream_type_1_button_hover_background_color_gradient_first_color, rgba(78, 46, 229, 1)),
      var(--wpstream_type_1_button_hover_background_color_gradient_second_color, rgba(89, 125, 250, 1))
    ) !important;
    color:$anti-flash-white;
  }
}

.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container:after {
    border-left:1px solid var(--wpstream-header-search-border-color, var(--wpstream-header-search-border-color-default)) !important;
  }

// Styling for the cart page
.wc-block-components-product-name,
.wc-block-components-product-metadata__description,
.wc-block-cart-item__remove-link {
  font-size: var(--wpstream_woocommerce_cart_font_size, 16px) !important;
  color: var(--wpstream_woocommerce_cart_font_color, #0d6efd) !important;
}

.wc-block-components-quantity-selector__button,
.wc-block-components-quantity-selector__input {
  color: var(--wpstream_woocommerce_cart_font_color, #0d6efd) !important;
}

.wc-block-cart-item__total .wc-block-components-product-price__value {
  font-size: var(--wpstream_woocommerce_cart_font_size, 16px);
  color: var(--wpstream_woocommerce_cart_font_color, #0d6efd);
}

.wc-block-components-quantity-selector {
  width: fit-content !important;
}

.wc-block-components-formatted-money-amount {
  font-size: var(--wpstream_woocommerce_cart_font_size, 16px);
}