/* ITSO Mua nhanh – popup "Đặt mua nhanh" + bảng chọn tỉnh / phường. Nạp ở trang sản phẩm. */

/* ---------- Popup "Đặt mua nhanh" (templates/quick-order-popup.php hoặc itso-quick-order/popup.php trong theme) ---------- */
.nexpc-qo { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.nexpc-qo[hidden] { display: none; }
.nexpc-qo__backdrop { position: absolute; inset: 0; background: rgba(10, 31, 68, .55); backdrop-filter: blur(3px); }
.nexpc-qo__dialog {
	position: relative; display: flex; flex-direction: column; width: 100%; max-width: 980px; max-height: calc(100vh - 3rem);
	overflow: hidden; overflow: clip; border-radius: 1.4rem; background: #fff; box-shadow: 0 30px 80px -20px rgba(10, 31, 68, .45); animation: nexpc-qo-in .2s ease-out;
}
/* Vùng cuộn (tóm tắt + form); thanh trên / dưới chỉ dùng trên điện thoại. */
.nexpc-qo__body { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.nexpc-qo__head, .nexpc-qo__foot { display: none; }
.nexpc-qo__summary { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; padding: 1.75rem 1.6rem; border-right: 1px solid #E2E8F0; background: linear-gradient(180deg, #F3F8FF, #EAF2FF); color: #334155; }
.nexpc-qo__form { padding: 1.6rem 1.75rem; }
.nexpc-qo__label { display: block; margin-bottom: .3rem; font-size: .8125rem; font-weight: 600; color: #0A1F44; }
.nexpc-qo__err { min-height: 0; margin-top: .25rem; font-size: .8125rem; color: #E11D48; }
.nexpc-qo__err:empty { display: none; }
.nexpc-qo select.nexpc-rv-input, .nexpc-qo select.nexpc-qo__input { height: 2.75rem; padding-top: 0; padding-bottom: 0; }
.nexpc-qo select.nexpc-rv-input:disabled, .nexpc-qo select.nexpc-qo__input:disabled { background: #F8FAFC; color: #94A3B8; }
.nexpc-qo__pay { position: relative; display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .75rem; border: 1.5px solid #E2E8F0; border-radius: .8rem; cursor: pointer; line-height: 1.35; transition: border-color .15s, background-color .15s; }
.nexpc-qo__pay:has(input:checked) { border-color: #1D57D8; background: #EEF4FF; }
.nexpc-qo__pay:has(input:focus-visible) { box-shadow: 0 0 0 3px #B9CFFD; }
.nexpc-qo__pay[hidden] { display: none; }
.nexpc-qo__dot { width: 1.1rem; height: 1.1rem; margin-top: .1rem; flex-shrink: 0; border: 2px solid #CBD5E1; border-radius: 9999px; }
.nexpc-qo__pay:has(input:checked) .nexpc-qo__dot { border: 5px solid #1D57D8; }
@keyframes nexpc-qo-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
	/* Điện thoại: toàn màn hình – thanh trên (tiêu đề + nút đóng) và thanh dưới (tổng tiền + Đặt hàng) luôn hiện,
	   chỉ phần giữa cuộn. Ô nhập 16px để Safari không tự phóng to trang khi chạm vào. */
	.nexpc-qo { align-items: stretch; padding: 0; }
	.nexpc-qo__backdrop { display: none; }
	.nexpc-qo__dialog { max-width: none; height: 100%; max-height: none; border-radius: 0; box-shadow: none; animation-name: nexpc-qo-up; }
	.nexpc-qo__head { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: .75rem; padding: calc(env(safe-area-inset-top, 0px) + .5rem) .75rem .5rem 1rem; border-bottom: 1px solid #E2E8F0; background: #fff; }
	.nexpc-qo__foot { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem calc(env(safe-area-inset-bottom, 0px) + .65rem); border-top: 1px solid #E2E8F0; background: #fff; box-shadow: 0 -10px 24px -14px rgba(10, 31, 68, .25); }
	.nexpc-qo__x, .nexpc-qo__title, .nexpc-qo__form [data-qo-submit] { display: none; }
	.nexpc-qo__body { display: block; }
	.nexpc-qo .nexpc-rv-input { font-size: 16px; }
	.nexpc-qo__summary { gap: 1rem; padding: 1rem; border-right: 0; border-bottom: 1px solid #E2E8F0; }
	.nexpc-qo__form { padding: 1rem 1rem 1.25rem; }
	@keyframes nexpc-qo-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* Bảng chọn có ô tìm (assets/js/picker.js): tỉnh / phường trong popup "Mua ngay". */
html .nexpc-pk-wrap { position: relative; display: block; }
html .nexpc-pk-hit { position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0.75rem; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html .nexpc-pk-hit:disabled { cursor: not-allowed; }
html .nexpc-pk-hit:focus-visible { outline: none; box-shadow: 0 0 0 4px #DCE7FE; }
html .nexpc-pk-wrap:has(.nexpc-pk-hit:focus-visible) select { border-color: #2F6BEA; }
html.nexpc-pk-open, html.nexpc-pk-open body { overflow: hidden; }
html .nexpc-pk { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
html .nexpc-pk[hidden] { display: none; }
html .nexpc-pk__backdrop { position: absolute; inset: 0; background: rgba(10, 31, 68, 0.45); }
html .nexpc-pk__panel { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 440px; height: min(620px, 80vh); overflow: hidden; border-radius: 1.25rem; background: #fff; box-shadow: 0 24px 60px -20px rgba(10, 31, 68, 0.45); }
html .nexpc-pk__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.875rem 1rem 0.5rem 1.25rem; }
html .nexpc-pk__title { margin: 0; font-size: 1.0625rem; font-weight: 800; color: #0A1F44; }
html .nexpc-pk__x { display: flex; width: 2.5rem; height: 2.5rem; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 9999px; border: 1px solid #E2E8F0; background: #fff; font-size: 1.125rem; color: #334155; }
html .nexpc-pk__search { display: flex; align-items: center; gap: 0.625rem; margin: 0 1rem 0.5rem; padding: 0 0.875rem; height: 3rem; border: 1.5px solid #2F6BEA; border-radius: 0.875rem; background: #fff; color: #94A3B8; box-shadow: 0 0 0 4px #DCE7FE; }
html .nexpc-pk__search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16px; color: #0A1F44; }
html .nexpc-pk__search input::-webkit-search-cancel-button { cursor: pointer; }
html .nexpc-pk__list { flex: 1; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0.25rem 0.5rem 1rem; list-style: none; -webkit-overflow-scrolling: touch; }
html .nexpc-pk__opt { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 3rem; padding: 0.5rem 0.875rem; border-radius: 0.75rem; font-size: 15.5px; color: #1E293B; cursor: pointer; }
html .nexpc-pk__opt[hidden] { display: none; }
html .nexpc-pk__opt + .nexpc-pk__opt { border-top: 1px solid #F1F5F9; }
html .nexpc-pk__opt:hover, html .nexpc-pk__opt.is-active { background: #EEF4FF; border-top-color: transparent; }
html .nexpc-pk__opt[aria-selected="true"] { font-weight: 700; color: #1D57D8; }
html .nexpc-pk__opt[aria-selected="true"]::after { content: "\2713"; font-weight: 800; }
html .nexpc-pk__empty { margin: 0; padding: 1.5rem 1.25rem; text-align: center; font-size: 14px; color: #64748B; }
@media (max-width: 767px) {
	html .nexpc-pk { align-items: flex-end; padding: 0; }
	html .nexpc-pk__panel { max-width: none; height: calc(100% - 2.5rem); border-radius: 1.25rem 1.25rem 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
	html .nexpc-pk__panel[style*="top"] { position: absolute; left: 0; right: 0; }
}

/* ---------- Giao diện mặc định của plugin (templates/quick-order-popup.php, class .nexpc-qo--plugin) ----------
   Không cần Tailwind / Font Awesome. Đổi màu chủ đạo: .nexpc-qo--plugin { --ivqo-accent: #e11d48; } */
html.overflow-hidden { overflow: hidden; }
.nexpc-qo--plugin { --ivqo-accent: #1D57D8; --ivqo-accent-soft: #EEF4FF; --ivqo-text: #0F172A; --ivqo-muted: #64748B; --ivqo-line: #E2E8F0; color: var(--ivqo-text); font-size: 15px; line-height: 1.5; text-align: left; }
.nexpc-qo--plugin *, .nexpc-qo--plugin *::before, .nexpc-qo--plugin *::after { box-sizing: border-box; }
.nexpc-qo--plugin p { margin: 0; }
.nexpc-qo--plugin .hidden { display: none !important; }
.nexpc-qo--plugin .nexpc-qo__summary { background: linear-gradient(180deg, #F8FAFF, var(--ivqo-accent-soft)); }
.nexpc-qo--plugin .ivqo-h { font-size: 1.1rem; font-weight: 800; }
.nexpc-qo--plugin .ivqo-close { display: flex; width: 2.4rem; height: 2.4rem; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--ivqo-line); border-radius: 999px; background: #fff; color: #475569; cursor: pointer; }
.nexpc-qo--plugin .ivqo-close--corner { position: absolute; top: .85rem; right: .85rem; z-index: 2; }
.nexpc-qo--plugin .ivqo-kicker { margin-bottom: .75rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-product { display: flex; align-items: center; gap: 1rem; padding: .85rem; border: 1px solid var(--ivqo-line); border-radius: 1rem; background: #fff; }
.nexpc-qo--plugin .ivqo-product img { width: 84px; height: 84px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--ivqo-line); border-radius: .75rem; }
.nexpc-qo--plugin .ivqo-name { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nexpc-qo--plugin .ivqo-price { margin-top: .4rem; font-size: 1.1rem; font-weight: 800; color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; }
.nexpc-qo--plugin .ivqo-qty-row { margin-top: .85rem; }
.nexpc-qo--plugin .ivqo-strong { font-size: .9rem; font-weight: 600; }
.nexpc-qo--plugin .ivqo-qty { display: inline-flex; height: 2.5rem; align-items: center; border: 1px solid #CBD5E1; border-radius: .75rem; background: #fff; }
.nexpc-qo--plugin .ivqo-qty button { width: 2.25rem; height: 100%; padding: 0; border: 0; background: none; color: #475569; font-size: 1.1rem; cursor: pointer; }
.nexpc-qo--plugin .ivqo-qty input { width: 2.6rem; height: 100%; padding: 0; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.nexpc-qo--plugin .ivqo-qty input::-webkit-inner-spin-button, .nexpc-qo--plugin .ivqo-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.nexpc-qo--plugin .ivqo-totals { padding-top: .5rem; border-top: 1px dashed #BFD3FB; font-size: .9rem; }
.nexpc-qo--plugin .ivqo-totals small { color: var(--ivqo-muted); }
.nexpc-qo--plugin .ivqo-hint { padding-bottom: .25rem; font-size: .78rem; color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-total { margin-top: .35rem; padding-top: .75rem; border-top: 1px solid #DCE7FE; }
.nexpc-qo--plugin .ivqo-total b:last-child { font-size: 1.35rem; font-weight: 800; color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-eta { display: flex; margin-top: .75rem; padding: .6rem .8rem; border-radius: .75rem; background: #DCFCE7; color: #166534; font-size: .85rem; font-weight: 600; }
.nexpc-qo--plugin .ivqo-perks { margin: 0; padding: .9rem 1rem; list-style: none; border: 1px solid var(--ivqo-line); border-radius: 1rem; background: rgba(255, 255, 255, .7); font-size: .82rem; color: #334155; }
.nexpc-qo--plugin .ivqo-perks li { position: relative; margin: 0; padding: .2rem 0 .2rem 1.4rem; }
.nexpc-qo--plugin .ivqo-perks li::before { content: "\2713"; position: absolute; left: 0; font-weight: 800; color: #16A34A; }
.nexpc-qo--plugin .ivqo-title { padding-right: 2.5rem; font-size: 1.35rem; font-weight: 800; }
.nexpc-qo--plugin .ivqo-sub { margin: .25rem 0 1rem; font-size: .88rem; color: var(--ivqo-muted); }
.nexpc-qo--plugin .ivqo-alert { margin-bottom: .75rem; padding: .6rem .85rem; border-radius: .75rem; background: #FFF1F2; color: #BE123C; font-size: .88rem; }
.nexpc-qo--plugin .ivqo-grid { display: grid; gap: .75rem; }
@media (min-width: 640px) { .nexpc-qo--plugin .ivqo-grid { grid-template-columns: 1fr 1fr; } }
.nexpc-qo--plugin .ivqo-field, .nexpc-qo--plugin .ivqo-note { margin-top: .75rem; }
.nexpc-qo--plugin .ivqo-star { color: #E11D48; }
.nexpc-qo--plugin .ivqo-muted { font-weight: 400; color: var(--ivqo-muted); }
.nexpc-qo--plugin .nexpc-qo__input { display: block; width: 100%; max-width: none; margin: 0; padding: .65rem .9rem; border: 1px solid #CBD5E1; border-radius: .75rem; background: #fff; color: var(--ivqo-text); font: inherit; font-size: .94rem; line-height: 1.4; box-shadow: none; }
.nexpc-qo--plugin textarea.nexpc-qo__input { min-height: 4.5rem; margin-top: .5rem; resize: vertical; }
.nexpc-qo--plugin .nexpc-qo__input:focus { outline: none; border-color: #2F6BEA; box-shadow: 0 0 0 4px #DCE7FE; }
.nexpc-qo--plugin .nexpc-qo__input.is-invalid { border-color: #E11D48; }
.nexpc-qo--plugin .ivqo-check { display: flex; align-items: flex-start; gap: .5rem; margin-top: .5rem; font-size: .85rem; color: #475569; cursor: pointer; }
.nexpc-qo--plugin .ivqo-check input { margin-top: .2rem; accent-color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-note summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ivqo-accent); list-style: none; }
.nexpc-qo--plugin .ivqo-note summary::-webkit-details-marker { display: none; }
.nexpc-qo--plugin .ivqo-pay-label { margin-top: 1rem; }
.nexpc-qo--plugin .nexpc-qo__pay b { display: block; font-size: .85rem; }
.nexpc-qo--plugin .nexpc-qo__pay small { font-size: .75rem; color: var(--ivqo-muted); }
.nexpc-qo--plugin .nexpc-qo__pay:has(input:checked) { border-color: var(--ivqo-accent); background: var(--ivqo-accent-soft); }
.nexpc-qo--plugin .nexpc-qo__pay:has(input:checked) .nexpc-qo__dot { border-color: var(--ivqo-accent); }
.nexpc-qo--plugin .ivqo-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.nexpc-qo--plugin .ivqo-submit { display: flex; width: 100%; height: 3.25rem; margin-top: 1rem; align-items: center; justify-content: center; border: 0; border-radius: 1rem; background: var(--ivqo-accent); color: #fff; font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; }
.nexpc-qo--plugin .ivqo-submit:hover { filter: brightness(.93); }
.nexpc-qo--plugin .ivqo-submit:disabled { cursor: wait; opacity: .7; }
.nexpc-qo--plugin .ivqo-submit--bar { width: auto; height: 3rem; margin: 0; padding: 0 1.5rem; flex-shrink: 0; }
.nexpc-qo--plugin .ivqo-foot-note { margin-top: .6rem; text-align: center; font-size: .8rem; color: #94A3B8; }
.nexpc-qo--plugin .ivqo-foot-note a { font-weight: 700; color: #475569; }
.nexpc-qo--plugin .ivqo-foot-total { min-width: 0; }
.nexpc-qo--plugin .ivqo-foot-total small { display: block; font-size: .75rem; color: var(--ivqo-muted); }
.nexpc-qo--plugin .ivqo-foot-total b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1.1rem; font-weight: 800; color: var(--ivqo-accent); }
.nexpc-qo--plugin .font-semibold { font-weight: 600; }
.nexpc-qo--plugin .text-green-600 { color: #16A34A; }
.nexpc-qo--plugin .text-slate-400 { color: #94A3B8; }
@media (max-width: 767px) {
	.nexpc-qo--plugin .nexpc-qo__input { font-size: 16px; }
}
/* Nút "Mua ngay" do plugin in (theme khác). */
form.cart .itso-buy-now { margin-left: .5em; white-space: nowrap; }
/* Cách giao: tiêu chuẩn / hỏa tốc (JS chèn khi địa chỉ thuộc vùng giao hỏa tốc). */
.nexpc-qo .ivqo-ship { margin-top: 1rem; }
.nexpc-qo .ivqo-ship[hidden] { display: none; }
.nexpc-qo .ivqo-ship-grid { display: grid; gap: .6rem; }
@media (min-width: 640px) { .nexpc-qo .ivqo-ship-grid { grid-template-columns: 1fr 1fr; } }
.nexpc-qo .ivqo-ship input { position: absolute; opacity: 0; pointer-events: none; }
.nexpc-qo .ivqo-ship b { display: block; font-size: .85rem; }
.nexpc-qo .ivqo-ship small { display: block; margin-top: .1rem; font-size: .75rem; color: #64748B; }
.nexpc-qo .ivqo-ship [data-ship="express"] b { color: #B91C1C; }
.nexpc-qo .ivqo-ship .is-disabled { cursor: not-allowed; background: #F8FAFC; opacity: .65; }
/* Ô "Tôi tới cửa hàng lấy hàng" (JS chèn trước ô Tỉnh / Thành phố). */
.nexpc-qo [data-qo-form] [hidden] { display: none !important; }
.nexpc-qo .ivqo-pickup { grid-column: 1 / -1; padding: .7rem .8rem; border: 1.5px solid #E2E8F0; border-radius: .8rem; transition: border-color .15s, background-color .15s; }
.nexpc-qo .ivqo-pickup.is-on { border-color: #1D57D8; background: #EEF4FF; }
.nexpc-qo .ivqo-pickup__check { display: flex; gap: .6rem; align-items: flex-start; margin: 0; cursor: pointer; line-height: 1.35; }
.nexpc-qo .ivqo-pickup__check input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; flex-shrink: 0; accent-color: #1D57D8; cursor: pointer; }
.nexpc-qo .ivqo-pickup__check b { display: block; font-size: .875rem; color: #0A1F44; }
.nexpc-qo .ivqo-pickup__check small { display: block; margin-top: .1rem; font-size: .75rem; color: #64748B; }
.nexpc-qo .ivqo-store { display: flex; flex-direction: column; gap: .15rem; margin: .65rem 0 0 1.7rem; padding-top: .6rem; border-top: 1px dashed #BFD3FB; font-size: .8125rem; color: #475569; }
.nexpc-qo .ivqo-store b { font-size: .875rem; color: #0A1F44; }
.nexpc-qo .ivqo-store a { margin-top: .2rem; font-weight: 600; color: #1D57D8; text-decoration: none; }
.nexpc-qo .ivqo-store a:hover { text-decoration: underline; }
.nexpc-qo--plugin .ivqo-pickup.is-on, .nexpc-qo--plugin .ivqo-pickup__check input { border-color: var(--ivqo-accent); accent-color: var(--ivqo-accent); }
