/* Contact form 7 */
/* --- TỔNG THỂ KHUNG FORM (SBS VILLA STYLE) --- */
.wpcf7 .wpcf7-form {
    font-family: 'Bai Jamjuree', sans-serif !important;
    background: #fff;
    border: 1.5px solid #ffba00;
    padding: 20px 18px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 310px; /* Độ rộng sidebar bạn cần */
    margin: 0px auto;
}
/* Ép buộc chia hàng */
.wpcf7 .row-flex {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    align-items: flex-start !important;
}

/* Đảm bảo các label bên trong chia đôi */
.wpcf7 .row-flex label {
    flex: 1 !important;
    width: 50% !important; /* Đảm bảo chiều rộng */
    margin-bottom: 0 !important; /* Xóa margin thừa nếu có */
}

/* Fix lỗi input bị tràn */
.wpcf7 .row-flex input {
    width: 100% !important;
}
/* Container chứa 2 ô */
.flex-container {
    display: flex !important;
    gap: 15px; /* Khoảng cách giữa 2 ô */
    margin-bottom: 1px; /* Khoảng cách với ô phía dưới */
    flex-wrap: nowrap !important; /* Ép không cho xuống dòng */
}

/* Xử lý các thẻ phát sinh tự động của CF7 */
.flex-container br, 
.flex-container span.wpcf7-form-control-wrap br {
    display: none !important;
}

/* Chia đều mỗi ô 50% */
.flex-item {
    flex: 1;
    min-width: 0; /* Tránh vỡ khung trên trình duyệt cũ */
}

/* Đảm bảo ô input dài hết khung 50% */
.flex-item input {
    width: 100% !important;
}

/* --- ĐỊNH DẠNG CỘT THEO HƯỚNG DẪN WP-DOIN --- */
.c-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Chia 2 cột đều nhau */
    gap: 8px !important; /* Khoảng cách giữa 2 cột */
    margin-bottom: 0px !important;
}

/* Ép các thẻ span của CF7 chia đôi hàng */
.c-grid .wpcf7-form-control-wrap {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Responsive cho điện thoại (tự động xuống hàng nếu màn hình nhỏ) */
@media (max-width: 480px) {
    .c-grid { grid-template-columns: 1fr !important; }
}

/* --- STYLE CÁC Ô NHẬP LIỆU --- */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100% !important;
	  height: 42px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    background-color: #f8f8f8 !important;
    margin-bottom: 12px !important;
    font-size: 14px !important;
    font-family: 'Bai Jamjuree', sans-serif !important;
    outline: none;
    display: block !important;
}

.wpcf7 input:focus, .wpcf7 textarea:focus {
    border-color: #ffba00 !important;
    background-color: #fff !important;
}
/* --- PHẦN RADIO TINH TẾ (CHỐM CAM NẰM GỌN 100%) --- */
.budget-label {
    font-weight: 700 !important;
    font-size: 15px !important;
    color: #333;
    margin: 15px 0 15px 0 !important;
    display: block;
}

/* Chia 2 cột cho Radio trong CF7 */
.wpcf7-form-control-wrap[data-name="Ngnsch"] .wpcf7-list-item {
    display: inline-flex !important;
    align-items: center;
    width: 48% !important; /* Chia 2 cột */
    margin: 0 0 5px 0 !important;
    cursor: pointer;
}

.wpcf7-list-item label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer;
    font-size: 14px !important;
    color: #444;
}

/* Custom Radio nhỏ gọn theo mã tham khảo */
.wpcf7-list-item input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important; /* Hỗ trợ Safari/Chrome */
    width: 16px !important; /* Tăng lên 16px để dễ bấm hơn 14px */
    height: 16px !important;
    border: 1.5px solid #ccc !important;
    border-radius: 50% !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    position: relative !important;
    background: #fff !important;
    flex-shrink: 0 !important;
    outline: none !important;
}

/* Khi được chọn: Đổi màu viền */
.wpcf7-list-item input[type="radio"]:checked { 
    border-color: #ffba00 !important; 
}

/* Tạo dấu chấm cam nằm chính giữa tâm */
.wpcf7-list-item input[type="radio"]:checked::after {
    content: "" !important;
    width: 8px !important;  /* Kích thước dấu chấm */
    height: 8px !important;
    background: #ffba00 !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important; /* Ép vào giữa tâm tuyệt đối */
}

/* Hover nhẹ để tăng trải nghiệm */
.wpcf7-list-item:hover input[type="radio"] {
    border-color: #ffba00 !important;
}
/* Ẩn mục đầu tiên (nhãn) trong danh sách lựa chọn */
.wpcf7 select option:first-child {
    display: none !important;
}
/* --- DROPLIST TỐI ƯU (FOCUS & CHỌN) --- */
.wpcf7 select {
    width: 100% !important;
    height: 32px !important;
    padding: 0 30px 0 12px !important;
    font-size: 14px !important;
    font-family: 'Bai Jamjuree', sans-serif !important;
    color: #333 !important;
    background-color: #f8f8f8 !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    /* Mũi tên vàng SBS */
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmJhMDAiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwb2x5bGluZSBwb2ludHM9IjYgOSAxMiAxNSAxOCA5Ij48L3BvbHlsaW5lPjwvc3ZnPg==') !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    transition: 0.2s !important;
}

/* Hiệu ứng khi nhấn vào để chọn */
.wpcf7 select:focus {
    border-color: #ffba00 !important;
    background-color: #fff !important;
    box-shadow: 0 4px 12px rgba(255, 186, 0, 0.15) !important;
}

/* Ẩn tiêu đề nhãn */
.wpcf7 select option:first-child { display: none !important; }

/* Các lựa chọn bên trong */
.wpcf7 select option {
    background-color: #fff !important;
    color: #333 !important;
    padding: 10px !important;
}
/* --- TIÊU ĐỀ & LABEL --- */
.form-title { font-weight: 700; text-align: center; margin-bottom: 18px; font-size: 17px; color: #000; display: block; }
/* --- NÚT GỬI CĂN GIỮA --- */
.wpcf7-submit {
    display: block !important;
    width: 150px !important;
    margin: 20px auto 0 !important;
    background: #ffba00 !important;
    color: #fff !important;
    padding: 1px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 186, 0, 0.3);
    transition: 0.3s;
}

.wpcf7-submit:hover { background: #333 !important; }

/* --- KHỬ KHUNG NGOÀI VÀ ĐỘ RỘNG CỦA SIDEBAR KHI CÓ BODY-FORM --- */
.wpcf7-form:has(#body-form) {
    max-width: 480px !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* --- THIẾT LẬP CHÍNH CHO FORM BODY --- */
#body-form {
    max-width: 100%;
    background: #fff;
    border: 1.5px solid #ffba00;
    padding: 30px 35px;
    border-radius: 15px;
	  padding: 20px 25px 0px 25px !important;
    box-shadow: 0 10px 10px rgba(0,0,0,0.1);
}

/* --- XỬ LÝ CHIA HÀNG NGANG --- */
#body-form .body-form-row-flex {
    display: flex !important;
    gap: 5px !important; /* Khoảng cách giữa 2 ô */
    margin-bottom: 0px !important;
}

#body-form .body-form-row-flex .flex-item {
    flex: 1 !important;
    margin-bottom: -3px !important;
    min-width: 0; /* Tránh tràn trên mobile */
}

/* Fix lỗi CF7 tự thêm thẻ span làm vỡ layout */
#body-form .body-form-row-flex span.wpcf7-form-control-wrap {
    display: block !important;
    width: 100% !important;
}

/* --- ĐỊNH DẠNG CÁC Ô INPUT & SELECT TRONG BODY FORM --- */
#body-form input[type="text"],
#body-form input[type="tel"],
#body-form input[type="email"],
#body-form select,
#body-form textarea {
    height: 36px !important;
    margin-bottom: 10px !important;
    background-color: #f9f9f9 !important;
    border-radius: 8px !important;
}

#body-form textarea {
    height: auto !important;
}

/* --- RADIO BUTTON (NGÂN SÁCH) --- */
#body-form .radio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
    margin-bottom: 0px !important;
}

#body-form .radio-grid .wpcf7-list-item {
    margin: 0 !important;
    flex: 1; /* Tự động chia đều cột ngân sách */
    min-width: 100px;
}

#body-form .radio-grid label {
    padding: 2px;
    border-radius: 6px;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Mobile Responsive: Tự xuống hàng trên điện thoại */
/* Mobile Responsive: Giữ nguyên hàng ngang cho SĐT và Email */
@media (max-width: 600px) {
    /* Ép SĐT và Email nằm trên cùng 1 hàng giống Sidebar */
    #body-form .body-form-row-flex {
        flex-direction: row !important; /* Thay column bằng row */
        gap: 5px !important;           /* Giữ khoảng cách nhỏ giữa 2 ô */
        flex-wrap: nowrap !important;  /* Không cho phép xuống dòng */
    }

    #body-form .body-form-row-flex .flex-item {
        flex: 1 !important;
        width: 50% !important;         /* Chia đều mỗi ô 50% */
    }

    /* Giữ các ô Ngân sách gọn gàng (có thể chia 2 cột nếu muốn hoặc giữ nguyên) */
    #body-form .radio-grid .wpcf7-list-item {
        flex: 1 1 45%; 
    }
    
    #body-form {
        padding: 15px 15px 0px 15px !important; /* Thu nhỏ padding ngoài trên mobile */
    }

    /* Thu nhỏ font size một chút trên mobile để không bị tràn chữ trong ô */
    #body-form input, #body-form select {
        font-size: 13px !important;
    }
}

/* Thông báo thành công/lỗi */
.wpcf7-response-output

{
	border: 1px solid #ffba00;
  margin-top: 20px;
  border-radius: 8px;
  font-weight: 500;
}
.wpcf7-mail-sent-ok
{
  background: #ffba00;
  color: #ffba00;
  border: none;
}
.wpcf7-not-valid-tip
{
  color: #ffba00;
  font-size: 14px;
}
