/* ติดตั้งเป็นแอพ + แจ้งเตือนบนเครื่อง — V1.0.329 · ใช้ทั้งหน้าร้านและหลังบ้าน (prefix dxa-)
 * 🇹🇭 ข้อความส่วนใหญ่เป็นไทย → Prompt + letter-spacing 0 ทุกจุด */
.dxa-modal, .dxa-install-card, .dxa-install-link, .dxa-footer-app, .dxa-banner, .dxa-sheet, .dxa-toast, .dxa-push {
    font-family: 'Prompt', 'DM Sans', system-ui, sans-serif;
    letter-spacing: 0;
    box-sizing: border-box;
}
.dxa-modal *, .dxa-banner *, .dxa-sheet *, .dxa-push *, .dxa-install-card * { box-sizing: border-box; letter-spacing: 0; }

/* ---- ปุ่ม ---- */
.dxa-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px 18px; border: 1px solid #111; background: #111; color: #fff;
    font: 600 15px/1.2 'Prompt', sans-serif; cursor: pointer; transition: transform .12s ease, opacity .12s ease;
}
.dxa-btn:active { transform: scale(.98); }
.dxa-btn:disabled { opacity: .5; cursor: default; }
.dxa-btn.is-ghost { background: transparent; color: #111; border-color: #d4d4d4; }
.dxa-btn.is-sm { width: auto; padding: 9px 16px; font-size: 13px; }

/* ---- การ์ดติดตั้ง ---- */
.dxa-install-card {
    display: flex; align-items: center; gap: 14px; width: 100%; margin: 18px 0 0; padding: 14px 14px 14px 16px;
    border: 0; border-radius: 18px; text-align: left; cursor: pointer; color: #fff;
    background: radial-gradient(120% 140% at 0% 0%, #3a3a3a 0%, #111 55%, #000 100%);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .22); transition: transform .15s ease, box-shadow .15s ease;
}
.dxa-install-card[hidden] { display: none; }
.dxa-install-card:hover { transform: translateY(-1px); box-shadow: 0 18px 36px rgba(0, 0, 0, .28); }
.dxa-install-card:active { transform: scale(.985); }
.dxa-install-card__icon {
    flex: none; width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.dxa-install-card__icon svg { width: 24px; height: 24px; }
.dxa-install-card__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dxa-install-card__text strong { font-size: 16px; font-weight: 700; }
.dxa-install-card__text small { font-size: 12.5px; color: rgba(255, 255, 255, .72); line-height: 1.4; }
.dxa-install-card__go {
    flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .14);
}
.dxa-install-card__go svg { width: 18px; height: 18px; }
.dxa-install-link {
    display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit;
    font: 500 13px/1.4 'Prompt', sans-serif; text-decoration: underline; cursor: pointer;
}
.dxa-install-link[hidden] { display: none; }
.dxa-install-link svg { width: 16px; height: 16px; }

/* ---- popup วิธีติดตั้ง ---- */
.dxa-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center; }
.dxa-modal[hidden] { display: none; }
.dxa-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .18s ease; }
.dxa-modal__card {
    position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; background: #fff; color: #111;
    padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
    transform: translateY(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
.dxa-modal.is-open .dxa-modal__backdrop { opacity: 1; }
.dxa-modal.is-open .dxa-modal__card { transform: none; opacity: 1; }
.dxa-modal__x {
    position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: #f1f1f1; color: #111; font-size: 22px; line-height: 1; cursor: pointer;
}
.dxa-modal__head { display: flex; align-items: center; gap: 14px; margin: 0 40px 16px 0; }
.dxa-modal__head img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .15); flex: none; }
.dxa-modal__head strong { display: block; font-size: 18px; font-weight: 700; }
.dxa-modal__head span { display: block; font-size: 13px; color: #666; margin-top: 2px; }
.dxa-perks { list-style: none; margin: 0 0 18px; padding: 12px 14px; background: #f6f6f6; display: grid; gap: 6px; font-size: 13.5px; }
.dxa-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dxa-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.55; }
.dxa-steps li[hidden] { display: none; }
.dxa-steps b {
    flex: none; width: 26px; height: 26px; border-radius: 50%; background: #111; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.dxa-ico { display: inline-flex; vertical-align: -4px; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; background: #eef4ff; color: #0a64d8; }
.dxa-ico svg { width: 16px; height: 16px; }
.dxa-note { margin: 14px 0 0; font-size: 12.5px; color: #666; line-height: 1.55; }
.dxa-note.is-warn { margin: 0 0 14px; padding: 12px 14px; background: #fff7e6; color: #7a5200; font-size: 13.5px; }
@media (min-width: 640px) {
    .dxa-modal { align-items: center; }
    .dxa-modal__card { border-radius: 22px; padding-bottom: 24px; }
}

/* ---- แถบแนะนำติดตั้ง (มือถือ) ---- */
.dxa-banner {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 8000;
    display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; background: #111; color: #fff;
    border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    transform: translateY(140%); transition: transform .3s cubic-bezier(.2, .8, .3, 1);
}
.dxa-banner.is-on { transform: none; }
.dxa-banner img { width: 44px; height: 44px; border-radius: 11px; flex: none; background: #fff; }
.dxa-banner__text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.dxa-banner__text strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dxa-banner__text span { font-size: 12px; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dxa-banner__go { flex: none; border: 0; border-radius: 999px; background: #fff; color: #111; padding: 9px 16px; font: 700 13px/1 'Prompt', sans-serif; cursor: pointer; }
.dxa-banner__x { flex: none; width: 30px; height: 30px; border: 0; background: transparent; color: rgba(255, 255, 255, .7); font-size: 22px; cursor: pointer; }
/* หน้าที่มีแถบเมนูล่างมือถือ — ยกแถบขึ้นไม่ให้ทับ */
body:has(.dxmn-mnav) .dxa-banner { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* ---- ชวนเปิดแจ้งเตือน ---- */
.dxa-sheet { position: fixed; inset: 0; z-index: 8500; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background .25s ease; }
.dxa-sheet.is-on { background: rgba(0, 0, 0, .45); }
.dxa-sheet__card {
    width: 100%; max-width: 440px; background: #fff; color: #111; text-align: center; display: grid; gap: 10px;
    padding: 26px 22px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
    transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .3, 1);
}
.dxa-sheet.is-on .dxa-sheet__card { transform: none; }
.dxa-sheet__bell { font-size: 40px; line-height: 1; }
.dxa-sheet__card strong { font-size: 19px; }
.dxa-sheet__card p { margin: 0 0 8px; color: #555; font-size: 14px; line-height: 1.55; }

/* ---- toast ---- */
.dxa-toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 9500; max-width: calc(100vw - 32px);
    transform: translate(-50%, 14px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 999px;
    background: #111; color: #fff; font-size: 14px; transition: opacity .2s ease, transform .2s ease;
}
.dxa-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.dxa-toast.is-error { background: #b91c1c; }

/* ---- การ์ดตั้งค่าแจ้งเตือน ---- */
.dxa-push { border: 1px solid #e5e5e5; background: #fff; color: #111; padding: 18px; display: grid; gap: 12px; }
.dxa-push.is-busy { opacity: .7; }
.dxa-push__head { display: flex; align-items: center; gap: 12px; }
.dxa-push__icon { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #111; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.dxa-push__title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dxa-push__title strong { font-size: 15px; }
.dxa-push__title small { font-size: 12.5px; color: #666; line-height: 1.45; }
.dxa-push__state { margin: 0; font-size: 13px; line-height: 1.5; }
.dxa-push__state.is-ok { color: #15803d; }
.dxa-push__state.is-muted { color: #666; }
.dxa-push__state.is-warn { color: #92400e; }
.dxa-push__state.is-danger { color: #b91c1c; }
.dxa-push__ios { margin: 0; padding: 10px 12px; background: #f6f6f6; font-size: 13px; line-height: 1.55; }
.dxa-push__ios[hidden] { display: none; }
.dxa-push__cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dxa-push__cats[hidden] { display: none; }
.dxa-cat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #e5e5e5; font-size: 13px; cursor: pointer; min-width: 0; }
.dxa-cat.is-admin { background: #fafafa; }
.dxa-cat input { width: 16px; height: 16px; flex: none; accent-color: #111; }
.dxa-cat i { font-size: 17px; flex: none; }
.dxa-cat span { min-width: 0; }
.dxa-push [data-dxa-push-test] { justify-self: start; }
.dxa-push [data-dxa-push-test][hidden] { display: none; }
@media (max-width: 560px) { .dxa-push__cats { grid-template-columns: 1fr; } }

/* สวิตช์ */
.dxa-switch { position: relative; flex: none; width: 48px; height: 28px; cursor: pointer; }
.dxa-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dxa-switch span { position: absolute; inset: 0; border-radius: 999px; background: #d4d4d4; transition: background .15s ease; pointer-events: none; }
.dxa-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.dxa-switch input:checked + span { background: #16a34a; }
.dxa-switch input:checked + span::after { transform: translateX(20px); }
.dxa-switch input:disabled + span { opacity: .5; }
.dxa-switch input:focus-visible + span { outline: 2px solid #111; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .dxa-modal__card, .dxa-modal__backdrop, .dxa-banner, .dxa-sheet, .dxa-sheet__card, .dxa-toast, .dxa-install-card { transition: none; }
}

/* ---- จุดวางในหน้า account ---- */
.account-app-block { display: grid; gap: 12px; margin: 0 0 22px; }
.account-app-block .dxa-install-card { margin: 0; }

/* ---- ปุ่มติดตั้งท้ายเว็บ (แทนป้ายช่องทางชำระเงิน · V1.0.330) ---- */
.dxa-footer-app {
    display: inline-flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid #111; border-radius: 14px;
    background: #111; color: #fff; cursor: pointer; text-align: left; transition: transform .15s ease, box-shadow .15s ease;
}
.dxa-footer-app[hidden] { display: none; }
.dxa-footer-app:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, .2); }
.dxa-footer-app:active { transform: scale(.98); }
.dxa-footer-app img { width: 40px; height: 40px; border-radius: 10px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.dxa-footer-app__text { display: grid; gap: 1px; }
.dxa-footer-app__text strong { font-size: 14px; font-weight: 600; }
.dxa-footer-app__text small { font-size: 11.5px; color: rgba(255, 255, 255, .65); }
.dxa-footer-app__go { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); flex: none; }
.dxa-footer-app__go svg { width: 16px; height: 16px; }