/* --- Main Form & Thank You Container --- */
.order-form-wrapper {
    max-width: 700px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.order-form-container, #hoanggia-thank-you {
    padding: 20px 30px;
}

/* --- Form Elements --- */
.order-form-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}
.form-group {
    margin-bottom: 15px;
}
.form-row-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.order-form-container input[type="text"],
.order-form-container input[type="tel"],
.order-form-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

/* --- Product Table (DESKTOP) --- */
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.product-table th, .product-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}
.product-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.product-table td[data-label="Sản phẩm"] {
    text-align: left;
}

/* --- Quantity Input Style --- */
.quantity-input-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}
.qty-input {
    width: 50px !important;
    height: 32px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* Cập nhật: Kiểu dáng mới cho nút +/- hình tròn, áp dụng cho cả desktop và mobile */
.qty-button {
    cursor: pointer;
    border: 1px solid #ddd;
    background-color: #f7f7f7;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #333;
    transition: background-color 0.2s, border-color 0.2s;
    /* Dùng flex để căn icon SVG vào giữa */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.qty-button:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
}
.qty-button svg {
    display: block; /* Đảm bảo SVG hiển thị đúng */
}

.text-right {
    text-align: right !important;
    padding-right: 20px !important;
}
.total-row {
    font-weight: bold;
    font-size: 1.2em;
}

/* Ẩn danh sách sản phẩm của mobile trên màn hình lớn */
.product-list-mobile {
    display: none;
}


/* --- Submit Button --- */
.submit-button-wrapper {
    text-align: center;
    margin-top: 20px;
}
.submit-button {
    background-color: #d9534f;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: background-color 0.2s;
}
.submit-button:hover {
    background-color: #c9302c;
}

/* --- Thank You Message --- */
/* (Giữ nguyên) */


/* --- Responsive for Mobile --- */
/* DÁN ĐOẠN MÃ NÀY THAY THẾ CHO KHỐI @media CŨ TRONG style.css */

@media screen and (max-width: 600px) {
    
    /* Quy tắc cho .qty-input BÊN TRONG @media */

.qty-input {
    width: 50px !important;     /* Ưu tiên áp dụng chiều rộng 50px */
    min-width: 50px;            /* Ngăn co lại */
    max-width: 50px;            /* Ngăn giãn ra */
    height: 28px;               /* Chiều cao khớp với nút trên mobile */
    padding: 0;
    font-size: 0.9em;
    box-sizing: border-box;
}

    .order-form-container {
        padding: 15px;
    }
    .form-row-2-cols {
        grid-template-columns: 1fr;
    }

    /* Ẩn bảng của desktop và hiện danh sách của mobile */
    .product-table {
        display: none;
    }
    .product-list-mobile {
        display: block;
        margin: 20px 0;
    }
    
    /* Kiểu cho từng sản phẩm trong danh sách mobile */
    .product-item-mobile {
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
    .product-item-mobile:last-of-type {
        border-bottom: none;
    }

    /* Dòng 1: Tên sản phẩm và bộ chọn số lượng */
    .line-1 {
        display: flex;
        justify-content: space-between; /* Đẩy tên sang trái, bộ chọn số lượng sang phải */
        align-items: center;
        margin-bottom: 8px; /* Khoảng cách giữa dòng 1 và dòng 2 */
    }

    .product-name-mobile {
        font-weight: bold;
        font-size: 1em; /* Giảm kích thước chữ tên sản phẩm */
        flex-grow: 1; /* Cho phép tên sản phẩm mở rộng */
        margin-right: 10px; /* Khoảng cách giữa tên và bộ chọn số lượng */
    }

    /* Bộ chọn số lượng trên mobile: nhỏ gọn hơn */
    .quantity-input-wrapper {
        display: flex;
        align-items: center;
        gap: 2px; /* Khoảng cách giữa các nút và input */
    }
    
    .qty-button {
        width: 28px; /* Chiều rộng nút */
        height: 28px; /* Chiều cao nút */
        font-size: 16px; /* Kích thước chữ +/- hoặc SVG icon */
        border-radius: 50%; /* Vẫn bo tròn */
        display: flex; /* Dùng flex để căn giữa SVG */
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    .qty-button svg {
        width: 16px; /* Kích thước icon SVG */
        height: 16px;
    }

    .qty-input {
    width: 33px; /* Đồng bộ chiều rộng là 50px */
    height: 28px; /* Chiều cao khớp với nút trên mobile */
    padding: 0;
    font-size: 0.9em;
}

    /* Dòng 2: Thành tiền */
    .line-2 {
        display: flex;
        justify-content: flex-end; /* Căn thành tiền sang phải */
        align-items: center;
    }

    .product-subtotal-mobile {
        font-weight: bold;
        color: #d9534f;
        font-size: 1.1em;
    }

    /* Hàng tổng cộng cuối cùng */
    .total-row-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        margin-top: 10px;
        border-top: 2px solid #333;
        font-weight: bold;
        font-size: 1.2em;
    }
    
    /* Quy tắc cho .qty-input BÊN NGOÀI @media */

.qty-input {
    width: 50px !important;
    height: 32px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px;
    box-sizing: border-box;
    -moz-appearance: textfield;
}