/*
Theme Name:   Astra Child
Theme URI:    https://wpastra.com/
Description:  Astra Child Theme with Custom WooCommerce Quantity Buttons
Author:       Your Name
Template:     astra
Version:      3.1.0
License:      GNU General Public License v2 or later
Text Domain:  astra-child
*/

/* =============================================
   Product Page — Cart Form Layout
   ============================================= */

.woocommerce div.product .price {
    margin-bottom: 20px !important;
}

.woocommerce form.cart {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
}

/* Quantity wrapper — product page */
.woocommerce div.product form.cart div.quantity {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    border: 1.5px solid #ccc !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #fff !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    width: fit-content !important;
    flex-shrink: 0;
}

.woocommerce .quantity * {
    margin: 0 !important;
    float: none !important;
}

/* +/- buttons — shared */
.qty-minus,
.qty-plus {
    width: 44px !important;
    height: 48px !important;
    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    color: #444 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    transition: background 0.15s;
}

.qty-minus:hover, .qty-plus:hover {
    background: #e4e4e4 !important;
    color: #111 !important;
}

.qty-minus:active, .qty-plus:active {
    background: #d5d5d5 !important;
}

/* Number input — shared */
.woocommerce input[type=number].qty,
.woocommerce input[type=number].input-text.qty {
    width: 54px !important;
    min-width: 54px !important;
    height: 48px !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: #fff !important;
    color: #333 !important;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    flex-shrink: 0 !important;
}

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

/* Add to cart button */
.woocommerce div.product form.cart .single_add_to_cart_button {
    height: 48px !important;
    padding: 0 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 0 0 14px !important;
    font-size: 15px !important;
    border-radius: 6px !important;
    flex-shrink: 0;
}

/* Extra payment buttons (Google Pay etc.) — new row */
.woocommerce form.cart > *:not(.quantity):not(.single_add_to_cart_button) {
    flex-basis: 100% !important;
    width: 100% !important;
    margin-top: 12px !important;
}

/* Text below cart form */
.woocommerce form.cart ~ p,
.woocommerce form.cart + p {
    margin-top: 14px !important;
    margin-bottom: 10px !important;
}

/* =============================================
   Cart Page — Quantity Flex Wrap (via JS)
   ============================================= */

.qty-flex-wrap {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    border: 1.5px solid #ccc !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #fff !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    gap: 0 !important;
    width: fit-content !important;
}

.qty-flex-wrap .qty-minus,
.qty-flex-wrap .qty-plus {
    width: 38px !important;
    height: 44px !important;
}

.qty-flex-wrap input[type=number].qty,
.qty-flex-wrap input[type=number].input-text.qty {
    width: 46px !important;
    min-width: 46px !important;
    height: 44px !important;
}

/* Hide original stacked buttons on cart page */
.woocommerce-cart td.product-quantity > .qty-minus,
.woocommerce-cart td.product-quantity > .qty-plus {
    display: none !important;
}
