/**
 * NexMarket — Viral Modules CSS
 * All 4 modules in one file, scoped to prevent conflicts.
 *
 * Design language: Dark-glass premium marketplace.
 * Colours:   --nx-ink (#0d0d0d)  --nx-surface (#fff)
 *            --nx-accent (#ff4d00)  --nx-accent-2 (#6c47ff)
 *            --nx-border (#e8e8e8)  --nx-muted (#6b7280)
 */

/* ── CSS Custom Properties ──────────────────────────────────────────── */
:root {
	--nx-ink:        #0d0d0d;
	--nx-surface:    #ffffff;
	--nx-accent:     #ff4d00;
	--nx-accent-2:   #6c47ff;
	--nx-green:      #16a34a;
	--nx-border:     #e8e8e8;
	--nx-muted:      #6b7280;
	--nx-radius:     10px;
	--nx-radius-lg:  18px;
	--nx-shadow:     0 8px 32px rgba(0, 0, 0, 0.12);
	--nx-shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.2);
	--nx-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	--nx-font:       'Syne', 'DM Sans', system-ui, sans-serif;
}

/* ── Shared Utilities ───────────────────────────────────────────────── */
.nx-btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--nx-ink);
	color: #fff;
	border: none;
	border-radius: var(--nx-radius);
	padding: 12px 22px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .3px;
	cursor: pointer;
	transition: background var(--nx-transition), transform var(--nx-transition);
	text-decoration: none;
	width: 100%;
	text-align: center;
}
.nx-btn-primary:hover { background: #1a1a1a; transform: translateY(-1px); color: #fff; }

.nx-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: transparent;
	color: var(--nx-ink);
	border: 2px solid var(--nx-border);
	border-radius: var(--nx-radius);
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color var(--nx-transition), background var(--nx-transition);
	text-decoration: none;
	width: 100%;
	text-align: center;
}
.nx-btn-secondary:hover { border-color: var(--nx-ink); background: #f8f8f8; }

/* Spinner */
.nx-spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: nx-spin .7s linear infinite; }
.nx-spinner-sm { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: nx-spin .7s linear infinite; }
@keyframes nx-spin { to { transform: rotate(360deg); } }

/* Body lock */
body.nx-cart-active { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════════════
   MODULE 1 — AJAX SEARCH
   ══════════════════════════════════════════════════════════════════════ */

#nx-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: clamp(48px, 8vh, 120px);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--nx-transition);
}
#nx-search-overlay.nx-open {
	opacity: 1;
	pointer-events: all;
}
#nx-search-overlay[hidden] { display: flex !important; opacity: 0; pointer-events: none; }

#nx-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

#nx-search-panel {
	position: relative;
	z-index: 1;
	width: min(680px, calc(100vw - 32px));
	background: var(--nx-surface);
	border-radius: var(--nx-radius-lg);
	box-shadow: var(--nx-shadow-lg);
	overflow: hidden;
	transform: translateY(-16px) scale(.97);
	transition: transform var(--nx-transition);
}
.nx-open #nx-search-panel { transform: translateY(0) scale(1); }

#nx-search-input-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--nx-border);
}
.nx-search-icon { color: var(--nx-muted); flex-shrink: 0; }

#nx-search-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 18px;
	font-weight: 500;
	color: var(--nx-ink);
	font-family: var(--nx-font);
	background: transparent;
}
#nx-search-input::placeholder { color: #b0b0b0; }

#nx-search-clear {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--nx-muted);
	border-radius: 50%;
	display: flex;
	transition: background var(--nx-transition);
}
#nx-search-clear:hover { background: #f0f0f0; }
#nx-search-clear[hidden] { display: none; }

.nx-search-esc {
	font-size: 11px;
	color: var(--nx-muted);
	background: #f0f0f0;
	padding: 3px 7px;
	border-radius: 5px;
	border: 1px solid var(--nx-border);
	white-space: nowrap;
}

#nx-search-results { max-height: min(60vh, 520px); overflow-y: auto; }

.nx-sr-section { padding: 8px 0 12px; }

.nx-sr-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .8px;
	color: var(--nx-muted);
	padding: 8px 20px 6px;
}

.nx-sr-list { list-style: none; margin: 0; padding: 0; }

.nx-sr-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 20px;
	text-decoration: none;
	color: var(--nx-ink);
	transition: background var(--nx-transition);
	cursor: pointer;
}
.nx-sr-item:hover,
.nx-sr-item[aria-selected="true"] { background: #f7f7f7; }

.nx-sr-thumb { position: relative; flex-shrink: 0; }
.nx-sr-thumb img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f0f0f0; display: block; }
.nx-sale-badge {
	position: absolute;
	top: -4px; right: -4px;
	background: var(--nx-accent);
	color: #fff;
	font-size: 8px;
	font-weight: 900;
	padding: 2px 4px;
	border-radius: 4px;
	letter-spacing: .5px;
}

.nx-sr-item-body { flex: 1; min-width: 0; }
.nx-sr-title { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-sr-title mark { background: #fff3cd; padding: 0 1px; border-radius: 2px; }
.nx-sr-vendor { display: block; font-size: 12px; color: var(--nx-muted); margin-top: 2px; }
.nx-sr-cat { display: inline-block; font-size: 11px; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; margin-top: 3px; color: var(--nx-muted); }
.nx-sr-sub { display: block; font-size: 12px; color: var(--nx-muted); margin-top: 2px; }
.nx-sr-fire { font-size: 16px; }

.nx-sr-price { font-size: 14px; font-weight: 700; color: var(--nx-ink); white-space: nowrap; flex-shrink: 0; }
.nx-sr-price .woocommerce-Price-amount { font-weight: 700; }

.nx-sr-see-all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 8px 12px 4px;
	padding: 12px 16px;
	background: #f7f7f7;
	border-radius: var(--nx-radius);
	color: var(--nx-ink);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background var(--nx-transition);
}
.nx-sr-see-all:hover { background: #eee; }

.nx-sr-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px;
	color: var(--nx-muted);
	font-size: 14px;
}

.nx-sr-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 36px 20px;
	color: var(--nx-muted);
	text-align: center;
}
.nx-sr-empty p { margin: 12px 0 0; font-size: 14px; }
.nx-sr-hint { padding: 20px; text-align: center; color: var(--nx-muted); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════════════
   MODULE 2 — SLIDE-OUT CART
   ══════════════════════════════════════════════════════════════════════ */

#nx-slide-cart {
	position: fixed;
	inset: 0;
	z-index: 99998;
	pointer-events: none;
}
#nx-slide-cart.nx-cart-open { pointer-events: all; }
#nx-slide-cart[hidden] { display: block !important; pointer-events: none; }

#nx-cart-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity var(--nx-transition);
}
.nx-cart-open #nx-cart-backdrop { opacity: 1; }

#nx-cart-drawer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(420px, 100vw);
	background: var(--nx-surface);
	box-shadow: var(--nx-shadow-lg);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform var(--nx-transition);
	will-change: transform;
}
.nx-cart-open #nx-cart-drawer { transform: translateX(0); }

.nx-cart-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--nx-border);
	flex-shrink: 0;
}
.nx-cart-header h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	flex: 1;
}
.nx-cart-count-header { font-size: 12px; color: var(--nx-muted); }
.nx-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	background: var(--nx-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	border-radius: 10px;
	padding: 0 5px;
}
#nx-cart-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: var(--nx-muted);
	border-radius: 50%;
	display: flex;
	transition: background var(--nx-transition);
}
#nx-cart-close:hover { background: #f0f0f0; color: var(--nx-ink); }

[data-nx-cart-inner] { display: flex; flex-direction: column; overflow-y: auto; flex: 1; }

/* Shipping Progress */
.nx-shipping-progress {
	padding: 16px 20px;
	background: #f9f9f9;
	border-bottom: 1px solid var(--nx-border);
	flex-shrink: 0;
}
.nx-ship-msg {
	font-size: 13px;
	margin: 0 0 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.nx-ship-msg.nx-ship-achieved { color: var(--nx-green); font-weight: 600; }
.nx-progress-track {
	height: 6px;
	background: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
}
.nx-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #16a34a, #4ade80);
	border-radius: 4px;
	transition: width .6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cart Items */
.nx-cart-items { list-style: none; margin: 0; padding: 12px 0; flex: 1; }

.nx-cart-item {
	display: flex;
	gap: 14px;
	padding: 12px 20px;
	align-items: flex-start;
	transition: opacity var(--nx-transition), transform var(--nx-transition);
}
.nx-cart-item.nx-item-removing { opacity: .4; transform: translateX(8px); pointer-events: none; }
.nx-cart-item + .nx-cart-item { border-top: 1px solid #f2f2f2; }

.nx-ci-image { flex-shrink: 0; }
.nx-ci-image img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #f0f0f0; display: block; }

.nx-ci-body { flex: 1; min-width: 0; }
.nx-ci-name { font-size: 13px; font-weight: 600; color: var(--nx-ink); text-decoration: none; display: block; line-height: 1.3; }
.nx-ci-name:hover { color: var(--nx-accent); }
.nx-ci-variant { font-size: 12px; color: var(--nx-muted); margin: 3px 0 0; }
.nx-ci-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.nx-ci-price { font-size: 14px; font-weight: 700; }

/* Qty Control */
.nx-qty-control {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--nx-border);
	border-radius: 8px;
	overflow: hidden;
}
.nx-qty-btn {
	background: none;
	border: none;
	width: 28px;
	height: 28px;
	font-size: 16px;
	cursor: pointer;
	color: var(--nx-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--nx-transition);
}
.nx-qty-btn:hover { background: #f0f0f0; }
.nx-qty-input {
	width: 36px;
	text-align: center;
	border: none;
	outline: none;
	font-size: 13px;
	font-weight: 600;
	-moz-appearance: textfield;
}
.nx-qty-input::-webkit-outer-spin-button,
.nx-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.nx-ci-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--nx-muted);
	padding: 4px;
	border-radius: 6px;
	display: flex;
	align-items: flex-start;
	margin-left: 4px;
	transition: color var(--nx-transition), background var(--nx-transition);
}
.nx-ci-remove:hover { color: #dc2626; background: #fef2f2; }

/* Cross-sells */
.nx-crosssells {
	border-top: 1px solid var(--nx-border);
	padding: 16px 20px;
	background: #fafafa;
}
.nx-crosssells-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	margin: 0 0 12px;
	color: var(--nx-muted);
}
.nx-crosssells-row { display: flex; flex-direction: column; gap: 8px; }
.nx-cs-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--nx-surface);
	border: 1px solid var(--nx-border);
	border-radius: 10px;
	padding: 8px 12px;
}
.nx-cs-item img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: #f0f0f0; flex-shrink: 0; }
.nx-cs-info { flex: 1; min-width: 0; }
.nx-cs-info p { font-size: 12px; font-weight: 600; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-cs-info span { font-size: 12px; color: var(--nx-muted); }
.nx-cs-add {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	border: none;
	background: var(--nx-ink);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background var(--nx-transition);
}
.nx-cs-add:hover { background: #333; }
.nx-cs-add.nx-cs-added { background: var(--nx-green); }

/* Cart Footer */
.nx-cart-footer {
	padding: 16px 20px 20px;
	border-top: 1px solid var(--nx-border);
	background: var(--nx-surface);
	flex-shrink: 0;
	position: sticky;
	bottom: 0;
}
.nx-cart-totals { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.nx-tax-note { font-size: 12px; color: var(--nx-muted); margin: 0 0 14px; text-align: center; }
.nx-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--nx-ink);
	color: #fff !important;
	border-radius: var(--nx-radius);
	padding: 15px;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
	transition: background var(--nx-transition);
	letter-spacing: .2px;
}
.nx-checkout-btn:hover { background: #1a1a1a; }
.nx-view-cart-link { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--nx-muted); text-decoration: none; }
.nx-view-cart-link:hover { color: var(--nx-ink); text-decoration: underline; }

.nx-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 48px 24px;
	text-align: center;
	gap: 16px;
}
.nx-cart-empty-icon { color: #d0d0d0; }
.nx-cart-empty p { font-size: 16px; font-weight: 600; color: var(--nx-muted); margin: 0; }
.nx-cart-empty .nx-btn-primary { max-width: 220px; }

/* ══════════════════════════════════════════════════════════════════════
   MODULE 3 — VIDEO REVIEWS
   ══════════════════════════════════════════════════════════════════════ */

.nx-video-reviews { margin: 24px 0; }
.nx-vr-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 800;
	margin: 0 0 14px;
}
.nx-vr-count {
	background: var(--nx-accent-2);
	color: #fff;
	font-size: 11px;
	padding: 2px 7px;
	border-radius: 12px;
	font-weight: 700;
}

/* Scrollable story rail */
.nx-vr-scroll {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 8px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
}
.nx-vr-scroll::-webkit-scrollbar { display: none; }

.nx-vr-story {
	flex-shrink: 0;
	width: 130px;
	cursor: pointer;
	scroll-snap-align: start;
	outline: none;
	border-radius: var(--nx-radius);
	overflow: hidden;
}
.nx-vr-story:focus-visible { box-shadow: 0 0 0 3px var(--nx-accent-2); }

.nx-vr-thumb {
	position: relative;
	width: 130px;
	height: 175px;
	border-radius: var(--nx-radius);
	overflow: hidden;
	background: #111;
}
.nx-vr-preview {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
.nx-vr-story:hover .nx-vr-preview,
.nx-vr-story.nx-playing .nx-vr-preview { transform: scale(1.04); }

.nx-vr-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 50%);
	pointer-events: none;
}

.nx-vr-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	background: rgba(255,255,255,.15);
	backdrop-filter: blur(6px);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity var(--nx-transition);
}
.nx-vr-story.nx-playing .nx-vr-play-icon { opacity: 0; }

.nx-vr-ext-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1a1a2e, #16213e);
	display: flex;
	align-items: center;
	justify-content: center;
}

.nx-vr-user {
	position: absolute;
	bottom: 8px;
	left: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	gap: 5px;
}
.nx-vr-avatar { border-radius: 50%; border: 1.5px solid rgba(255,255,255,.6); flex-shrink: 0; }
.nx-vr-user span { font-size: 11px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nx-vr-caption { font-size: 11px; color: var(--nx-muted); margin: 5px 0 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lightbox */
.nx-vr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nx-vr-lightbox[hidden] { display: flex !important; opacity: 0; pointer-events: none; }
.nx-vr-lightbox { opacity: 0; pointer-events: none; transition: opacity var(--nx-transition); }
.nx-lb-open { opacity: 1; pointer-events: all; }

.nx-vr-lb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.88);
}
.nx-vr-lb-content {
	position: relative;
	z-index: 1;
	width: min(400px, 95vw);
}
.nx-vr-lb-close {
	position: absolute;
	top: -44px;
	right: 0;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
}
.nx-vr-lb-video {
	width: 100%;
	max-height: 80vh;
	border-radius: var(--nx-radius-lg);
	background: #000;
	display: block;
}
.nx-vr-lb-iframe {
	width: 100%;
	height: 70vh;
	border: none;
	border-radius: var(--nx-radius-lg);
}

/* Upload Form */
.nx-vr-upload-section { margin-top: 32px; border-top: 1px solid var(--nx-border); padding-top: 24px; }
.nx-vr-upload-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 800;
	margin: 0 0 16px;
}

.nx-vr-tabs {
	display: flex;
	gap: 4px;
	background: #f0f0f0;
	border-radius: 10px;
	padding: 4px;
	margin-bottom: 16px;
}
.nx-vr-tab {
	flex: 1;
	background: none;
	border: none;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 7px;
	cursor: pointer;
	color: var(--nx-muted);
	transition: background var(--nx-transition), color var(--nx-transition);
}
.nx-vr-tab-active { background: #fff; color: var(--nx-ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.nx-vr-dropzone {
	border: 2px dashed var(--nx-border);
	border-radius: var(--nx-radius);
	min-height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color var(--nx-transition), background var(--nx-transition);
	margin-bottom: 12px;
	position: relative;
	overflow: hidden;
}
.nx-vr-dropzone:hover,
.nx-vr-dropzone.nx-dz-drag { border-color: var(--nx-accent-2); background: #f5f3ff; }
.nx-vr-dropzone:focus-visible { box-shadow: 0 0 0 3px var(--nx-accent-2); outline: none; }

.nx-vr-dz-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--nx-muted); pointer-events: none; }
.nx-vr-dz-icon { color: var(--nx-accent-2); }
.nx-vr-dz-idle p { margin: 0; font-size: 14px; font-weight: 600; color: var(--nx-ink); }
.nx-vr-dz-idle span { font-size: 12px; }

.nx-vr-dz-preview { position: relative; width: 100%; }
.nx-vr-dz-preview video { width: 100%; max-height: 200px; border-radius: calc(var(--nx-radius) - 2px); display: block; }
.nx-vr-clear-file {
	position: absolute;
	top: 6px; right: 6px;
	background: rgba(0,0,0,.6);
	border: none;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #fff;
}

.nx-vr-progress-wrap {
	height: 6px;
	background: #e0e0e0;
	border-radius: 4px;
	margin-bottom: 12px;
	position: relative;
	overflow: hidden;
}
.nx-vr-prog-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--nx-accent-2), #a78bfa);
	border-radius: 4px;
	transition: width .2s;
}

.nx-vr-link-input {
	width: 100%;
	border: 1.5px solid var(--nx-border);
	border-radius: var(--nx-radius);
	padding: 12px 14px;
	font-size: 14px;
	outline: none;
	transition: border-color var(--nx-transition);
	box-sizing: border-box;
	margin-bottom: 6px;
}
.nx-vr-link-input:focus { border-color: var(--nx-accent-2); }
.nx-vr-link-hint { font-size: 12px; color: var(--nx-muted); margin: 0 0 12px; }

.nx-vr-caption-input {
	width: 100%;
	border: 1.5px solid var(--nx-border);
	border-radius: var(--nx-radius);
	padding: 10px 14px;
	font-size: 13px;
	resize: none;
	height: 72px;
	outline: none;
	transition: border-color var(--nx-transition);
	margin-bottom: 14px;
	box-sizing: border-box;
}
.nx-vr-caption-input:focus { border-color: var(--nx-accent-2); }

.nx-vr-message { padding: 10px 14px; border-radius: var(--nx-radius); font-size: 13px; font-weight: 600; margin-top: 10px; }
.nx-vr-msg-success { background: #f0fdf4; color: var(--nx-green); border: 1px solid #bbf7d0; }
.nx-vr-msg-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.nx-vr-submitted .nx-vr-submit-btn { opacity: .5; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════════════
   MODULE 4 — AI VENDOR TOOLS (Background Remover)
   ══════════════════════════════════════════════════════════════════════ */

/* Inject button on product images */
.nx-bg-inject-btn {
	position: absolute;
	bottom: 6px;
	left: 6px;
	background: rgba(0,0,0,.82);
	backdrop-filter: blur(4px);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 5px 8px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: background var(--nx-transition);
	z-index: 10;
	white-space: nowrap;
}
.nx-bg-inject-btn:hover { background: rgba(0,0,0,.95); }

/* Modal */
.nx-bg-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.nx-bg-modal[hidden] { display: flex !important; opacity: 0; pointer-events: none; }
.nx-bg-modal { opacity: 0; pointer-events: none; transition: opacity var(--nx-transition); }
.nx-bg-modal-open { opacity: 1; pointer-events: all; }

.nx-bg-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.7);
	backdrop-filter: blur(6px);
}

.nx-bg-modal-body {
	position: relative;
	z-index: 1;
	background: var(--nx-surface);
	border-radius: var(--nx-radius-lg);
	padding: 28px;
	width: min(520px, 100%);
	box-shadow: var(--nx-shadow-lg);
	transform: translateY(12px) scale(.97);
	transition: transform var(--nx-transition);
}
.nx-bg-modal-open .nx-bg-modal-body { transform: translateY(0) scale(1); }

.nx-bg-modal-close {
	position: absolute;
	top: 16px; right: 16px;
	background: #f0f0f0;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background var(--nx-transition);
}
.nx-bg-modal-close:hover { background: #e0e0e0; }

.nx-bg-modal-body h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 20px;
	font-weight: 900;
	margin: 0 0 4px;
}
.nx-bg-sparkle { font-size: 22px; }
.nx-bg-subtitle { font-size: 13px; color: var(--nx-muted); margin: 0 0 20px; }

/* Preview row */
.nx-bg-preview-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}
.nx-bg-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--nx-muted); margin-bottom: 8px; }
.nx-bg-img-wrap {
	aspect-ratio: 1;
	border-radius: var(--nx-radius);
	overflow: hidden;
	background: #f0f0f0;
	border: 1px solid var(--nx-border);
}
.nx-bg-img-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Checkerboard background to show transparency */
.nx-checkerboard { background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-color: #fff; }

.nx-bg-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 16px;
	text-align: center;
	color: var(--nx-muted);
	gap: 6px;
	font-size: 12px;
}
.nx-bg-arrow { font-size: 24px; color: var(--nx-muted); }

/* AI Loading animation */
.nx-bg-processing { text-align: center; padding: 16px 0; }
.nx-bg-processing-text { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.nx-bg-processing-sub { font-size: 12px; color: var(--nx-muted); }

.nx-ai-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: -8px;
	margin: 0 auto 12px;
	width: 56px;
	height: 56px;
	position: relative;
}
.nx-ai-ring {
	position: absolute;
	border-radius: 50%;
	border: 2.5px solid transparent;
	border-top-color: var(--nx-accent-2);
	animation: nx-spin .8s linear infinite;
}
.nx-ai-ring:nth-child(1) { width: 56px; height: 56px; }
.nx-ai-ring:nth-child(2) { width: 40px; height: 40px; border-top-color: var(--nx-accent); animation-duration: .6s; animation-direction: reverse; }
.nx-ai-ring:nth-child(3) { width: 24px; height: 24px; border-top-color: var(--nx-green); animation-duration: 1s; }

/* Error / Success */
.nx-bg-error-msg {
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
	border-radius: var(--nx-radius);
	padding: 10px 14px;
	font-size: 13px;
	margin-bottom: 14px;
}
.nx-bg-success-msg {
	background: #f0fdf4;
	color: var(--nx-green);
	border: 1px solid #bbf7d0;
	border-radius: var(--nx-radius);
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.nx-bg-actions { display: flex; gap: 10px; }
.nx-bg-action-btn { flex: 1; padding: 13px; }
.nx-bg-action-btn[disabled] { opacity: .5; pointer-events: none; }
.nx-bg-btn-text { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media ( max-width: 640px ) {
	#nx-search-overlay { padding-top: 0; align-items: flex-end; }
	#nx-search-panel { width: 100%; border-radius: var(--nx-radius-lg) var(--nx-radius-lg) 0 0; max-height: 85vh; }
	#nx-search-input { font-size: 16px; } /* prevent iOS zoom */

	#nx-cart-drawer { width: 100vw; }

	.nx-bg-preview-row { grid-template-columns: 1fr; text-align: center; }
	.nx-bg-arrow { display: none; }
}

@media ( max-width: 480px ) {
	.nx-cart-footer { padding: 12px 16px 24px; } /* safe area for notch */
	.nx-checkout-btn { font-size: 14px; }
}
