/*
 Theme Name:   AgroTech Child
 Theme URI:    https://wdtagrotech.wpengine.com/
 Description:  AgroTech Child Theme
 Author:       the WeDesignTech team
 Author URI:   https://wedesignthemes.com/
 Template:     agrotech
 Version:      1.0.0
 Text Domain:  agrotech-child
 Tested up to: 6.9
 Requires PHP: 7.4
 Tags: Blog,Portfolio
 License: GNU General Public License v2 or later License URI: https: //www.gnu.org/licenses/gpl-2.0.html
 Copyright (C) 2025 designthemes. All rights reserved.
*/

/* --- Cấu trúc 2 cột chính --- */

form.checkout.woocommerce-checkout {
display: flex !important;
gap: 30px;
/* max-width: 1200px; */
/* margin: 40px auto; */
align-items: flex-start;
}

#customer_details {
flex: 0 0 65% !important;
background: #fff;
padding: 35px !important;
border-radius: 20px;
border: 1px solid #f0f0f0;
}

.woocommerce-checkout-order-review-wrap {
flex: 0 0 32% !important;
background: #fff;
padding: 25px;
border-radius: 20px;
border: 1px solid #eee;
}

/* --- Tiêu đề --- */
h3#order_review_heading, .woocommerce-billing-fields h3 {
font-size: 22px !important;
font-weight: 700 !important;
margin-bottom: 25px !important;
color: #333;
}

/* --- Chia đôi các field Input --- */
.woocommerce-billing-fields__field-wrapper::after { content: ""; display: table; clear: both; }
.form-row-first { width: 48% !important; float: left !important; clear: none !important; margin-right: 4% !important; }
.form-row-last { width: 48% !important; float: left !important; clear: none !important; }
.form-row-wide { width: 100% !important; clear: both !important; }

/* --- Style Input (Viên thuốc) --- */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
/* border-radius: 50px !important; */
padding: 14px 25px !important;
border: 1px solid #e8e8e8 !important;
/* background: #fff !important; */
font-size: 14px;
}
.woocommerce form .form-row textarea { border-radius: 15px !important; }

/* --- Coupon Submenu (Cột phải) --- */
.woocommerce-checkout-header-coupon {
border-top: 1px solid #f5f5f5;
margin-top: 15px;
padding: 15px 0;
}
.showcoupon {
font-size: 14px;
font-weight: 600;
color: #333;
text-decoration: none !important;
display: block;
}
form.checkout_coupon {
display: none;
padding: 15px 0 !important;
border: none !important;
}
form.checkout_coupon .form-row-first { width: 65% !important; }
form.checkout_coupon .form-row-last { width: 30% !important; }
form.checkout_coupon button {
/* background: #e6f85e !important;
color: #000 !important;
border-radius: 50px !important;
font-weight: 700 !important;
width: 100%; */
}

/* --- Thanh toán & Nút Đặt hàng --- */
#payment {
background: transparent !important;
border-top: 1px solid #eee !important;
padding-top: 25px !important;
margin-top: 30px;
}
#payment ul.payment_methods { border-bottom: 1px solid #eee; padding-bottom: 20px; }

.place-order {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 25px !important;
}

#place_order {
/* background-color: #e6f85e !important;
color: #000 !important;
border-radius: 50px !important;
padding: 16px 45px !important;
font-weight: 700 !important;
border: none !important; */
}

/* Nút quay lại giỏ hàng giả lập */
.place-order::before {
content: "← Quay Lại Giỏ Hàng";
font-weight: 600;
font-size: 14px;
color: #333;
}

/* Mobile */
@media (max-width: 768px) {
form.checkout.woocommerce-checkout { flex-direction: column; }
.form-row-first, .form-row-last { width: 100% !important; margin-right: 0 !important; }
}

/* Coupon Row (Giữa Tbody và Tfoot) */
#coupon-row-wrapper td { padding: 15px 0 !important; border-top: 1px solid #f5f5f5 !important; border-bottom: 1px solid #f5f5f5 !important; }

/* ÉP HIỂN THỊ KHỐI COUPON */
.woocommerce-checkout-header-coupon { 
    display: block !important; 
    visibility: visible !important; 
    opacity: 1 !important; 
    margin: 0 !important; 
}

.woocommerce-info { background: transparent !important; border: none !important; padding: 0 !important; margin: 0 !important; }
.woocommerce .woocommerce-message, .woocommerce .woocommerce-info, .woocommerce .woocommerce-error{
	background-color:white !important;
}
.woocommerce .woocommerce-message, .woocommerce .woocommerce-info, .woocommerce .woocommerce-error, .woocommerce-notice{
	padding:0px!important	;
}
.woocommerce .woocommerce-error, .woocommerce .woocommerce-info, .woocommerce .woocommerce-message, .woocommerce .woocommerce-error > a, .woocommerce .woocommerce-info > a, .woocommerce .woocommerce-message > a{
	padding:0px!important;
	background-color:white!important;
}
.showcoupon {
    font-size: 16px !important; font-weight: 600 !important; color: #333 !important;
    text-decoration: none !important; display: flex !important; justify-content: space-between; align-items: center; width: 100%;
}

.coupon-arrow { width: 8px; height: 8px; border-right: 2px solid #333; border-bottom: 2px solid #333; transform: rotate(45deg); transition: 0.3s; margin-right: 5px; }
.showcoupon.active .coupon-arrow { transform: rotate(-135deg); margin-top: 5px; }
.woocommerce-checkout-header-coupon{
	border:0px!important;
}
/* --- Form Coupon Flex & Nút căn giữa --- */
/* --- Form Coupon Flex & Nút căn giữa (JS toggle OK) --- */
form.checkout_coupon {
    flex-wrap: wrap !important; /* Cho phép xuống dòng khi quá nhỏ */
    gap: 10px !important;       /* Khoảng cách giữa input và nút */
    padding: 15px 0 !important;
    border: none !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

form.checkout_coupon .form-row-first,
form.checkout_coupon .form-row-last {
    flex: 1 1 auto !important;
    margin: 0 !important;
    width: auto !important;
}

form.checkout_coupon .form-row-last {
    display: flex !important;
    align-items: center !important;
}

form.checkout_coupon .form-row-last button {
    width: 100% !important;          /* full width trong ô nút */
    padding: 12px 20px !important;   /* padding hợp lý */
    white-space: nowrap !important;  
/*     border-radius: 50px !important; */
/*     background-color: #e6f85e !important; */
/*     color: #000 !important; */
    border: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

form.checkout_coupon .form-row-first,
form.checkout_coupon .form-row-last {
    flex: 1 1 auto !important; /* Co dãn tự động */
    margin: 0 !important;      /* Bỏ margin cũ */
    width: auto !important;    /* Ghi đè width cũ */
}

form.checkout_coupon .form-row-last {
    display: flex !important;
    align-items: center !important;  /* Căn chữ nút theo chiều dọc */
}

form.checkout_coupon .form-row-last button {
    width: 100% !important;          /* full width trong ô nút */
    padding: 12px 20px !important;   /* padding hợp lý */
    white-space: nowrap !important;  /* tránh xuống dòng chữ */
/*     border-radius: 50px !important; */
/*     background-color: #e6f85e !important; */
/*     color: #000 !important; */
    border: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

/* --- Mobile Responsive --- */
@media (max-width: 480px) {
    form.checkout_coupon {
        flex-direction: column !important;
    }

    form.checkout_coupon .form-row-first,
    form.checkout_coupon .form-row-last {
        width: 100% !important;
    }

    form.checkout_coupon .form-row-last button {
        width: 100% !important;
    }
}



/* --- Hide noscript p --- */
div.place-order noscript p,
div.place-order noscript button.button.alt {
    display: none !important;
}

/* --- Place Order Flex --- */
div.place-order {
    display: flex !important;
    justify-content: space-between !important; /* Text trái, nút phải */
    align-items: center !important;            /* Căn giữa vertical */
    flex-wrap: wrap !important;
    gap: 15px !important;
    padding-top: 25px !important;
    margin-top: 30px !important;
}

/* Privacy / Terms text */
.woocommerce-terms-and-conditions-wrapper {
    flex: 1 1 auto !important; /* chiếm hết không gian còn lại */
    margin: 0 !important;
}

/* Nút Đặt hàng nằm bên phải */
div.place-order #place_order {
    margin-left: auto !important; 
/*     background-color: #e6f85e !important; */
/*     color: #000 !important; */
/*     border-radius: 50px !important;
    padding: 16px 45px !important;
    font-weight: 700 !important;
    border: none !important;
    font-size: 16px !important;
    cursor: pointer !important;
    white-space: nowrap !important; */
}

/* Mobile: nút full-width dưới text */
@media (max-width: 480px) {
    div.place-order {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    div.place-order #place_order {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 10px !important;
    }

    .woocommerce-terms-and-conditions-wrapper {
        margin-bottom: 10px !important;
    }
}
/* --- Khối Coupon responsive --- */
@media (max-width: 768px) {
    #coupon-row-wrapper td,
    #coupon-row-wrapper .woocommerce-checkout-header-coupon,
    #coupon-row-wrapper .checkout_coupon {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Input + nút nằm full-width */
    #coupon-row-wrapper .form-row-first,
    #coupon-row-wrapper .form-row-last {
        width: 100% !important;
        margin: 0 0 10px 0 !important;
    }

    #coupon-row-wrapper .form-row-last button {
        width: 100% !important;
    }
}

/* --- Coupon Wrapper Full Width --- */
#coupon-destination {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Khối coupon chính */
.woocommerce-checkout-header-coupon {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Form coupon flex */
form.checkout_coupon {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;        /* khoảng cách giữa input và nút */
    width: 100% !important;
    margin: 0 !important;
    padding: 15px 0 !important;
    box-sizing: border-box !important;
}

/* Input & nút áp dụng */
form.checkout_coupon .form-row-first {
    flex: 1 1 65% !important;     /* input chiếm nhiều hơn */
    min-width: 150px !important;  /* hạn chế quá nhỏ */
    margin: 0 !important;
}

form.checkout_coupon .form-row-last {
    flex: 1 1 30% !important;     /* nút chiếm ít hơn */
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

form.checkout_coupon .form-row-last button {
    width: 100% !important;          /* nút full trong ô */
    padding: 12px 20px !important;
/*     border-radius: 50px !important; */
/*     background-color: #e6f85e !important; */
/*     color: #000 !important; */
    border: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

/* --- Responsive nhỏ --- */
@media (max-width: 768px) {
    form.checkout_coupon {
        flex-direction: column !important;
    }

    form.checkout_coupon .form-row-first,
    form.checkout_coupon .form-row-last {
        width: 100% !important;      /* input + nút full width */
        margin: 0 0 10px 0 !important;
    }

    form.checkout_coupon .form-row-last button {
        width: 100% !important;
    }
}



/* --- Đặt box checkout error luôn trên đầu box Thông tin thanh toán --- */
.woocommerce .woocommerce-NoticeGroup-checkout {
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    display: block !important;
    z-index: 9999 !important;
}
    
