/**
 * Checkout page of Woocommerce
*/

/*.woocommerce-NoticeGroup-checkout .woocommerce-error {*/
/*    display: none;*/
/*}*/

.checkout.woocommerce-checkout {
    font-size: var(--fontsize-form);
}
.woocommerce-checkout .page-content h3 {
    font-family: var(--fntfamily-body);
    font-size: 1.8rem;
    font-weight: 700;
}
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-totals > div,
.checkout-shipping-container_body {
    padding:35px 45px;
    background-color: var(--color-white);
    border: 1px solid var(--color-separator);
}
.mrkv_ua_shipping_checkout_fields {
    padding:18px 45px 35px 45px;
    background-color: var(--color-white);
    border-left: 1px solid var(--color-separator);
    border-right: 1px solid var(--color-separator);
    border-bottom: 1px solid var(--color-separator);
}

.woocommerce-checkout .mrkv_ua_shipping_checkout_fields .form-row {
    padding:0;
    margin: 0 0 3px;
}
.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height: 1;
}
.woocommerce-checkout form .form-row label{
    line-height: 1;
}

#customer_details input[type="radio"] {
    display: none;

}
#customer_details input[type="radio"] + label {
    font-size: 1.8rem;
    font-weight: 400;
    display: flex !important;
    align-items: center;
    line-height: 1.25;
    cursor: pointer;
}
#customer_details input[type="radio"] + label:before {
    content: '';
    display: block;
    width: calc(1rem - 4px);
    height: calc(1rem - 4px);
    outline: 1px solid;
    outline-offset: 2px;
    padding: 2px;
    margin-right: 10px;
    box-sizing: border-box;
}
#customer_details input:checked ~ label:before {
    background-color: var(--color-body);
}

@media (max-width: 991px) {
    .woocommerce-billing-fields__field-wrapper,
    .woocommerce-shipping-totals > div,
    .checkout-shipping-container_body,
    .mrkv_ua_shipping_checkout_fields {
        padding:15px;
    }
}


/**/
/*.woocommerce-billing-fields > h3 {*/
/*    margin-top: 0;*/
/*}*/
/*.woocommerce-billing-fields__field-wrapper p.form-row-first,*/
/*.woocommerce-billing-fields__field-wrapper p.form-row-last {*/
/*    float: none;*/
/*    width:100%;*/
/*}*/

/**/
#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment,
#add_payment_method #payment ul.payment_methods,
.woocommerce-cart #payment ul.payment_methods,
.woocommerce-checkout #payment ul.payment_methods {
    padding:0;
    background-color: transparent;
    border-bottom: none;
}
#add_payment_method #payment div.payment_box,
.woocommerce-cart #payment div.payment_box,
.woocommerce-checkout #payment div.payment_box {
    background-color: transparent;
    /*border-top: 1px solid;*/
    /*border-bottom: 1px solid;*/
}
#add_payment_method #payment div.payment_box::before,
.woocommerce-cart #payment div.payment_box::before,
.woocommerce-checkout #payment div.payment_box::before {
    height: 0;
    width:0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}
#add_payment_method #payment div.form-row,
.woocommerce-cart #payment div.form-row,
.woocommerce-checkout #payment div.form-row {
    display: none;
}
.woocommerce-additional-fields {
    margin:15px 0;
}
.woocommerce-checkout form .woocommerce-additional-fields textarea {
    height: 100px;
}
.no-phone-confirm-order {
    margin-top: 30px;
}

/**/
.checkout-submit-btns .btn{
    width:100%;
    border-radius: 5px;
}

/**/
.woocommerce-checkout form.checkout_coupon {
    font-size: 1.4rem;
    margin: 0;
    padding:0;
    border: none;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
}
.woocommerce-checkout form.checkout_coupon h3 {
    width:100%;
    /*margin-top: 0;*/
}
/*.woocommerce-checkout form .form-row-first {*/
/*    width:auto;*/
/*    flex-grow: 1;*/
/*}*/
/*.woocommerce-checkout form .form-row-last {*/
/*    width:auto;*/
/*    flex-grow: 0;*/
/*}*/
/*
 * This rule acts as the container for our 50/50 layout.
 * We change it from a block wrapper to a flexible container.
 */
.woocommerce-billing-fields__field-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Creates space between the two name fields */
    margin-right: 0;
    margin-left: 0;
}

/*
 * These rules target the specific <p> tags for First Name and Last Name.
 * We set them to approximately 50% width to sit side-by-side within the flex container.
 */
.woocommerce-billing-fields__field-wrapper p.form-row-first,
.woocommerce-billing-fields__field-wrapper p.form-row-last {
    width: 48%; /* Leaves a 4% gap between the two fields for aesthetics */
    float: none; /* Clear any floating rules inherited from the parent theme */
    flex-grow: 0;
    box-sizing: border-box;
}
.woocommerce-billing-fields__field-wrapper #billing_email_field {
    margin-left: 0;
    margin-right: auto;
}

/*
 * This ensures that subsequent fields (like phone, email, and address lines)
 * break the two-column flow and take up the full width below the names.
 */
.woocommerce-checkout form p.form-row-wide {
    width: 100%;
    clear: both; /* Ensures it starts on a new line */
}

/* --- Mobile Responsiveness --- */

/* Stack the fields vertically on mobile devices for better usability */
@media (max-width: 768px) {
    .woocommerce-billing-fields__field-wrapper p.form-row-first,
    .woocommerce-billing-fields__field-wrapper p.form-row-last {
        width: 100%;
    }
}


.woocommerce-checkout form.checkout_coupon .btn {
    border-radius: var(--border-radius-input);
}

/**/
#order_review_heading {
    --color-link: var(--color-body);

    display: flex;
    justify-content: space-between;
}
#order_review_heading a {
    font-size: .875em;
    font-weight: 400;
    text-decoration: underline;
}

.woocommerce-checkout table.shop_table {
    border-collapse: collapse;
    border: none;
}
.woocommerce-checkout table.shop_table tr {
    border-bottom: 1px solid var(--color-emphasize);
}
.woocommerce-checkout table.shop_table td,
.woocommerce-checkout table.shop_table th {
    border: none;
}
.woocommerce-checkout table.shop_table tfoot th {
    font-weight: 400;
    text-align: left;
}
.woocommerce-checkout table.shop_table tfoot .cart-subtotal {
    display: none;
}

.woocommerce-checkout table.shop_table .product-total {
    text-align: center;
    white-space: nowrap;
}
.woocommerce-checkout table.shop_table .product-total .amount {
    /*display: block;*/
    font-weight: 700;
}

.woocommerce-checkout table.shop_table tfoot td {
    text-align: right;
}
.woocommerce-checkout table.shop_table tfoot td,
.woocommerce-checkout table.shop_table tfoot th {
    border-top: none;
}
.woocommerce-checkout .order-total th {
    font-size: 2rem;
    text-transform: uppercase;
}
.woocommerce-checkout .order-total .woocommerce-Price-amount {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-body);
}

@media (max-width: 500px) {
    .woocommerce-checkout table.shop_table {
        margin-left: -10px;
        margin-right: -10px;
        width: unset;
        display: block;
    }
    .woocommerce-checkout table.shop_table tbody {
        display: flex;
        flex-wrap: wrap;
    }
    .woocommerce-checkout table.shop_table tfoot {
        display: block;
        width: 100%;
    }
    .woocommerce-checkout table.shop_table tfoot tr {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .woocommerce-checkout table.shop_table tbody .cart_item {
        display: grid;
        grid-template-columns: 30% 70%;
    }
    .woocommerce-checkout table.shop_table tbody .product-thumbnail {
        grid-column: 1/2;
        grid-row: 1/3;
    }
    .woocommerce-checkout table.shop_table tbody .product-name {
        font-size: 1.4rem;
        grid-column: 2/3;
        grid-row: 1/2;
    }
    .woocommerce-checkout table.shop_table tbody .product-total {
        grid-column: 2/3;
        grid-row: 2/3;
    }

    .woocommerce-checkout table.shop_table tbody .product-total {
        display: flex;
        justify-content: flex-start;
    }
    .woocommerce-checkout table.shop_table .product-total .amount {
        font-size: 1.8rem;
        margin-left: 1em;
    }
}

#order_comments {
    height: 100px;
}

/* Placeholder color */
#order_comments::placeholder {
    color: grey;
    opacity: 1; /* ensures color works in Firefox too */
}
