.npfe, .npfe * { box-sizing: border-box; }
.npfe {
	--a: var(--npfe-accent, #5b3df5);
	--a-soft: color-mix(in srgb, var(--a) 10%, #fff);
	--a-dark: color-mix(in srgb, var(--a) 80%, #000);
	--ink: #14142b; --muted: #6b7088; --line: #e5e7f0; --bg: #fff;
	--ok: #0f9d58; --err: #d93025; --warn: #b26a00;
	max-width: 780px; margin: 0 auto; padding: 24px; color: var(--ink); background: var(--bg);
	border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px rgba(20, 20, 43, .08);
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.45;
}
.npfe .npfe-ico { width: 20px; height: 20px; flex: none; }
.npfe-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.npfe-head-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--a); color: #fff; flex: none; }
.npfe-head-icon .npfe-ico { width: 26px; height: 26px; }
.npfe-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--ink); }
.npfe-head p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }

/* Tabla */
.npfe-table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.npfe-table { width: 100%; border-collapse: collapse; margin: 0; }
.npfe-table th, .npfe-table td { padding: 14px 16px; text-align: left; vertical-align: middle; border: 0; }
.npfe-table thead th { background: #f7f8fc; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.npfe-table tbody tr { border-top: 1px solid var(--line); transition: background .2s; }
.npfe-table tbody tr:hover { background: #fafbff; }
.npfe-table td:last-child, .npfe-table th:last-child { text-align: right; }
.npfe-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--a-soft); color: var(--a-dark); font-size: .78rem; font-weight: 700; }
.npfe-badge .npfe-ico { width: 14px; height: 14px; }
.npfe-price { display: block; margin-top: 6px; font-size: 1.3rem; font-weight: 800; }
.npfe-left { display: block; color: var(--muted); font-size: .8rem; }
.npfe-rowtotal { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.npfe-table tfoot th, .npfe-table tfoot td { background: var(--a-soft); font-weight: 800; font-size: 1.1rem; border-top: 2px solid var(--a); }
.npfe-table tfoot td { color: var(--a-dark); font-size: 1.35rem; }
.npfe-row.is-soldout { opacity: .55; background: #f4f4f8; }
.npfe-row.is-soldout .npfe-left { color: var(--err); font-weight: 700; }

/* Spinner de cantidad */
.npfe-spin { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.npfe-spin button { width: 40px; height: 44px; border: 0; background: #f7f8fc; color: var(--ink); font-size: 1.3rem; cursor: pointer; padding: 0; line-height: 1; }
.npfe-spin button:hover:not(:disabled) { background: var(--a-soft); color: var(--a-dark); }
.npfe-spin button:disabled { cursor: not-allowed; color: #b4b7c8; }
.npfe-spin input { width: 56px; height: 44px; border: 0; text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--ink); background: #fff; -moz-appearance: textfield; appearance: textfield; padding: 0; margin: 0; box-shadow: none; }
.npfe-spin input::-webkit-outer-spin-button, .npfe-spin input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.npfe-spin:focus-within { border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 20%, transparent); }
.npfe-spin input:disabled { background: #f4f4f8; }

/* Pagos */
.npfe-paytitle { margin: 22px 0 10px; font-weight: 700; }
.npfe-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.npfe-pay-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; transition: all .2s; font-family: inherit; }
.npfe-pay-btn .npfe-ico { width: 30px; height: 30px; color: var(--a); }
.npfe-pay-btn strong { display: block; font-size: .98rem; }
.npfe-pay-btn small { color: var(--muted); font-size: .8rem; }
.npfe-pay-btn:hover:not(:disabled) { border-color: var(--a); background: var(--a-soft); transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--a) 18%, transparent); }
.npfe-pay-btn:disabled { opacity: .5; cursor: not-allowed; }
.npfe-secure { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: .82rem; }
.npfe-secure .npfe-ico { width: 16px; height: 16px; color: var(--ok); }
.npfe-toast { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff7e6; color: var(--warn); font-size: .9rem; border: 1px solid #ffe2a8; }

/* Modal */
.npfe-lock { overflow: hidden; }
.npfe-modal[hidden] { display: none; }
.npfe-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; font-family: 'Inter', system-ui, sans-serif; }
.npfe-backdrop { position: absolute; inset: 0; background: rgba(15, 15, 35, .6); backdrop-filter: blur(3px); }
.npfe-dialog { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; color: var(--ink); border-radius: 20px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: npfe-pop .22s ease; outline: 0; }
@keyframes npfe-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.npfe-modal { --a: var(--npfe-accent, #5b3df5); }
.npfe-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f3f4f9; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; }
.npfe-x:hover { background: #e7e9f3; }
.npfe-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 40px; }
.npfe-dialog-head h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.npfe-dialog-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--a); color: #fff; flex: none; }
.npfe-totalbox { background: color-mix(in srgb, var(--a) 10%, #fff); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; display: grid; }
.npfe-totalbox span { font-size: .8rem; color: #6b7088; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.npfe-totalbox strong { font-size: 1.8rem; font-weight: 800; color: color-mix(in srgb, var(--a) 80%, #000); }
.npfe-totalbox small { color: #6b7088; }
.npfe-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: #f4f6fb; font-size: .88rem; color: #3b3f58; }
.npfe-note .npfe-ico { width: 18px; height: 18px; margin-top: 1px; color: var(--a); }

/* Campos */
.npfe-field { margin-bottom: 14px; }
.npfe-field label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: #3b3f58; }
.npfe-input { position: relative; display: flex; align-items: center; }
.npfe-input > .npfe-ico { position: absolute; left: 13px; color: #8a8fa8; pointer-events: none; }
.npfe-input input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1.5px solid #dfe2ee; border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; box-shadow: none; margin: 0; }
.npfe-input input[name="full_name"] { text-transform: uppercase; }
.npfe-input input:focus { outline: 0; border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 20%, transparent); }
.npfe-field.is-valid .npfe-input input { border-color: #7fd1a6; }
.npfe-field.has-error .npfe-input input { border-color: var(--err); background: #fff8f7; }
.npfe-err { margin: 5px 0 0; min-height: 0; font-size: .8rem; color: var(--err); }
.npfe-err:empty { display: none; }
.npfe-brand { position: absolute; right: 12px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--a); background: color-mix(in srgb, var(--a) 12%, #fff); padding: 3px 7px; border-radius: 6px; }
.npfe-brand:empty { display: none; }
.npfe-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.npfe-alert { margin-bottom: 14px; padding: 11px 13px; border-radius: 12px; background: #fdecea; color: #8c1d14; font-size: .88rem; border: 1px solid #f6c5c0; }
.npfe-alert[hidden], .npfe-result[hidden], .npfe-toast[hidden], .npfe-form[hidden] { display: none; }

.npfe-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.npfe-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1.5px solid transparent; font: inherit; font-weight: 700; cursor: pointer; transition: all .2s; }
.npfe-btn-primary { background: var(--a); color: #fff; flex: 1; }
.npfe-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--a) 85%, #000); }
.npfe-btn-ghost { background: #fff; color: var(--ink); border-color: #dfe2ee; }
.npfe-btn-ghost:hover:not(:disabled) { background: #f4f5fa; }
.npfe-btn:disabled { opacity: .65; cursor: not-allowed; }
.npfe-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: npfe-spin .7s linear infinite; }
.is-loading .npfe-spinner { display: inline-block; }
@keyframes npfe-spin { to { transform: rotate(360deg); } }

/* Resultado */
.npfe-result { text-align: center; padding: 8px 0 0; }
.npfe-result .npfe-ico { width: 60px; height: 60px; }
.npfe-result h4 { margin: 10px 0 6px; font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.npfe-result p { margin: 0; color: #3b3f58; }
.npfe-result.is-success .npfe-ico { color: var(--ok); }
.npfe-result.is-error .npfe-ico { color: var(--err); }
.npfe-result.is-pending .npfe-ico { color: var(--warn); }

/* Móvil */
@media (max-width: 640px) {
	.npfe { padding: 16px; border-radius: 16px; }
	.npfe-table thead { position: absolute; left: -9999px; }
	.npfe-table, .npfe-table tbody, .npfe-table tfoot, .npfe-table tr { display: block; }
	.npfe-table tbody tr { padding: 10px 4px; }
	.npfe-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px; text-align: right; }
	.npfe-table td::before { content: attr(data-label); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; text-align: left; }
	.npfe-table td:first-child { display: block; text-align: left; }
	.npfe-table td:first-child::before { display: none; }
	.npfe-table tfoot tr { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; }
	.npfe-table tfoot th, .npfe-table tfoot td { display: block; border: 0; padding: 8px 0; background: none; }
	.npfe-table tfoot tr { background: var(--a-soft); border-top: 2px solid var(--a); }
	.npfe-pay, .npfe-row2 { grid-template-columns: 1fr; }
	.npfe-dialog { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .npfe *, .npfe-dialog { animation: none !important; transition: none !important; } }
