/* ApiPay Token Checkout — tông LontonAZ (cam đào ấm) */
.atc-wrap { max-width: 1080px; margin: 0 auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: transparent; padding: 8px 4px; color: #3d3d3d; }
/* Chống tràn trang mobile: mọi phần tử trong plugin tính padding/border gộp vào width */
.atc-wrap *, .atc-wrap *::before, .atc-wrap *::after { box-sizing: border-box; }
.atc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.atc-card { background: #fff; border-radius: 18px; padding: 30px 24px 26px; text-align: center;
    box-shadow: 0 8px 28px rgba(232, 147, 12, .14); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.atc-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(232, 147, 12, .22); }
.atc-star { width: 54px; height: 54px; border-radius: 50%; background: #e8930c; color: #6b4405;
    font-size: 27px; line-height: 54px; margin: 0 auto 12px; box-shadow: inset 0 -3px 6px rgba(0,0,0,.12); }
.atc-card-name { margin: 0 0 6px; font-size: 21px; font-weight: 700; color: #3d3d3d; }
.atc-card-price { font-size: 23px; font-weight: 800; color: #e8930c; margin-bottom: 6px; line-height: 1.3; }
.atc-price-strike { text-decoration: line-through; font-size: 15px; color: #aaa; font-weight: 600; display: block; }
.atc-price-loyal { display: block; color: #1a9e4b; margin-top: 2px; }
.atc-loyal-tag { display: inline-block; background: #1a9e4b; color: #fff; font-size: 11px; font-weight: 700;
    padding: 2px 10px; border-radius: 12px; vertical-align: middle; margin-right: 4px; }
.atc-loyalty-teaser { font-size: 12px; color: #a07c2e; background: #fdf6e3; border-radius: 8px;
    padding: 6px 10px; margin-bottom: 6px; }
.atc-div { border: none; border-top: 2px solid #3d3d3d; margin: 4px 12px 14px; }
.atc-feats { list-style: none; padding: 0; margin: 0 0 10px; text-align: left; font-size: 13px; color: #5a5a5a; flex: 1; }
.atc-feats li { position: relative; padding-left: 22px; margin: 9px 0; line-height: 1.5; }
.atc-check { position: absolute; left: 0; top: 0; color: #2e9e5b; font-weight: 800; }
.atc-save { color: #1a9e4b; font-weight: 800; font-size: 22px; margin: 10px 0 2px; letter-spacing: .3px; }
.atc-vs { font-size: 12px; color: #9a9a9a; margin: 3px 0; }
.atc-strip { color: #d63b3b; font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.atc-extra-tag { margin: 3px 0 5px; padding: 0; background: none; border: none; box-shadow: none;
    color: #92400e; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.atc-extra-amt { font-weight: 800; color: #b45309; }
.atc-extra-tag-sub { font-weight: 500; font-size: 12.5px; color: #a8a29e; }
.atc-extra-count { font-weight: 700; color: #c2410c; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atc-strip-info { -webkit-appearance: none; appearance: none;
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 16px !important; height: 16px !important; min-width: 16px !important; max-width: 16px !important;
    padding: 0 !important; margin: 0 0 0 2px !important;
    border: none !important; border-radius: 0 !important;
    background: transparent !important; color: #d63b3b !important; box-shadow: none !important;
    line-height: 1 !important; letter-spacing: 0 !important; text-transform: none !important;
    vertical-align: middle; position: relative; top: -1px; flex: none; cursor: pointer; }
.atc-strip-info:hover { color: #b02a2a !important; }
.atc-strip-info svg { display: block; }
.atc-loyalty-info { -webkit-appearance: none; appearance: none;
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 14px !important; height: 14px !important; min-width: 14px !important; max-width: 14px !important;
    padding: 0 !important; margin: 0 0 0 1px !important;
    border: none !important; border-radius: 0 !important;
    background: transparent !important; color: #b08d3e !important; box-shadow: none !important;
    line-height: 1 !important; vertical-align: middle; position: relative; top: -1px; flex: none; cursor: pointer; }
.atc-loyalty-info:hover { color: #8a6d2a !important; }
.atc-loyalty-info svg { display: block; }
.atc-loyalty-tip { margin: 6px 0 10px; padding: 9px 11px; background: #fff8ec; border: 1px solid #f3d9ae;
    border-radius: 10px; color: #6b5a35; font-size: 12px; line-height: 1.55; text-align: left; }
.atc-strip-tip { margin: -6px 0 14px; padding: 10px 12px; background: #fff8ec; border: 1px solid #f3d9ae;
    border-radius: 10px; color: #6b5a35; font-size: 12.5px; line-height: 1.55; text-align: left; }
.atc-btn { background: linear-gradient(180deg, #f7b733, #e8930c); color: #fff; border: none; border-radius: 10px;
    padding: 12px 26px; font-size: 15px; font-weight: 700; cursor: pointer; letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(232, 147, 12, .35); }
.atc-btn:hover { filter: brightness(1.05); }
.atc-btn:disabled { opacity: .6; cursor: default; }
.atc-btn-ghost { background: #f3ede2; color: #7a5c2e; box-shadow: none; font-weight: 600; }
.atc-checkout { background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 8px 28px rgba(232, 147, 12, .14); }
.atc-checkout h3 { margin-top: 0; color: #3d3d3d; }
.atc-checkout label { display: block; margin: 12px 0; font-size: 14px; }
.atc-checkout input[type="text"], .atc-checkout select { width: 100%; max-width: 380px; padding: 10px 12px;
    border: 1px solid #e0d4bd; border-radius: 10px; font-size: 15px; margin-top: 4px; background: #fffdf8; }
.atc-note { font-size: 13px; color: #8a7a5f; }
.atc-order-code code { background: #fdf3e0; padding: 3px 10px; border-radius: 6px; color: #7a5c2e; }
#atc-qr-img { max-width: 260px; width: 100%; border: 1px solid #f0e4cd; border-radius: 12px; display: block; margin: 0 auto; }
.atc-qr-guide { text-align: center; }
#atc-qr-view { position: relative; }
.atc-scan-back { -webkit-appearance: none; appearance: none; position: absolute; left: 2px; bottom: 0;
    display: inline-flex !important; align-items: center; justify-content: center;
    padding: 6px !important; margin: 0 !important;
    border: none !important; border-radius: 0 !important;
    background: transparent !important; color: #c2b49b !important; box-shadow: none !important;
    line-height: 1 !important; cursor: pointer; opacity: .8; }
.atc-scan-back:hover { color: #7a5c2e !important; opacity: 1; }
.atc-scan-back svg { display: block; }
.atc-qr-actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }
.atc-qr-tip { text-align: center; font-size: 12px; margin: 8px 0 0; }
.atc-status { margin-top: 20px; text-align: center; }
.atc-badge { display: inline-block; padding: 5px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.atc-pending { background: #fff3cd; color: #856404; }
.atc-paid { background: #d4edda; color: #155724; }
.atc-expired { background: #f8d7da; color: #721c24; }
.atc-failed { background: #f8d7da; color: #721c24; }
.atc-fulfill-failed { background: #fdf0ef; border: 1px solid #f0c0bc; border-radius: 12px;
    padding: 14px 16px; margin: 12px 0; text-align: center; }
.atc-fulfill-failed p { margin: 8px 0; line-height: 1.55; }
#atc-token-link { font-family: monospace; }
/* Lịch sử mua hàng: nút trôi mép trái + panel trượt */
#atc-history-fab { position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 999997;
    background: linear-gradient(180deg, #f7b733, #e8930c); color: #fff; border: none; cursor: pointer;
    border-radius: 0 12px 12px 0; padding: 12px 7px; display: flex; flex-direction: column;
    align-items: center; gap: 6px; box-shadow: 2px 0 14px rgba(232, 147, 12, .45);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif; touch-action: manipulation; }
.atc-fab-icon { font-size: 20px; line-height: 1; }
.atc-fab-text { writing-mode: vertical-rl; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
#atc-history-fab:hover { filter: brightness(1.06); }
.atc-history-drawer { position: fixed; top: calc(100vh / 7); left: 0; bottom: 0; width: min(400px, 90vw); z-index: 999999;
    background: #fffdf8; box-shadow: 4px 0 28px rgba(0, 0, 0, .2); flex-direction: column;
    border-radius: 20px 20px 0 0; overflow: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.atc-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px;
    background: linear-gradient(180deg, #f7b733, #e8930c); color: #fff; font-size: 13px; flex-shrink: 0; }
#atc-history-close { background: none; border: none; color: #fff; font-size: 15px; cursor: pointer; padding: 2px 6px; }
.atc-drawer-overlay { position: fixed; inset: 0; background: rgba(60, 40, 10, .35); z-index: 999998; }
.atc-history { overflow-y: auto; padding: 6px 18px 18px; flex: 1; -webkit-overflow-scrolling: touch; }
.atc-hist-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Tránh double-tap-zoom nuốt mất thao tác chạm trên mobile */
.atc-btn, .atc-hist-link, .atc-site-pill { touch-action: manipulation; }
/* Khi drawer/fab được JS chuyển ra body thì vẫn giữ box-sizing + font */
#atc-history-drawer, #atc-history-drawer *, #atc-history-drawer *::before, #atc-history-drawer *::after,
#atc-history-fab, #atc-history-fab *, #atc-drawer-overlay { box-sizing: border-box; }
.atc-hist-item { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px dashed #f0e4cd; font-size: 14px; flex-wrap: wrap; }
.atc-hist-item:last-child { border-bottom: none; }
.atc-hist-item small { color: #999; }
.atc-checkout input[type="text"], .atc-checkout select { display: block; margin-left: auto; margin-right: auto; }
.atc-hist-link { font-family: monospace; font-size: 11px; color: #7a5c2e; width: 100%; max-width: 200px;
    border: 1px solid #f0e4cd; border-radius: 8px; padding: 4px 8px; background: #fffdf8; margin-top: 4px;
    -webkit-user-select: text; user-select: text; }
.atc-wait { background: #fdf3e0; color: #b07208; }
.atc-checkout input[type="text"]:focus, .atc-checkout select:focus { outline: none; border-color: #e8930c; box-shadow: 0 0 0 3px rgba(232, 147, 12, .15); }
.atc-checkout select { height: 46px; }
/* Chia form thành 2 khối rõ ràng cho đỡ rối mắt */
.atc-form-section { background: #fffdf8; border: 1px solid #f5e9d2; border-radius: 14px; padding: 18px; margin-bottom: 12px; }
.atc-section-title { font-weight: 800; color: #b07208; font-size: 15px; margin-bottom: 14px; }
.atc-form-section .atc-sites { margin-top: 2px; }
.atc-form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* Form cung cấp thông tin: căn giữa toàn bộ */
#atc-co-form, #atc-co-form .atc-form-section { text-align: center; }
#atc-co-form .atc-note { text-align: center; }
/* Thông báo lỗi: hộp gọn, tự xuống dòng, không tràn màn hình */
.atc-error { color: #b3261e; font-size: 13.5px; background: #fdecea; border: 1px solid #f5c6c0;
    border-radius: 10px; padding: 10px 14px; margin: 12px 0; word-break: break-word; max-width: 100%; }
/* Hộp lưu ý ở trang thanh toán thành công */
.atc-success-tips { background: #fdf6e3; border: 1px solid #f0dfc0; border-radius: 12px;
    padding: 12px 16px; margin: 14px 0; font-size: 13.5px; color: #6b5a35; text-align: left; }
.atc-tips-title { margin: 0; font-weight: 800; color: #b07208; }
.atc-success-tips ul { margin: 8px 0 4px; padding-left: 18px; }
.atc-success-tips li { margin: 6px 0; line-height: 1.55; }
@media (max-width: 480px) {
    .atc-step { font-size: 11px; gap: 4px; justify-content: center; }
    .atc-step span:last-child { display: none; } /* mobile chỉ hiện số bước cho gọn, khỏi tràn */
    .atc-step-n { width: 24px; height: 24px; font-size: 12px; }
    .atc-checkout { padding: 12px 8px; }
    .atc-form-section { padding: 10px 8px; }
}
.atc-btn-small { padding: 4px 10px; font-size: 12px; border-radius: 8px; font-weight: 600; }
.atc-buy { font-size: 13px; padding: 9px 24px; align-self: center; }
/* Hoạt ảnh chờ dễ thương */
.atc-loader { display: flex; justify-content: center; align-items: center; height: 92px; margin: 8px 0; }
.atc-loader > span { font-size: 42px; display: inline-block; line-height: 1; }
.atc-loader-orbit > span { animation: atc-orbit 2.4s linear infinite; }
@keyframes atc-orbit {
    from { transform: rotate(0deg) translateX(36px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(36px) rotate(-360deg); }
}
.atc-loader-waddle > span { animation: atc-waddle 2.6s ease-in-out infinite; }
@keyframes atc-waddle {
    0% { transform: translateX(-34px) scaleX(1); }
    49% { transform: translateX(34px) scaleX(1); }
    50% { transform: translateX(34px) scaleX(-1); }
    99% { transform: translateX(-34px) scaleX(-1); }
    100% { transform: translateX(-34px) scaleX(1); }
}
.atc-loader-peek > span { animation: atc-peek 2.1s ease-in-out infinite; }
@keyframes atc-peek {
    0%, 100% { transform: translateX(-30px) rotate(-14deg); }
    50% { transform: translateX(30px) rotate(14deg); }
}
/* Hộp thông tin khách ở đầu lịch sử */
.atc-cust-box { background: #fdf3e0; border: 1px solid #f0dfc0; border-radius: 12px;
    padding: 12px 14px; margin: 12px 0 4px; font-size: 13.5px; color: #6b5a35; }
.atc-cust-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.atc-cust-head strong { color: #b07208; font-size: 14px; }
.atc-cust-row { margin: 4px 0; }
/* Huy hiệu phương thức thanh toán dưới mỗi gói */
.atc-pay-methods { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.atc-pay-badge { font-size: 11px; font-weight: 600; color: #7a5c2e; background: #fdf3e0;
    border: 1px solid #f0dfc0; border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
/* Thanh tiến trình 4 bước */
.atc-steps { display: flex; align-items: center; margin-bottom: 22px; }
.atc-step { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b3a68d; font-weight: 600; position: relative; }
.atc-step-n { width: 28px; height: 28px; border-radius: 50%; background: #f0e8d8; color: #a08c66;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.atc-step-active { color: #e8930c; }
.atc-step-active .atc-step-n { background: #e8930c; color: #fff; box-shadow: 0 0 0 4px rgba(232, 147, 12, .18); }
.atc-step-done { color: #1a9e4b; }
.atc-step-done .atc-step-n { background: #1a9e4b; color: #fff; }
.atc-step:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: #f0e8d8; margin: 0 8px; border-radius: 2px; }
.atc-step-done:not(:last-child)::after { background: #1a9e4b; }
/* Trang checkout tinh chỉnh */
.atc-checkout { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 8px 28px rgba(232, 147, 12, .14); max-width: 640px; margin: 0 auto; }
.atc-checkout h3 { margin-top: 0; color: #3d3d3d; font-size: 19px; }
.atc-co-amount { color: #e8930c; font-size: 16px; }
.atc-field { margin: 14px 0; }
.atc-label { display: block; font-size: 14px; font-weight: 600; color: #3d3d3d; margin-bottom: 8px; }
.atc-hint { font-weight: 400; font-size: 12.5px; color: #a08c66; }
.atc-sites { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.atc-site-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 2px solid #f0e4cd;
    border-radius: 24px; font-size: 12px; font-weight: 600; color: #7a5c2e; cursor: pointer; background: #fffdf8;
    transition: border-color .15s, background .15s; margin: 0; }
.atc-site-pill input { accent-color: #e8930c; margin: 0; }
.atc-site-pill:has(input:checked) { border-color: #e8930c; background: #fdf3e0; color: #b07208; }
#atc-live-site-other { margin-top: 8px; }
@media (max-width: 640px) { .atc-grid { grid-template-columns: 1fr 1fr; gap: 14px; } .atc-card { padding: 22px 14px; } }
@media (max-width: 420px) { .atc-grid { grid-template-columns: 1fr; } }
/* 1.0.36: mục liên hệ gộp 1 hàng (chọn kênh + ô nhập cạnh nhau) */
.atc-checkout .atc-contact-row { display: flex; gap: 8px; justify-content: center; max-width: 460px; margin: 2px auto 0; }
.atc-checkout .atc-contact-row select { flex: 0 0 158px; width: auto; max-width: none; margin: 0; }
.atc-checkout .atc-contact-row input[type="text"] { flex: 1; min-width: 0; width: auto; max-width: none; margin: 0; }
@media (max-width: 480px) {
    .atc-checkout .atc-contact-row { flex-direction: column; }
    .atc-checkout .atc-contact-row select { flex: none; width: 100%; }
}
/* 1.0.36: hộp tích xác nhận nick + nút tạo đơn bị khóa thì mờ + báo không bấm được */
#atc-nick-confirm-row input[type="checkbox"] { cursor: pointer; }
#atc-submit:disabled { cursor: not-allowed; }
