/**
 * Theme Name:     Hello Elementor Child
 * Author:         Elementor Team
 * Template:       hello-elementor
 * Text Domain:	   hello-elementor-child
 */

/* Hide duplicate “Already a customer? Log in here.” link on checkout */
body.woocommerce-checkout a.button.account[href*="/my-account"] {
    display: none !important;
}

/* Spacing between order overview box and payment box */
.payment-section-wrapper {
    margin-top: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    padding: 15px 20px;
    background: #ffffff;
}

/* Remove Woo default border on #payment when inside wrapper */
.payment-section-wrapper #payment {
    border: none !important;
    padding: 0 !important;
}

/* ------------------------------------------------------------------
 * Address field alignment – make fields in the same row share ratios
 * ----------------------------------------------------------------*/
@media only screen and (min-width: 780px) {
    /* Use fixed 20-px gutter between the two columns to avoid rounding drift */
    p#billing_address_1_field,
    p#billing_first_name_field {
        width: calc(50% - 10px) !important; /* 10px on each side of gutter */
        float: left;
        margin-right: 20px !important; /* gutter */
    }

    p#billing_address_2_field,
    p#billing_last_name_field {
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 0;
    }

    /* Clear floats after each two-column row */
    p#billing_last_name_field::after,
    p#billing_address_2_field::after {
        content: "";
        display: block;
        clear: both;
    }

    /* Postcode, City, Country: 32% each */
    p#billing_postcode_field,
    p#billing_city_field,
    p#billing_country_field {
        width: 32%;
        float: left;
        margin-right: 2%;
    }
    p#billing_country_field { margin-right: 0; }

    /* Duplicated Billing address section (fields inside #duplicated-fields-container) */
    #duplicated-fields-container p.form-row-first {
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 20px !important;
    }
    #duplicated-fields-container p.form-row-last {
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 0;
    }

    /* Shipping(Billing) address section (fields prefixed with shipping_) */
    p#shipping_first_name_field,
    p#shipping_address_1_field {
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 20px !important;
    }
    p#shipping_last_name_field,
    p#shipping_address_2_field {
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 0;
    }

    p#shipping_postcode_field,
    p#shipping_city_field {
        width: calc(50% - 10px) !important;
        float: left;
    }
    p#shipping_postcode_field { margin-right: 20px !important; }
    p#shipping_city_field { margin-right: 0 !important; }
    p#shipping_country_field {
        width: 100% !important;
        float: none;
        margin-right: 0;
    }

    /* Ensure Delivery address: Street + House number share the row equally */
    p#shipping_address_1_field,
    p#shipping_wooccm29_field { /* Huisnummer */
        width: calc(50% - 10px) !important;
        float: left !important;
    }
    p#shipping_address_1_field { margin-right: 20px !important; }
    p#shipping_wooccm29_field { margin-right: 0 !important; }
    p#shipping_wooccm29_field input#shipping_wooccm29 { width: 100% !important; }

    /* (reverted) – no billing Street/Huisnummer override here */

    /* Company name (Bedrijfsnaam) + VAT number (Btw-nummer) side-by-side */
    p#billing_wooccm17_field { /* Bedrijfsnaam */
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 20px !important;
    }
    p#billing_wooccm18_field { /* Btw-nummer */
        width: calc(50% - 10px) !important;
        float: left;
        margin-right: 0;
    }
}

/* ---------- Mobile (stack address fields) ---------- */
@media only screen and (max-width: 779px) {
    /* Delivery address */
    p#billing_first_name_field,
    p#billing_last_name_field,
    p#billing_address_1_field,
    p#billing_address_2_field,
    /* Billing address (duplicated/shipping) */
    p#shipping_first_name_field,
    p#shipping_last_name_field,
    p#shipping_address_1_field,
    p#shipping_address_2_field {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
    }
}

/* ------------------------------------------------------------------
 * Payment block next to Ophaalmethode (mobile) – clean appearance
 * ----------------------------------------------------------------*/
#customer_details .col-2 #payment {
    margin-top: 15px;
    padding: 0 !important;
    border: none !important;
    background: transparent;
}

