/* VLT WBC - quantity buttons (product + cart + checkout)
   Goal: touch-friendly, consistent sizing across themes.
   We use higher specificity + !important because many themes ship strong quantity styles.
*/

.woocommerce div.product form.cart .quantity,
.woocommerce-page div.product form.cart .quantity,
.woocommerce .quantity,
.woocommerce-page .quantity {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* Cart page: many themes remove borders/positioning for qty controls.
   Force consistent sizing and visible controls.
*/
.woocommerce-cart table.shop_table td.product-quantity,
.woocommerce-cart table.shop_table td.product-quantity .quantity,
.woocommerce-cart .woocommerce-cart-form td.product-quantity,
.woocommerce-cart .woocommerce-cart-form td.product-quantity .quantity {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.woocommerce-cart table.shop_table input.qty,
.woocommerce-cart table.shop_table .quantity input.qty,
.woocommerce-cart .woocommerce-cart-form input.qty,
.woocommerce-cart .woocommerce-cart-form .quantity input.qty {
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  font-size: 20px !important;
  line-height: 1 !important;
  text-align: center !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
}

/* Some themes render a visible number as a span/div and hide the input.
   Make sure that variant is also boxed.
*/
.woocommerce-cart table.shop_table .quantity .qty:not(input),
.woocommerce-cart .woocommerce-cart-form .quantity .qty:not(input) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  padding: 8px 12px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  text-align: center !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
}

.woocommerce-cart table.shop_table .plus,
.woocommerce-cart table.shop_table .minus,
.woocommerce-cart .woocommerce-cart-form .plus,
.woocommerce-cart .woocommerce-cart-form .minus {
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  color: inherit !important;
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  line-height: 1 !important;
  padding: 0 !important;
  position: static !important;
  float: none !important;
  margin: 0 !important;
}

.woocommerce-cart .quantity input.qty,
.woocommerce-cart .quantity .qty {
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
}

.woocommerce-cart .quantity .plus,
.woocommerce-cart .quantity .minus,
.woocommerce-cart .quantity button,
.woocommerce-cart .quantity input[type="button"],
.woocommerce-cart .quantity a {
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  color: inherit !important;
  position: static !important;
  float: none !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Add breathing room between quantity controls and the add-to-cart button (single product) */
.single-product .woocommerce div.product form.cart .quantity,
.woocommerce.single-product div.product form.cart .quantity {
  margin-bottom: 14px !important;
}

/* Input */
.woocommerce div.product form.cart .quantity .qty,
.woocommerce-page div.product form.cart .quantity .qty,
.woocommerce div.product form.cart .quantity input.qty,
.woocommerce-page div.product form.cart .quantity input.qty {
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  font-size: 20px !important;
  line-height: 1;
  text-align: center !important;
  border-radius: 12px !important;
}

/* Fallback (themes that don't wrap qty in form.cart) */
.woocommerce .quantity .qty,
.woocommerce-page .quantity .qty,
.woocommerce .quantity input.qty,
.woocommerce-page .quantity input.qty {
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  box-sizing: border-box !important;
  font-size: 20px !important;
  text-align: center !important;
  border-radius: 12px !important;
}

/* +/- buttons (various themes/plugins) */
.woocommerce div.product form.cart .quantity button,
.woocommerce-page div.product form.cart .quantity button,
.woocommerce div.product form.cart .quantity .plus,
.woocommerce div.product form.cart .quantity .minus,
.woocommerce-page div.product form.cart .quantity .plus,
.woocommerce-page div.product form.cart .quantity .minus,
.woocommerce div.product form.cart .quantity a,
.woocommerce-page div.product form.cart .quantity a {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  line-height: 1;
  padding: 0 !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  color: inherit !important;
  cursor: pointer;
  user-select: none;
}

/* Extra theme variants */
.woocommerce .quantity .qty-plus,
.woocommerce .quantity .qty-minus,
.woocommerce-page .quantity .qty-plus,
.woocommerce-page .quantity .qty-minus,
.woocommerce .quantity .quantity-plus,
.woocommerce .quantity .quantity-minus,
.woocommerce-page .quantity .quantity-plus,
.woocommerce-page .quantity .quantity-minus,
.woocommerce .buttons_added .plus,
.woocommerce .buttons_added .minus,
.woocommerce-page .buttons_added .plus,
.woocommerce-page .buttons_added .minus {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  line-height: 1 !important;
  padding: 0 !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  color: inherit !important;
  position: static !important;
  float: none !important;
  margin: 0 !important;
}

/* Hover/focus */
.woocommerce div.product form.cart .quantity button:hover,
.woocommerce-page div.product form.cart .quantity button:hover,
.woocommerce div.product form.cart .quantity .plus:hover,
.woocommerce div.product form.cart .quantity .minus:hover,
.woocommerce-page div.product form.cart .quantity .plus:hover,
.woocommerce-page div.product form.cart .quantity .minus:hover,
.woocommerce div.product form.cart .quantity button:focus,
.woocommerce-page div.product form.cart .quantity button:focus {
  border-color: rgba(0,0,0,.32);
  outline: none;
}

/* Woo Blocks quantity selector (if used) */
.wc-block-components-quantity-selector {
  gap: 12px !important;
}
.wc-block-components-quantity-selector__input {
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  font-size: 20px !important;
  line-height: 1;
  border-radius: 12px !important;
}
.wc-block-components-quantity-selector__button {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  font-size: 26px !important;
  line-height: 1;
}


/* Cart page: remove theme wrapper boxes/pseudo elements that can overlap the qty number */
.woocommerce-cart table.shop_table td.product-quantity .quantity,
.woocommerce-cart table.shop_table td.product-quantity .quantity.buttons_added {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  position: static !important;
}
.woocommerce-cart table.shop_table td.product-quantity .quantity::before,
.woocommerce-cart table.shop_table td.product-quantity .quantity::after,
.woocommerce-cart table.shop_table td.product-quantity .quantity.buttons_added::before,
.woocommerce-cart table.shop_table td.product-quantity .quantity.buttons_added::after {
  content: none !important;
  display: none !important;
}

/* Some themes place the + button outside .quantity; ensure it matches */
.woocommerce-cart table.shop_table td.product-quantity .plus,
.woocommerce-cart table.shop_table td.product-quantity .minus {
  position: static !important;
  float: none !important;
  box-shadow: none !important;
}

/* Ensure the qty input is the visible "center" box (no giant wrapper behind it) */
.woocommerce-cart table.shop_table td.product-quantity input.qty {
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  border-radius: 12px !important;
  border: 1px solid #cfd6dd !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
  text-align: center !important;
  font-size: 20px !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}


/* Small screens: ensure spacing doesn't collapse */
@media (max-width: 480px) {
  .woocommerce .quantity { gap: 10px !important; }
}

/* Mobile: some themes overlap the add-to-cart button over the quantity row.
   Force a clean vertical flow: quantity on its own row + spacing before the button.
*/
@media (max-width: 768px) {
  .single-product .woocommerce div.product form.cart,
  .woocommerce.single-product div.product form.cart {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .single-product .woocommerce div.product form.cart .quantity,
  .woocommerce.single-product div.product form.cart .quantity {
    justify-content: center !important;
    margin-bottom: 18px !important;
  }

  .single-product .woocommerce div.product form.cart .single_add_to_cart_button,
  .woocommerce.single-product div.product form.cart .single_add_to_cart_button,
  .single-product .woocommerce div.product form.cart button.single_add_to_cart_button {
    width: min(320px, calc(100% - 32px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    clear: both !important;
    position: static !important;
    margin-top: 0 !important;
    /* Force perfect horizontal+vertical centering, even with aggressive theme rules */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  /* If the theme wraps button text in a span, center that too */
  .single-product .woocommerce div.product form.cart .single_add_to_cart_button > span,
  .woocommerce.single-product div.product form.cart .single_add_to_cart_button > span {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
  }

  /* Some themes wrap button text in a span; force centering */
  .single-product .woocommerce div.product form.cart .single_add_to_cart_button span,
  .woocommerce.single-product div.product form.cart .single_add_to_cart_button span {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
  }
}

/* WooCommerce Blocks quantity selector (Cart/Checkout Blocks)
   Some themes style the selector container as a grey box which can overlap the number.
   We remove container background/border and style the buttons + input individually.
*/
.wc-block-components-quantity-selector,
.wp-block-woocommerce-cart .wc-block-components-quantity-selector,
.wp-block-woocommerce-checkout .wc-block-components-quantity-selector {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.wc-block-components-quantity-selector::before,
.wc-block-components-quantity-selector::after {
  content: none !important;
  display: none !important;
}

.wc-block-components-quantity-selector__button,
.wp-block-woocommerce-cart .wc-block-components-quantity-selector__button,
.wp-block-woocommerce-checkout .wc-block-components-quantity-selector__button {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  line-height: 1 !important;
  padding: 0 !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  color: inherit !important;
  position: static !important;
  box-shadow: none !important;
}

.wc-block-components-quantity-selector__input,
.wc-block-components-quantity-selector input,
.wp-block-woocommerce-cart .wc-block-components-quantity-selector__input,
.wp-block-woocommerce-checkout .wc-block-components-quantity-selector__input {
  width: 86px !important;
  min-width: 86px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 52px !important;
  text-align: center !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.22) !important;
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Extra-specific override to beat aggressive theme rules (Cart/Checkout Blocks) */
.wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input,
.wp-block-woocommerce-checkout .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 52px !important;
  box-sizing: border-box !important;
}

/* Ensure any wrapping 'grey box' elements inside blocks selector are neutralized */
.wc-block-components-quantity-selector > * {
  background: transparent !important;
  box-shadow: none !important;
}
