/* Modal Wrapper */
h2.title-muahang {
    padding: 10px;
    color: #ffffff;
    text-transform: uppercase;
    background: #00699b;
    margin: 10px;
}
.az-qb-full-modal {
    position: fixed; left: 0; top: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 999999;
}

.az-qb-full-modal ins bdi{
    color: red;
    font-size: 120%;
}

.az-qb-full-overlay {
    position: absolute; left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}
form.az-qb-full-form {
    overflow-y: auto;
    display: block;
    max-height: 80vh;
    overflow-x: hidden;
}
/* Dialog Box */
.az-qb-full-dialog {
    position: relative; background: #fff; border-radius: 8px;
    max-width: 900px; width: 95%; z-index: 2;
    overflow: visible; /* Cho phép dropdown hiển thị ra ngoài */
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* Close Button */
.az-qb-full-close {
    position: absolute; right: 8px; top: 8px; border: 0;
    background: transparent; cursor: pointer; z-index: 10;
    padding: 8px; line-height: 1; color: #777; border-radius: 50%;
}
.az-qb-full-close:hover { color: #000; background-color: #f0f0f0; }
.az-qb-full-close svg { display: block; }

/* Inner Layout */
.az-qb-full-inner { display: flex; flex-wrap: wrap; max-height: auto; }

/* Cột trái (Sản phẩm) */
.az-qb-full-left {
    flex: 1 1 45%;
    background: #f9f9f9;
    padding: 25px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid #eee;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    height: fit-content;
}
.az-qb-product-image-wrapper { text-align: center; margin-bottom: 15px; }
.az-qb-full-image { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid #eee; }

/* Cột phải (Form) */
.az-qb-full-right {
    flex: 1 1 55%; padding: 25px 25px 0; box-sizing: border-box; overflow-y: auto;
}
.az-qb-form-title { font-size: 18px; font-weight: 600; margin-top: 15px; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.az-qb-full-right .az-qb-form-title:first-child { margin-top: 0; }

.az-qb-full-title { margin: 0 0 10px; font-size: 22px; line-height: 1.3; font-weight: 600; }
.az-qb-full-price { margin-bottom: 15px; font-size: 18px; color: #d54e21; font-weight: 600; }

/* Thuộc tính SP */
.az-qb-full-attributes .az-qb-attr { margin-bottom: 12px; }
.az-qb-full-attributes .az-qb-attr label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.az-qb-full-attributes .az-qb-attr select { width: 100%; padding: 8px; box-sizing: border-box; }

/* Số lượng */
.az-qb-full-quantity { margin-top: 15px; }
.az-qb-full-quantity label { font-weight: 600; margin-right: 10px; font-size: 14px; }
.az-qb-full-quantity input { width: 80px; padding: 6px 8px; text-align: center; }

/* Form group */
.az-qb-form-group { margin-bottom: 12px; position: relative; /* Cho dropdown kết quả */ }
.az-qb-input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    height: 45px;
}
.az-qb-input:focus { border-color: #007cba; box-shadow: 0 0 0 1px #007cba; outline: none; }
textarea.az-qb-input { min-height: 80px; }

/* Tỉnh/Xã trên 1 hàng */
.az-qb-address-row { display: flex; gap: 10px; margin-bottom: 12px; }
.az-qb-address-row .az-qb-form-group { flex: 1; margin-bottom: 0; }

/* CẬP NHẬT: CSS cho Input tìm kiếm và Dropdown kết quả */
.az-qb-search-select-wrapper { position: relative; }
.az-qb-search-results {
    display: none; /* Ẩn mặc định */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000; /* Cao hơn các element khác */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}
.az-qb-search-results div { /* Kiểu cho từng item kết quả */
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
}
.az-qb-search-results div:hover { background-color: #f0f0f0; }
.az-qb-search-results div.no-results {
    padding: 8px 10px;
    color: #888;
    font-style: italic;
    cursor: default;
}
.az-qb-search-results div.no-results:hover { background-color: transparent; }
/* ----- Kết thúc CSS cho Input tìm kiếm ----- */
input.az-qb-input {
    border-radius: 7px;
    margin: 5px 0;
    padding: 10px;
}

.az-qb-coupon-group { display: flex; }
.az-qb-coupon-group input { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.az-qb-apply-coupon { border: 1px solid #ddd; border-left: 0; background: #f0f0f0; padding: 0 15px; cursor: pointer; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }

/* Shipping & Payment */
.az-qb-shipping-wrapper, .az-qb-payment-wrapper { margin-top: 15px; }
.az-qb-shipping-methods, .az-qb-payment-methods { font-size: 14px; }
.az-qb-shipping-methods label, .az-qb-payment-methods label { display: block; margin-bottom: 8px; cursor: pointer;}
.az-qb-shipping-methods input, .az-qb-payment-methods input { margin-right: 8px; vertical-align: middle; }

/* Nút Submit */
.az-qb-full-actions { margin-top: 20px; }
.az-qb-full-add {
    background: #2b8aef; color: #fff; border: 0; width: 100%;
    padding: 12px 20px; border-radius: 6px; cursor: pointer;
    font-size: 16px; font-weight: 600; text-align: center;
	margin-bottom :0 ;
}
.az-qb-full-add:hover { opacity: 0.85; }
.az-qb-full-add:disabled { background: #ccc !important; color: #666 !important; cursor: not-allowed; opacity: 0.7;}

/* Nút Trigger */
.az-qb-full-button {
    background: #2b8aef; color: #fff; border: 0; padding: 10px 16px;
    border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.az-qb-full-button:hover { opacity: 0.85; }

/* Thông báo */
.az-qb-full-result { margin-top: 15px; font-size: 14px; text-align: center; }
.az-qb-field-error { font-size: 12px; color: #b00020; padding-top: 4px; }
.az-qb-full-error { color: #b00020; font-weight: 600; }
.az-qb-full-success { color: #006400; font-weight: 600; }

/* Màn hình Thành công */
.az-qb-full-success-screen {
    padding: 30px; text-align: center; max-height: 90vh; overflow-y: auto;
}
.az-qb-success-icon { font-size: 50px; color: #28a745; line-height: 1;}
.az-qb-success-title { font-size: 24px; font-weight: 600; margin: 15px 0; }
.az-qb-success-details {
    text-align: left; max-width: 400px; margin: 20px auto; padding: 15px;
    background: #f9f9f9; border: 1px solid #eee; border-radius: 6px; font-size: 14px;
}
.az-qb-success-details p { margin: 0 0 10px; border-bottom: 1px dotted #ccc; padding-bottom: 10px; line-height: 1.5; display: flex; justify-content: space-between; align-items: flex-start;}
.az-qb-success-details p:last-child { margin-bottom: 0; border: 0; padding-bottom: 0; }
.az-qb-success-details strong { text-align: right; margin-left: 10px; }
.az-qb-success-qr { margin-top: 20px; }
.az-qb-success-qr img { max-width: 250px; height: auto; margin: 0 auto; display: block; border: 1px solid #eee;}
.az-qb-success-qr p { font-weight: 600; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .az-qb-full-inner { flex-direction: column; max-height: 85vh; }
    .az-qb-full-left, .az-qb-full-right { flex: 1 1 auto; border-right: 0; }
    .az-qb-full-dialog { max-width: 450px; }
    .az-qb-address-row { flex-direction: column; gap: 0; margin-bottom: 0;}
    .az-qb-address-row .az-qb-form-group { margin-bottom: 12px; }
}

/* CSS cho hộp chứa danh sách thuộc tính có thể cuộn */
.attribute-scroll-container ul {
    /* Giới hạn chiều cao tối đa của danh sách. Bạn có thể thay đổi giá trị 150px */
    max-height: 150px;

    /* Tự động hiển thị thanh cuộn theo chiều dọc khi nội dung vượt quá chiều cao tối đa */
    overflow-y: auto;

    /* Thêm một chút thẩm mỹ (tùy chọn) */
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    list-style-position: inside; /* Đảm bảo dấu chấm đầu dòng nằm bên trong hộp */
}

/* Tùy chỉnh thanh cuộn cho đẹp hơn (hoạt động trên trình duyệt Chrome, Edge, Safari) */
.attribute-scroll-container ul::-webkit-scrollbar {
    width: 6px;
}

.attribute-scroll-container ul::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.attribute-scroll-container ul::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.attribute-scroll-container ul::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* * CẬP NHẬT: CSS RESPONSIVE
 * Khối này đã được viết lại hoàn toàn để xử lý layout mobile
 */
@media (max-width: 768px) {
    .az-qb-full-dialog {
        /* Cho phép dialog co lại và chiếm gần hết màn hình */
        width: 95vw;
        max-width: 95vw;
        height: 90vh; /* Giới hạn chiều cao */
        max-height: 90vh;
        overflow-y: auto; /* Bật cuộn cho TOÀN BỘ dialog */
    }
    
    .az-qb-full-inner {
        flex-direction: column; /* Stack 2 cột chồng lên nhau */
        max-height: none; /* TẮT max-height của inner */
        height: auto; /* Chiều cao tự động để nội dung dãn ra */
    }

    .az-qb-full-left, 
    .az-qb-full-right {
        flex: 1 1 auto; /* Để 2 cột tự dãn */
        border-right: 0; /* Bỏ viền phải của cột trái */
        overflow-y: visible; /* TẮT cuộn riêng của 2 cột */
        max-height: none; /* Bỏ giới hạn chiều cao của 2 cột */
    }

    .az-qb-full-left {
        border-bottom: 1px solid #eee; /* Thêm viền dưới để tách biệt 2 khối */
        /* Giữ bo góc trên mobile */
        border-top-right-radius: 8px;
        border-bottom-left-radius: 0;
    }
    .az-qb-full-right {
         /* Giữ bo góc trên mobile */
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    /* Stack Tỉnh/Xã trên mobile */
    .az-qb-address-row {
        flex-direction: column; 
        gap: 0;
        margin-bottom: 0;
    }
    .az-qb-address-row .az-qb-form-group {
        margin-bottom: 12px; /* Thêm lại margin-bottom khi stack */
    }
}