/*
 * CSS cho form đặt hàng tùy chỉnh - Giao diện hoàn thiện v2.0
 */

/* --- TỔNG QUÁT: FONT CHỮ VÀ MÀU SẮC --- */
.custom-order-form-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}
.custom-order-form-container h3, .custom-order-form-container h4 {
    font-weight: 600;
    color: #1d1d1f;
}

/* --- KHUNG CHÍNH (COLUMN) --- */
.custom-order-form-container .col-inner {
    background-color: #f5f5f7;
    padding: 25px;
    border-radius: 18px;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- INPUT, TEXTAREA --- */
.custom-order-form-container input[type="text"],
.custom-order-form-container input[type="email"],
.custom-order-form-container input[type="tel"],
.custom-order-form-container input[type="number"] {
    background-color: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: none;
}
.custom-order-form-container input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    outline: none;
}

/* --- KHUNG GỢI Ý TÌM KIẾM --- */
#product-search-wrapper { position: relative; }
#product-search-results {
    position: absolute; background: #fff; border: 1px solid #e5e5e5; z-index: 1000;
    width: calc(100% - 30px); max-height: 250px; overflow-y: auto; display: none;
    border-radius: 12px; box-shadow: 0 8px 16px rgba(0,0,0,0.1); margin-top: 8px;
}
#product-search-results li { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f0f0f0; font-size: 15px; }
#product-search-results li:last-child { border-bottom: none; }
#product-search-results li:hover { background: #007aff; color: #fff; }

/* --- CÁC NÚT BẤM --- */
.custom-order-form-container .button {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}
.custom-order-form-container #add-product-to-order.button {
    width: 100%;
    font-size: 16px;
    padding: 12px 20px;
    background-color: #555;
    color: #fff;
}
.custom-order-form-container #add-product-to-order.button:hover { background-color: #333; }

/* *** CẬP NHẬT: Nút "Đặt Hàng" nhỏ lại *** */
.custom-order-form-container .text-right { text-align: right; }
.custom-order-form-container #place-order-button.button.success {
    display: inline-block; /* Để nút co giãn theo nội dung */
    width: auto;
    font-size: 15px;
    padding: 10px 22px;
    background-color: #007aff;
    color: #fff;
}
.custom-order-form-container #place-order-button.button.success:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- BẢNG SẢN PHẨM --- */
#order-items-table.shop_table {
    border-radius: 12px; overflow: hidden; border: 1px solid #e5e5e5;
}
#order-items-table th { background-color: #f9f9f9; font-weight: 600; text-align: left; }
#order-items-table td, #order-items-table th {
    border-bottom: 1px solid #e5e5e5; padding: 12px 15px;
    vertical-align: middle; /* Canh giữa nội dung trong tất cả các ô */
}
#order-items-table tbody tr:last-child td { border-bottom: none; }
#order-items-table .remove-item { color: #ff3b30; font-weight: 500; text-decoration: none; }
#order-items-table .remove-item:hover { color: #d90000; }

/* --- GIAO DIỆN NÚT TĂNG/GIẢM SỐ LƯỢNG (v2.3 - Dính liền không viền) --- */
.quantity-cell {
    text-align: center;
}

.quantity-input {
    display: inline-flex;
    align-items: center;
    gap: 0; /* Giữ các phần tử dính liền */
    
    /* Bỏ hoàn toàn viền và nền của khối bao ngoài */
    border: none;
    background-color: transparent;
}

.quantity-input .qty-value {
    font-weight: 600;
    font-size: 15px;
    padding: 0 8px;
    color: #1d1d1f;
    
    /* Bỏ các đường kẻ ngăn cách */
    border: none;
}

.quantity-input button {
    background: transparent;
    border: none;
    color: #6e6e73; /* Sử dụng màu xám cho tinh tế */
    font-size: 20px;
    font-weight: 400;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    
    /* Thêm bo góc cho hiệu ứng hover để người dùng dễ nhận biết */
    border-radius: 8px;
    
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    user-select: none;
    padding: 0;
    margin: 0;
}

.quantity-input button:hover {
    background-color: #f0f0f0;
}
/* --- KHUNG THÔNG BÁO --- */
#order-feedback {
    padding: 15px; border-radius: 12px; text-align: center; font-weight: 500; margin-top: 15px;
}
#order-feedback.success-message {
    color: #30d158; background-color: rgba(48, 209, 88, 0.1); border: 1px solid rgba(48, 209, 88, 0.2);
}
#order-feedback.error-message {
    color: #ff3b30; background-color: rgba(255, 59, 48, 0.1); border: 1px solid rgba(255, 59, 48, 0.2);
}
.custom-order-form-container textarea {
    border-radius: 12px;
    border: 1px solid #dcdcdc;
    padding: 12px 15px;
    font-size: 16px;
    background: #fff;
    width: 100%;
    min-height: 60px;
    resize: vertical;
    transition: border-color 0.2s;
}
.custom-order-form-container textarea:focus {
    border-color: #007aff;
    outline: none;
}