/* 1. Container Layout (Handles both Simple and Variable products) */
form.cart:not(.variations_form),
.woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    align-items: stretch !important;
}

/* Reset margins that WooCommerce might add to the wrapper */
.woocommerce-variation-add-to-cart {
    margin-top: 15px !important;
}

/* 2. Quantity Box (Matches your original .custom-quantity-box) */
form.cart .quantity {
    display: flex !important;
    border: 1px solid #ccc !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    width: calc(50% - 7.5px) !important;
    margin: 0 !important; /* Override Woo default margins */
}

form.cart .quantity .qty-btn {
    background: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

form.cart .quantity .qty-btn img {
    width: 25px;
}

form.cart .quantity .qty-btn:hover {
    background: #e8e8e8;
}

form.cart .quantity input.qty {
    border: none !important;
    text-align: center;
    flex: 1;
    padding: 10px;
    font-size: 20px;
    font-weight: 600;
    width: 100% !important;
    -moz-appearance: textfield;
    background: transparent;
    margin: 0 !important;
}

form.cart .quantity input.qty::-webkit-outer-spin-button,
form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 3. Add to Cart Button (Matches your original .custom-add-to-cart) */
form.cart .single_add_to_cart_button {
    width: calc(50% - 7.5px) !important;
    padding: 12px 24px !important;
    border: solid 1px #ccc !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: #0a0c37 !important;
    text-transform: uppercase !important;
    margin: 0 !important; /* Override Woo default margins */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
}

form.cart .single_add_to_cart_button:hover {
    background: #f5f5f5 !important;
}

/* 4. Buy Now Button (Matches your original .custom-buy-now) */
form.cart .custom-buy-now {
    width: 100% !important;
    order: 3 !important; /* Forces it to the bottom row */
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    background: #720014 !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    transition: all 0.3s ease;
}

form.cart .custom-buy-now:hover {
    background: #04093c !important;
}

form.cart .custom-buy-now img {
    width: 20px;
    margin-left: 20px;
    transition: all 0.5s ease-in-out;
}

form.cart .custom-buy-now:hover img {
    transform: translateX(10px);
}