/*
Theme Name:   Bw Printxtore Child
Theme URI:    https://bw-printxtore.bzotech.com/intro/
Author:       The BZOTech
Author URI:   https://bzotech.com/
Description: PrintXtore - A stunning WooCommerce WordPress theme with a flexible style for online product design and printing services!
Template:     bw-printxtore
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: art prints, artist gallery, online design, poster, print, print on demand, print shop, print store, printing, printshop, product design, product designer, t-shirt, T-shirt Designer
Text Domain: bw-printxtore-child
*/

/**
 * Checkout Page Improvements
 */

/* 1. Layout & Section Grouping */
.woocommerce-checkout .woocommerce {
    background: #f9f9f9;
    padding: 30px 0;
}

.woocommerce-checkout #customer_details, 
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.woocommerce-checkout h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #333;
}

/* 2. Form Field Enhancements */
.woocommerce-checkout .form-row input.input-text, 
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 12px 15px !important;
    font-size: 15px !important;
    transition: all 0.3s ease;
    background-color: #fff !important;
}

.woocommerce-checkout .form-row input.input-text:focus, 
.woocommerce-checkout .form-row textarea:focus {
    border-color: #007cba !important;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* 3. Order Summary & Sticky Sidebar (Desktop) */
@media (min-width: 992px) {
    .woocommerce-checkout form.checkout {
        display: flex;
        flex-wrap: wrap;
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .woocommerce-checkout #customer_details {
        flex: 0 0 60%;
        max-width: 60%;
        padding: 0 15px;
        background: transparent;
        box-shadow: none;
    }

    .woocommerce-checkout #customer_details .col-1,
    .woocommerce-checkout #customer_details .col-2 {
        background: #fff;
        padding: 25px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
    }

    .woocommerce-checkout #order_review_heading {
        display: none; /* Usually redundant with the card title */
    }

    .woocommerce-checkout #order_review {
        flex: 0 0 40%;
        max-width: 40%;
        padding: 0 15px;
        background: transparent;
        box-shadow: none;
    }
    
    .woocommerce-checkout .woocommerce-checkout-review-order {
        position: sticky;
        top: 20px;
    }
}

/* 4. Payment & Shipping Options Styling */
.woocommerce-checkout #payment ul.payment_methods {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0 !important;
    overflow: hidden;
}

.woocommerce-checkout #payment ul.payment_methods li {
    padding: 15px 20px !important;
    border-bottom: 1px solid #eee;
    margin: 0 !important;
    background: #fcfcfc;
}

.woocommerce-checkout #payment ul.payment_methods li:last-child {
    border-bottom: none;
}

.woocommerce-checkout #payment ul.payment_methods li input[type="radio"] {
    margin-right: 10px !important;
}

.woocommerce-checkout #payment div.payment_box {
    background: #f5f5f5 !important;
    border-radius: 4px;
    margin-top: 10px !important;
    padding: 15px !important;
}

.woocommerce-checkout #payment div.payment_box::before {
    display: none !important;
}

/* 5. Radio Buttons & Checkboxes Polish */
.woocommerce-checkout input[type="radio"],
.woocommerce-checkout input[type="checkbox"],
.woocommerce-checkout .woocommerce-form__input-checkbox,
.woocommerce-checkout .input-checkbox {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    display: inline-block !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    position: relative !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

/* Radio Button Style */
.woocommerce-checkout input[type="radio"] {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
}

.woocommerce-checkout input[type="radio"]:checked {
    border-color: #e63946 !important;
    border-width: 7px !important;
}

/* Checkbox Style */
.woocommerce-checkout input[type="checkbox"],
.woocommerce-checkout .woocommerce-form__input-checkbox,
.woocommerce-checkout .input-checkbox {
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
}

.woocommerce-checkout input[type="checkbox"]:checked,
.woocommerce-checkout .woocommerce-form__input-checkbox:checked,
.woocommerce-checkout .input-checkbox:checked {
    background-color: #e63946 !important;
    border-color: #e63946 !important;
}

.woocommerce-checkout input[type="checkbox"]:checked::after,
.woocommerce-checkout .woocommerce-form__input-checkbox:checked::after,
.woocommerce-checkout .input-checkbox:checked::after {
    content: "" !important;
    position: absolute !important;
    left: 6px !important;
    top: 2px !important;
    width: 6px !important;
    height: 11px !important;
    border: solid #fff !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

/* Remove weird theme borders/psuedo-elements */
.woocommerce-checkout input[type="radio"]::before,
.woocommerce-checkout input[type="radio"]::after,
.woocommerce-checkout input[type="checkbox"]::before,
.woocommerce-checkout .woocommerce-form__input-checkbox::before,
.woocommerce-checkout .input-checkbox::before {
    display: none !important;
    content: none !important;
}

/* Fix Label alignment */
.woocommerce-checkout .form-row label.checkbox,
.woocommerce-checkout .woocommerce-form__label-for-checkbox,
.woocommerce-checkout #ship-to-different-address label {
    display: flex !important;
    align-items: center !important;
    padding: 12px 0 !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
}

.woocommerce-checkout #ship-to-different-address label {
    font-size: 18px !important;
    font-weight: 600 !important;
}

/* Payment & Shipping Methods Layout Fix */
.woocommerce-checkout #payment ul.payment_methods li label,
.woocommerce-checkout ul#shipping_method li label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Fix for the "pill" containers if they are divs/spans around inputs */
.woocommerce-checkout .woocommerce-form__input-checkbox-wrapper {
    display: inline-flex !important;
    align-items: center !important;
}

/* 6. Place Order Button & Global Button Redesign */
.woocommerce-checkout #place_order,
.button, 
.woocommerce a.button, 
.woocommerce button.button, 
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce div.product form.cart button.single_add_to_cart_button {
    background-color: #e63946 !important; /* Vibrant Red */
    color: #fff !important;
    border: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2) !important;
}

.woocommerce-checkout #place_order:hover,
.button:hover, 
.woocommerce a.button:hover, 
.woocommerce button.button:hover, 
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce div.product form.cart button.single_add_to_cart_button:hover {
    background-color: #d62828 !important; /* Darker Red */
    box-shadow: 0 6px 18px rgba(230, 57, 70, 0.3) !important;
    transform: translateY(-2px);
    color: #fff !important;
}

.woocommerce-checkout #place_order {
    width: 100%;
    padding: 20px !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px !important;
    margin-top: 25px;
}

/* 7. Hide radio buttons if only one option exists */
/* Shipping Methods */
#shipping_method li input[type="radio"]:only-child,
#shipping_method li:only-child input[type="radio"],
.woocommerce-shipping-methods li input[type="radio"]:only-child,
.woocommerce-shipping-methods li:only-child input[type="radio"],
#shipping_method input[type="radio"]:first-child:nth-last-child(1),
.woocommerce-shipping-methods input[type="radio"]:first-child:nth-last-child(1) {
    display: none !important;
}

/* Payment Methods */
.wc_payment_methods li input[type="radio"]:only-child,
.wc_payment_methods li:only-child input[type="radio"],
.payment_methods li input[type="radio"]:only-child,
.payment_methods li:only-child input[type="radio"],
.wc_payment_methods input[type="radio"]:first-child:nth-last-child(1),
.payment_methods input[type="radio"]:first-child:nth-last-child(1) {
    display: none !important;
}

/* Hide labels that are alone if they are just placeholders for the radio */
/* (Not usually the case, but covering bases) */

/* Force Red color for any remaining radio/checkbox even if theme tries to use blue */
.woocommerce-checkout input[type="radio"]:checked,
.woocommerce-checkout input[type="checkbox"]:checked,
.woocommerce-checkout .woocommerce-form__input-checkbox:checked,
.woocommerce-checkout .input-checkbox:checked,
.woocommerce #payment ul.payment_methods li input[type="radio"]:checked,
#shipping_method input[type="radio"]:checked,
.wc_payment_methods input[type="radio"]:checked,
.woocommerce-shipping-methods input[type="radio"]:checked {
    accent-color: #e63946 !important;
}

.woocommerce-checkout input[type="radio"]:checked {
    border-color: #e63946 !important;
    border-width: 7px !important;
    background-color: #fff !important;
}

/* Specific overrides for shipping/payment if they use different structure or pseudo-elements on labels */
#shipping_method input[type="radio"]:checked + label::before,
.wc_payment_methods input[type="radio"]:checked + label::before,
ul.payment_methods input[type="radio"]:checked + label::before {
    border-color: #e63946 !important;
    background-color: #e63946 !important;
    background-image: radial-gradient(circle, #fff 35%, transparent 40%) !important;
}

/* Adjust label padding when radio is hidden */
#shipping_method li:only-child label,
.wc_payment_methods li:only-child label,
.payment_methods li:only-child label,
#shipping_method li label:only-child,
.wc_payment_methods li label:only-child {
    padding-left: 0 !important;
}

/* 8. Coupon form polish */
.woocommerce-checkout .checkout_coupon {
    border: 1px dashed #ccc !important;
    padding: 20px !important;
    border-radius: 6px;
    margin-bottom: 25px !important;
}

/* 9. Global Brand Color Override (Blue to Red) */
:root {
    --bzo-main-color: #e63946 !important;
}

.e-main-color, 
.text-primary,
.bg-primary {
    color: #e63946 !important;
}

.bg-primary {
    background-color: #e63946 !important;
}