/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/


@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}

// Add Buy Now button next to Add to Cart in Flatsome
add_action( 'woocommerce_after_add_to_cart_button', 'sareegant_buy_now_button', 20 );

function sareegant_buy_now_button() {
    global $product;
    if ( $product->is_type( 'simple' ) ) {
        $checkout_url = wc_get_checkout_url();
        echo '<a href="' . esc_url( $checkout_url . '?add-to-cart=' . $product->get_id() ) . '" class="button alt buy-now" style="margin-left:10px;">Buy Now</a>';
    }
}
/* Style cart table headers */
.woocommerce-cart table.shop_table th {
    background: #f5f5f5;
    font-weight: 600;
    padding: 12px;
    text-transform: uppercase;
}

/* Cart product name */
.woocommerce-cart table.shop_table td.product-name a {
    color: #800020; /* burgundy style */
    font-weight: 500;
}

/* Update & Checkout buttons */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    background: #800020;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    padding: 14px 24px;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: #a83244;
}
/* Checkout section titles */
.woocommerce-checkout h3 {
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #eee;
    padding-bottom: 6px;
    margin-bottom: 15px;
    color: #333;
}

/* Input fields */
.woocommerce-checkout .input-text {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    font-size: 14px;
    width: 100%;
}

/* Place Order button */
.woocommerce-checkout #place_order {
    background: #800020;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 14px 28px;
    border-radius: 6px;
    transition: background 0.3s ease;
}
.woocommerce-checkout #place_order:hover {
    background: #a83244;
}
