/* Modal Wrapper */
.az-qb-modal {
    position: fixed; left: 0; top: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.az-qb-overlay {
    position: absolute; left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}

/* Dialog Box */
.az-qb-dialog {
    position: relative; background: #fff; border-radius: 8px;
    max-width: 900px; width: 95%; z-index: 2;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* Chế độ 1 cột (khi tắt form) */
.az-qb-single-column-mode {
    max-width: 450px;
}
.az-qb-single-column-mode .az-qb-right {
    display: none;
}
.az-qb-single-column-mode .az-qb-left {
    flex: 1 1 100%; border-right: 0;
    overflow-y: auto; max-height: 90vh;
    border-radius: 8px;
}
.az-qb-dialog:not(.az-qb-single-column-mode) .az-qb-right {
    display: block;
}

/* Close Button */
.az-qb-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-close:hover { color: #000; background-color: #f0f0f0; }
.az-qb-close svg { display: block; }

/* Inner Layout (Chế độ 2 cột mặc định) */
.az-qb-inner {
    display: flex;
    flex-wrap: wrap;
    max-height: 90vh;
}

/* Cột trái */
.az-qb-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;
}
.az-qb-product-image-wrapper { text-align: center; margin-bottom: 15px; }
.az-qb-image { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid #eee; }
.az-qb-product-info { }

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

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

/* Thuộc tính SP (Labels) */
.az-qb-attributes .az-qb-attr { margin-bottom: 15px; }
.az-qb-attributes .az-qb-attr label.az-qb-attr-label {
    display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px;
}
.az-qb-attr-options { display: flex; flex-wrap: wrap; gap: 8px; }
.az-qb-attr-option { display: inline-block; cursor: pointer; }
.az-qb-attr-option input[type="radio"] { opacity: 0; position: fixed; width: 0; }
.az-qb-attr-option span {
    display: inline-block; padding: 6px 12px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 14px; background-color: #fff;
    transition: all 0.2s ease-in-out;
}
.az-qb-attr-option input[type="radio"]:checked + span {
    border-color: #2b8aef; background-color: #eaf4ff; color: #2b8aef;
    font-weight: 600; box-shadow: 0 0 0 1px #2b8aef;
}
.az-qb-attr-option:hover span { border-color: #aaa; }

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

/* Form group */
.az-qb-form-group { margin-bottom: 12px; position: relative; }
.az-qb-input {
    width: 100%; padding: 0 10px; box-sizing: border-box;
    border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
    height: 45px; line-height: 1; 
}
select.az-qb-input {
    line-height: 1.5; padding: 0 10px;
}
textarea.az-qb-input {
    height: 80px; line-height: 1.5; padding: 10px;
}

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

/* Nút Submit */
.az-qb-actions { margin-top: 20px; }
.az-qb-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;
}
.az-qb-add:hover { opacity: 0.85; }
.az-qb-add:disabled { background: #ccc !important; color: #666 !important; cursor: not-allowed; opacity: 0.7;}

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

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

/* Responsive */
@media (max-width: 768px) {
    .az-qb-dialog {
        width: 95vw; max-width: 95vw;
        height: 90vh; max-height: 90vh;
        overflow-y: auto;
    }
    .az-qb-inner {
        flex-direction: column;
        max-height: none; height: auto;
    }
    .az-qb-left, 
    .az-qb-right {
        flex: 1 1 auto; border-right: 0;
        overflow-y: visible; max-height: none;
    }
    .az-qb-left {
        border-bottom: 1px solid #eee;
        border-top-right-radius: 8px; border-bottom-left-radius: 0;
    }
    .az-qb-right {
        border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
    }
    .az-qb-address-row {
        flex-direction: column; gap: 0; margin-bottom: 0;
    }
    .az-qb-address-row .az-qb-form-group {
        margin-bottom: 12px;
    }
    .az-qb-single-column-mode .az-qb-left {
        border-radius: 8px; border-bottom: 0;
    }
}