/**
 * RG Fixes CSS
 * Fixes for specific WooCommerce pages.
 */

/* Cart Page - Hide duplicate title */
.woocommerce-cart .wp-block-post-title {
    display: none !important;
}

/* Checkout Page Styling */
/* Force purple color on headings with high specificity overrides */
body.woocommerce-checkout h3#order_review_heading,
body.woocommerce-checkout .woocommerce-billing-fields h3,
body.woocommerce-checkout .woocommerce-shipping-fields h3,
body.woocommerce-checkout #order_review_heading {
    color: var(--rg-primary, #7C3AED) !important;
}

.woocommerce-checkout-review-order {
    width: 100%;
}

/* Helper to clean up standard woo floats if they interfere with grid */
.woocommerce-checkout:after {
    display: none;
}

/* Desktop Grid Fixes */
@media (min-width: 1024px) {
    /* 
       The theme uses a Grid on form.checkout.
       We need to ensure the Left Column (Customer Details) spans 2 rows,
       so that the Right Column elements (Heading + Review) can stack primarily in column 2 
       without being pushed down by the height of Column 1.
    */

    /* Left Column: Customer Details */
    #customer_details {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        /* Spans 2 rows */
        width: 100%;
        /* Ensure it fills specific grid width if set, or usually 100% of col */
    }

    /* Right Column Top: Heading */
    #order_review_heading {
        grid-column: 2 / 3;
        grid-row: 1;
        width: 100%;
        margin-top: 0;
        align-self: start;
    }

    /* Right Column Bottom: Review Block */
    .woocommerce-checkout-review-order {
        grid-column: 2 / 3;
        grid-row: 2;
        width: 100%;
        align-self: start;
        margin-top: 20px;
        /* Space between heading and table */
    }
}

/* Tablet & Mobile: Stack vertically */
@media (max-width: 1023px) {
    form.checkout {
        display: block !important;
        /* Force block flow on mobile to stack everything */
    }

    .col2-set,
    #customer_details,
    #order_review_heading,
    .woocommerce-checkout-review-order {
        width: 100% !important;
        float: none !important;
        margin-right: 0;
        grid-column: auto !important;
        grid-row: auto !important;
        margin-bottom: 2rem;
    }
}

/* Global Table Fixes */
.woocommerce-page table.shop_table {
    width: 100% !important;
}

/* Footer SVGs */
.rg-footer svg {
    color: var(--rg-primary, #7C3AED) !important;
}