/* Chi tiết hóa đơn. Tiền tố hd-. Theo design HoaDon, PhoneHoaDon, UuDai, HuyMon. */

.hd-trang .hop-chan > .nut-chung, .hd-trang .hop-chan > .nut-chung.chinh { flex: 1; }
.hd-trang .nut-chung.chinh.rong { width: 100%; }

.hd-trang { display: flex; gap: 20px; height: 100%; min-height: 560px; }
.hd-trang.loi { flex-direction: column; align-items: center; height: auto; min-height: 0; padding-top: 24px; }
.hd-trai { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.hd-phai { width: 350px; flex: none; min-height: 0; display: flex; flex-direction: column; }
.hd-the { background: #fff; border: 1px solid var(--vien); border-radius: 16px; }
.hd-phu { font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.4; }
.hd-do { color: var(--canh-bao); }
.hd-thanh-dt { display: none; }

/* ===== Thẻ khách + hàng vòng ===== */
.hd-khach { flex: none; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.hd-khach-dau { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hd-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--avatar); color: var(--xanh-rung); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.hd-khach-ten { flex: 1; min-width: 0; }
.hd-khach-dong1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.hd-khach-dong1 b { font-size: calc(16px * var(--co-chu)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-sdt { color: var(--chu-phu); white-space: nowrap; font-size: calc(14px * var(--co-chu)); }
.hd-nhan-hang { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hd-nhan { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.hd-nhan.xanh { background: #E9F4EA; color: #1D4A27; }
.hd-nhan.duong { background: #E2EBF5; color: #2B4C70; }
.hd-nhan.tim { background: #EEEAF6; color: #5B4A86; }
.hd-nhan.xam { background: #EFEDE5; color: #6B6557; }
.hd-khach-nut { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.hd-khach-nut .nut-chung.nho { height: 40px; background: #EFEDE5; border-color: transparent; color: #3A3026; }
.hd-menu-phu { position: relative; }
.hd-menu-phu .nut-icon-nho { width: 40px; height: 40px; }
.hd-menu { position: absolute; right: 0; top: 46px; z-index: 20; min-width: 190px; background: #fff; border: 1px solid var(--vien); border-radius: 12px; box-shadow: 0 16px 40px rgba(17, 57, 23, .18); padding: 6px; }
.hd-menu button { width: 100%; height: 44px; border: 0; background: none; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font-weight: 500; text-align: left; }
.hd-menu button:hover { background: var(--kem); }
.hd-vong-hang { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gh-vong.to { height: 26px; padding: 0 10px 0 8px; font-size: calc(12.5px * var(--co-chu)); gap: 5px; }
.gh-vong.to i { width: 8px; height: 8px; }
.hd-gan-vong { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 8px; margin-left: 2px; background: none; border: 0; color: var(--xanh-rung); font-weight: 700; font-size: calc(13px * var(--co-chu)); }
.hd-ghi-chu { margin-left: auto; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); min-width: 0; }
.hd-gan-o { display: flex; align-items: center; gap: 8px; }
.hd-gan-o .o-quet-vong { flex: 1; height: 46px; }

/* ===== Ô nhập, nhãn (dùng trong ngăn, hộp) ===== */
.hd-form { display: flex; flex-direction: column; gap: 16px; }
.hd-o { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.hd-o > span { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.hd-o i { color: var(--canh-bao); font-style: normal; }
.hd-o em { font-style: normal; font-weight: 500; color: var(--chu-phu); font-size: calc(12px * var(--co-chu)); }
.hd-o.nho > span { font-size: calc(12.5px * var(--co-chu)); }
.hd-o.nho .o-nhap-nho { height: 42px; font-size: 15px; }
.hd-o.co-loi .o-nhap-nho { border-color: #E3B4AE; background: #FFF5F4; }
.hd-o select.o-nhap-nho { padding-right: 8px; }
.hd-textarea { border-radius: 10px; border: 1.5px solid var(--vien-dam); background: var(--ban-ghi); padding: 10px 12px; font: inherit; font-size: 15px; width: 100%; resize: vertical; min-height: 72px; }
.hd-textarea:focus { border-color: var(--xanh-rung); outline: none; background: #fff; }
.hd-so-khach { display: flex; align-items: center; gap: 14px; }
.hd-so-khach .nut-icon-nho { width: 44px; height: 44px; }
.hd-so-khach b { min-width: 30px; text-align: center; font-size: calc(20px * var(--co-chu)); }
.hd-chon-hang { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-chan-hop { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.hd-chan-hop > span:first-child { font-size: calc(13px * var(--co-chu)); color: var(--chu-phu); }
.hd-chan-nut { display: flex; gap: 8px; flex: none; }
.hd-loi-ds { margin: 0; padding-left: 18px; color: var(--canh-bao); font-size: calc(13px * var(--co-chu)); line-height: 1.5; }

/* ===== Danh sách dòng ===== */
.hd-dong-hop { flex: 1; min-height: 0; padding: 12px 16px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.hd-dong-dau { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex: none; }
.hd-dong-dau h2 { margin: 0; font-size: calc(16px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); white-space: nowrap; }
.hd-thanh-nut { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hd-thanh-nut .nut-chung.nho { height: 44px; padding: 0 14px; font-size: calc(14px * var(--co-chu)); }
.hd-thanh-nut .hd-gui-spa:not(:disabled) { border-color: #8A5A3C; color: #8A5A3C; }
.hd-dem { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--cam); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hd-ds { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px 24px; -webkit-overflow-scrolling: touch; }
.hd-ds-trong { margin: 24px 0; text-align: center; color: var(--chu-phu); }
.hd-khu-ten { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px; margin-top: 4px; font-size: calc(13px * var(--co-chu)); font-weight: 700; }
.hd-dong { border-bottom: 1px solid #F0ECE2; }
.hd-dong-chinh { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 5px 4px; }
.hd-dong-ten { flex: 1; min-width: 0; }
.hd-dong-ten > b { display: block; font-size: calc(14.5px * var(--co-chu)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-sl-dt { display: none; color: var(--chu-phu); font-weight: 500; font-size: calc(13px * var(--co-chu)); }
.hd-dong-phu { display: flex; align-items: center; gap: 8px; min-height: 17px; font-size: calc(12px * var(--co-chu)); color: var(--chu-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-xong { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--xanh-rung); background: #fff; color: var(--xanh-rung); font-weight: 700; font-size: calc(12px * var(--co-chu)); flex: none; }
.hd-sl { width: 40px; text-align: center; font-weight: 700; flex: none; }
.hd-dg { width: 92px; text-align: right; font-weight: 500; color: var(--chu); flex: none; white-space: nowrap; }
.hd-gia { width: 100px; text-align: right; font-weight: 700; color: var(--xanh-dam); flex: none; white-space: nowrap; }
.hd-sl-gia-dt { display: none; }
/* Giá có ưu đãi: giá gốc gạch ngang ở trên, giá sau ưu đãi ở dưới */
.hd-goc, .hd-moi { display: block; }
.hd-goc { font-size: calc(12.5px * var(--co-chu)); font-weight: 400; color: var(--chu-phu); text-decoration: line-through; line-height: 1.2; }
.hd-moi { line-height: 1.25; }
.hd-can-thu .hd-goc { font-size: calc(14px * var(--co-chu)); }
.hd-can-thu.co-giam { align-items: center; }
.hd-can-thu.co-giam .so { text-align: right; }
.hd-xep { display: inline-flex; flex-direction: column; }
/* Hàng tiêu đề 3 cột số (số lượng, đơn giá, thành tiền): nằm sát phải, cùng độ rộng với các dòng bên dưới nên luôn thẳng cột */
.hd-ds-dau { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 10px; padding: 6px 4px; background: #fff; border-bottom: 1px solid #F0ECE2; font-size: calc(12.5px * var(--co-chu)); font-weight: 500; color: var(--chu-phu); }
.hd-ds-dau .c-sl { width: 40px; text-align: center; }
.hd-ds-dau .c-dg { width: 92px; text-align: right; }
.hd-ds-dau .c-tt { width: 100px; text-align: right; }
.hd-ds-dau .c-x { width: 40px; }
.hd-x { width: 40px; height: 40px; flex: none; border-radius: 10px; background: #F1EFE8; color: #8A8372; border: 0; display: inline-flex; align-items: center; justify-content: center; }
.hd-x.do { background: #FBE4E1; color: var(--canh-bao); }
.hd-x:disabled { opacity: .5; }
.hd-x-trong { width: 40px; flex: none; }
.hd-dong-chinh > .nhan-tt { flex: none; }
.hd-dong.cho-duyet .hd-dong-chinh { opacity: .55; }
.hd-dong.da-huy .hd-dong-chinh { opacity: .6; }
.hd-dong.da-huy .hd-dong-ten > b, .hd-dong.da-huy .hd-gia { text-decoration: line-through; }
.hd-huy-cho { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 4px 8px; padding: 8px 10px; border-radius: 10px; background: #FFF6E0; color: #7A4E05; font-size: calc(12.5px * var(--co-chu)); font-weight: 500; }
.hd-huy-nut { display: flex; gap: 8px; }
.hd-huy-nut .nut-chung.nho { height: 40px; }
.hd-luot-them { position: absolute; left: 16px; right: 16px; bottom: 12px; height: 40px; padding-top: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); background: linear-gradient(to top, #fff 45%, rgba(255, 255, 255, 0)); pointer-events: none; }

/* ===== Hộp Yêu cầu hủy ===== */
.hd-huy { display: flex; flex-direction: column; gap: 16px; }
.hd-huy-mon { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #F6F5EF; }
.hd-huy-icon { width: 40px; height: 40px; border-radius: 12px; background: #FBE9E4; display: flex; align-items: center; justify-content: center; flex: none; }
.hd-gui-toi { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--vien); border-radius: 12px; font-size: calc(13.5px * var(--co-chu)); color: var(--nau); }
.hd-gui-toi svg { color: var(--xanh-rung); flex: none; }
.hd-luu-y { margin: 0; padding: 12px 14px; border-radius: 12px; background: #FFF6E0; color: #7A4E05; font-size: calc(13px * var(--co-chu)); line-height: 1.5; }
.hd-phieu-ds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hd-phieu-ds li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F0ECE2; }
.hd-phieu-ten { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* ===== Cột Thanh toán ===== */
.hd-tt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hd-tt h2 { margin: 0; font-size: calc(16px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); }
.hd-tt-cuon { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.hd-tt-chan { flex: none; padding: 12px 18px 16px; border-top: 1px solid #EEEAE0; display: flex; flex-direction: column; gap: 8px; }
.hd-tt-chan .nut-chung { width: 100%; }
.hd-dong-tien { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hd-dong-tien b { font-weight: 700; color: var(--xanh-dam); }
.hd-uu-dai { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px dashed #B8A6DA; background: none; color: #5B4A86; font-size: calc(13.5px * var(--co-chu)); font-weight: 700; }
.hd-uu-dai.da-chon { border-style: solid; background: #F6F2FC; }
.hd-uu-ten { display: flex; align-items: center; gap: 6px; min-width: 0; text-align: left; }
.hd-uu-phai { display: flex; align-items: center; gap: 4px; flex: none; font-weight: 500; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); }
.hd-uu-phai b { color: #5B4A86; font-size: calc(14px * var(--co-chu)); font-weight: 700; }
.hd-can-thu { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hd-can-thu .so { font-size: calc(27px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); white-space: nowrap; }
.hd-ghi-nho { margin: 0; font-size: calc(13px * var(--co-chu)); color: var(--chu-phu); line-height: 1.45; }
.hd-ghi-nho.do { color: var(--canh-bao); font-weight: 500; }
.hd-ghi-nho a { color: var(--xanh-rung); font-weight: 700; text-decoration: underline; }
.hd-hai-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hd-hai-nut button { height: 54px; border-radius: 12px; border: 1.5px solid var(--vien-dam); background: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: calc(13.5px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.hd-hai-nut button.on { border-color: var(--xanh-rung); background: #F0FBF2; color: #1D4A27; }
.hd-qr { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; background: #F6F5EF; }
.hd-qr-hinh { width: 132px; height: 132px; flex: none; padding: 5px; border-radius: 10px; background: #fff; border: 1px solid var(--vien); display: flex; align-items: center; justify-content: center; }
.hd-qr-hinh img { width: 100%; height: 100%; display: block; }
.hd-qr-hinh.trong { font-size: calc(12px * var(--co-chu)); text-align: center; color: var(--chu-phu); flex-direction: column; gap: 6px; padding: 8px; line-height: 1.35; }
.hd-qr-hinh.trong.canh-bao { color: #7A4E05; background: #FFF6E0; border-color: #EFC56D; }
.hd-qr-chu { display: flex; flex-direction: column; gap: 6px; font-size: calc(12.5px * var(--co-chu)); line-height: 1.4; min-width: 0; flex: 1; }
.hd-qr-chu b { font-size: calc(13px * var(--co-chu)); }
.hd-da-nhan { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--xanh-rung); background: #fff; color: var(--xanh-rung); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); }
.hd-da-nhan.on { background: var(--xanh-rung); color: #fff; }
.hd-ma-gd { height: 40px; font-size: calc(14px * var(--co-chu)); }
.hd-qr-lon { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hd-qr-lon img { width: min(300px, 70vw); height: auto; }
.hd-qr-lon .so { font-size: calc(26px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); }
.hd-khoa { margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #FDE6E3; border: 1px solid #E3B4AE; color: var(--canh-bao); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); line-height: 1.35; }
.hd-khoa svg { flex: none; }
.hd-con-thieu { margin: 0; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); text-align: center; line-height: 1.4; }

/* Hóa đơn điện tử */
.hd-hddt { display: flex; flex-direction: column; gap: 8px; }
.hd-muc-nhan { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.hd-muc-nhan i { color: var(--canh-bao); font-style: normal; }
.hd-ba-nut { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.hd-ba-nut button { min-height: 50px; padding: 4px 6px; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: #fff; font-size: calc(12.5px * var(--co-chu)); font-weight: 700; line-height: 1.2; color: var(--nau); text-align: center; }
.hd-ba-nut button { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hd-ba-nut button.on { border-color: var(--xanh-rung); background: #F0FBF2; color: #1D4A27; }
.hd-ba-nut button:disabled { opacity: .45; }
.hd-hddt-chi-tiet { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 12px; background: #F6F5EF; }
.hd-seg { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 14px; background: #E9E6DB; gap: 3px; }
.hd-seg button { height: 38px; padding: 0 16px; border-radius: 11px; border: 0; background: none; font-weight: 700; font-size: calc(13.5px * var(--co-chu)); color: #5B5446; }
.hd-seg button.on { background: #fff; color: var(--xanh-dam); box-shadow: 0 1px 3px rgba(17, 57, 23, .18); }
.hd-chip { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--vien-dam); background: #fff; font-size: calc(13px * var(--co-chu)); font-weight: 500; color: var(--chu); }
.hd-chip.on { background: var(--xanh-rung); border-color: var(--xanh-rung); color: #fff; }
.hd-hddt-xem { display: flex; flex-direction: column; gap: 6px; }
.hd-hddt-dong { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: calc(13px * var(--co-chu)); line-height: 1.4; }

/* Vòng tay chưa thu */
.hd-vong-thu { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--vien); }
.hd-vong-chu { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.hd-vong-chu b { font-size: calc(13.5px * var(--co-chu)); }
.hd-vong-chu .hd-phu { font-size: 11.5px; }
.hd-vong-so { font-size: calc(24px * var(--co-chu)); color: var(--xanh-dam); }
.hd-vong-tru { width: 48px; height: 48px; border-radius: 12px; background: var(--xanh-dam); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.hd-vong-tru:disabled { opacity: .35; }
.hd-vong-chon { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hd-vong-lon { min-width: 100px; height: 60px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--xanh-rung); background: #F0FBF2; color: var(--xanh-dam); font-size: calc(19px * var(--co-chu)); font-weight: 700; }

/* Hóa đơn đã đóng */
.hd-trang-thai { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: calc(16px * var(--co-chu)); }
.hd-trang-thai.xanh { background: #DCEFD9; color: #1F5A2B; }
.hd-trang-thai.xam { background: #ECEAE3; color: #6B6557; }
.hd-trang-thai.do { background: #FDE6E3; color: var(--canh-bao); }
.hd-dc-dong { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--vien); border-radius: 12px; margin-bottom: 10px; }
.hd-dc-hang { display: flex; gap: 8px; }
.hd-dc-hang select { flex: 1; min-width: 0; }
.hd-dc-cu { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--vien); }
.hd-dc-xong { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 8px; color: var(--xanh-rung); }
.hd-dc-xong b { color: var(--chu); font-size: calc(16px * var(--co-chu)); }

/* ===== Hộp Chọn ưu đãi ===== */
.hd-uu-mo-ta { margin: -4px 0 12px; }
.hd-uu-ds { display: flex; flex-direction: column; gap: 10px; }
.hd-uu-the { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; border: 1.5px solid var(--vien); border-radius: 14px; background: #fff; text-align: left; }
.hd-uu-the.chon { border-color: #8E7CC0; background: #F6F2FC; }
.hd-uu-the.khong { background: #FAFAF7; cursor: not-allowed; }
.hd-uu-the.khong .hd-uu-noi > b, .hd-uu-the.khong .hd-uu-bc { opacity: .5; }
.hd-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #CFC9B8; flex: none; background: #fff; }
.hd-uu-the.chon .hd-radio { border-color: #5B4A86; background: #5B4A86; box-shadow: inset 0 0 0 4px #fff; }
.hd-uu-noi { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hd-uu-noi > b { font-size: calc(15px * var(--co-chu)); }
.hd-uu-khong { display: flex; align-items: center; gap: 5px; color: var(--canh-bao); font-size: calc(12.5px * var(--co-chu)); font-weight: 500; }
.hd-uu-luu-y { font-size: calc(12.5px * var(--co-chu)); color: #7A4E05; }
.hd-uu-giam { font-size: calc(12.5px * var(--co-chu)); color: #5B4A86; font-weight: 500; }
.hd-uu-bc { display: flex; align-items: center; gap: 5px; max-width: 42%; font-size: calc(12.5px * var(--co-chu)); font-weight: 700; color: #5B4A86; text-align: right; line-height: 1.3; }
.hd-uu-bc svg { flex: none; }
.hd-bang-chung { position: sticky; bottom: 0; z-index: 2; margin-top: 14px; display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: #FBF6EA; border: 1.5px dashed #E1C98A; }
.hd-bang-chung.co { background: #F1F8F1; border: 1px solid #D5E7D8; }
.hd-anh { width: 112px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; background: #E8EDF6; display: flex; align-items: center; justify-content: center; color: #8A93A8; }
.hd-anh.tu-co { background: #E3F1E5; color: var(--xanh-rung); width: 76px; }
.hd-bc-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: calc(14px * var(--co-chu)); }

/* ===== Điện thoại: một cột, thanh nút + tổng tiền dính đáy, thanh toán là bước cuối ===== */
@media (max-width: 767px) {
  .hd-trang { flex-direction: column; height: auto; min-height: 0; gap: 12px; }
  .hd-trai { gap: 12px; min-height: 0; }
  .hd-phai { width: auto; }
  .hd-khach { padding: 12px 14px; gap: 8px; }
  .hd-khach-dau { align-items: flex-start; }
  .hd-avatar { display: none; }
  .hd-khach-dau { gap: 8px; }
  .hd-khach-dong1 { flex-wrap: wrap; row-gap: 0; }
  .hd-khach-dong1 b { font-size: calc(16.5px * var(--co-chu)); white-space: normal; }
  .hd-nhan-hang .hd-nhan:not(.khach-so) { display: none; }
  .hd-khach-nut .nut-chung.nho { width: 44px; padding: 0; }
  .hd-chu-sua { display: none; }
  .hd-ghi-chu { margin-left: 0; flex-basis: 100%; }
  .hd-dong-hop { overflow: visible; padding: 10px 14px; }
  .hd-ds { overflow: visible; margin: 0; padding: 0; }
  .hd-luot-them { display: none; }
  .hd-dong-dau .hd-thanh-nut { display: none; }
  .hd-dong-chinh { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; grid-template-areas: 'ten gia x' 'tt tt x'; gap: 2px 8px; align-items: center; padding: 8px 0; }
  .hd-dong-ten { grid-area: ten; }
  .hd-dong-ten > b { white-space: normal; }
  .hd-ds-dau { display: none; }
  .hd-sl-gia-dt { display: block; font-size: calc(13.5px * var(--co-chu)); color: var(--chu-phu); font-weight: 500; }
  .hd-sl-gia-dt.co-giam { display: flex; align-items: center; gap: 5px; }
  .hd-sl-gia-dt .hd-moi { color: var(--chu); font-weight: 600; }
  .hd-tong-dt.co-giam { align-items: center; }
  .hd-tong-dt.co-giam b { text-align: right; }
  .hd-tong-dt .hd-goc { font-size: calc(13.5px * var(--co-chu)); }
  .hd-sl, .hd-dg { display: none; }
  .hd-gia { grid-area: gia; width: auto; }
  .hd-dong-chinh > .nhan-tt { grid-area: tt; justify-self: start; }
  .hd-dong-chinh > .hd-x, .hd-dong-chinh > .hd-x-trong { grid-area: x; align-self: center; }
  .hd-dong-phu { white-space: normal; flex-wrap: wrap; font-size: calc(13px * var(--co-chu)); }
  .hd-dong-chinh > .nhan-tt { font-size: calc(12.5px * var(--co-chu)); height: 26px; }
  .hd-huy-cho { margin: 0 0 8px; }

  .hd-thanh-dt { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 0; z-index: 6; margin: 0 -16px -16px; padding: 10px 16px 12px; background: #fff; border-top: 1px solid var(--vien); }
  .hd-tong-dt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 0; font-size: calc(14px * var(--co-chu)); color: var(--chu-phu); text-align: left; width: 100%; }
  .hd-tong-dt b { font-size: calc(24px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); }
  .hd-thanh-dt .hd-thanh-nut { display: flex; margin: 0; }
  .hd-thanh-dt .hd-thanh-nut .nut-chung { flex: 1; min-width: 0; height: 48px; padding: 0 8px; font-size: calc(14.5px * var(--co-chu)); }
  .hd-tt-cuon { overflow: visible; padding: 14px 14px 10px; }
  .hd-tt-chan { padding: 10px 14px 14px; }
  .hd-qr-hinh { width: 148px; height: 148px; }
  .hd-uu-bc { max-width: 100%; text-align: left; }
  .hd-uu-the { flex-wrap: wrap; }
  .hd-uu-bc { flex-basis: 100%; padding-left: 36px; }
  .hd-bang-chung { flex-wrap: wrap; }
  .hd-chan-hop { flex-direction: column; align-items: stretch; }
  .hd-chan-hop > span:first-child { text-align: center; }
  .hd-chan-nut { flex-direction: column-reverse; }
  .hd-chan-nut .nut-chung, .hd-chan-hop > .nut-chung { width: 100%; }
}

/* Khung ảnh bằng chứng (hộp Chọn ưu đãi) trên điện thoại: ảnh nhỏ + chữ ở hàng trên, nút Chụp lại nằm hàng dưới.
   Trước đây ảnh, chữ, nút xếp 1 hàng nên chữ bị bóp còn 1 từ mỗi dòng, khung kéo dài. */
@media (max-width: 767px) {
  .hd-bang-chung { flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; padding: 10px; }
  .hd-anh { width: 84px; height: 64px; }
  .hd-anh.tu-co { width: 64px; }
  .hd-bc-chu { flex: 1 1 0; min-width: 0; align-self: center; }
  .hd-bc-chu b { line-height: 1.25; }
  .hd-bang-chung > .nut-chung { flex: 1 1 100%; width: 100%; }
}

/* Ưu đãi đã áp dụng ghi ngay dưới dòng được giảm (tên ưu đãi và số tiền giảm của dòng đó), hàng tím nhạt đủ bề ngang */
.hd-uu-hang { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 8px; padding: 6px 10px; border-radius: 10px; background: #F0ECF8; color: #5B4A86; font-size: calc(13px * var(--co-chu)); font-weight: 700; line-height: 1.3; }
.hd-uu-ten { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hd-uu-ten svg { flex: none; }
.hd-uu-hang b { white-space: nowrap; flex: none; }
@media (max-width: 767px) { .hd-uu-hang { margin: 0 0 8px; font-size: calc(13.5px * var(--co-chu)); } }

/* Thẻ, gói mua ở hóa đơn này: mỗi thẻ, gói 1 dòng, bấm Kích hoạt ngay trong hóa đơn */
.hd-tg-mua { display: flex; flex-direction: column; gap: 6px; }
.hd-tg-hang { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 10px 6px 12px; border-radius: 12px; background: #F4F0FA; border: 1px solid #E2DAF0; }
.hd-tg-ten { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: calc(14px * var(--co-chu)); color: #4B3C77; }
.hd-tg-ten svg { flex: none; }
.hd-tg-nut { flex: none; height: 38px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--xanh-rung); color: #fff; font-weight: 700; font-size: calc(14px * var(--co-chu)); }
.hd-tg-phai { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hd-tg-nut.phu { background: #fff; color: var(--xanh-rung); border: 1px solid var(--xanh-rung); }
.hd-tg-xong { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--xanh-rung); font-weight: 700; font-size: calc(13px * var(--co-chu)); text-align: right; }
.hd-tg-cho { flex: none; color: var(--chu-phu); font-size: calc(13px * var(--co-chu)); }
.hd-ql-vai { font-weight: 500; opacity: .7; font-size: .9em; }
.hd-huy-gui-toi { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 8px; background: #FBEBC8; color: #7A4E05; font-size: .92em; white-space: nowrap; }
.hd-huy-gui-toi.cho-ban { background: var(--xanh-rung); color: #fff; }
