/* NestPlug cart — drawer, floating button, toasts, sticky ATC. Ported from FMS Cart, re-skinned. */

:root {
	--np-ink: #1B2230; --np-ink-soft: #5A6478; --np-line: #E6E9F0; --np-paper: #fff;
	--np-mist: #F4F6FA; --np-ember: #FF6B2C; --np-ember-2: #F2532B; --np-navy: #0E1117;
}

/* ── Floating button (FAB) ─────────────────────────────── */
#np-cart-btn, .np-cart-fab {
	position: fixed; right: 22px; bottom: 22px; z-index: 9990;
	display: inline-flex; align-items: center; justify-content: center;
	width: 58px; height: 58px; border: 3px solid #fff; border-radius: 999px;
	background: linear-gradient(135deg, var(--np-ember), var(--np-ember-2)); color: #fff;
	box-shadow: 0 10px 30px rgba(255, 107, 44, .38); cursor: pointer;
	transition: transform .18s ease, box-shadow .18s ease;
}
.np-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 14px 34px rgba(255,107,44,.44); }
.np-cart-fab:focus-visible { outline: 3px solid var(--np-ember); outline-offset: 3px; }
.np-cart-badge {
	position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 999px; background: var(--np-navy); color: #fff;
	font-size: 12.5px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px #fff;
}
.np-cart-badge[data-count="0"] { display: none; }

/* ── Drawer + scrim ────────────────────────────────────── */
#np-cart-drawer[hidden], #np-cart-scrim[hidden], .np-cart-coupons[hidden], .np-cart-empty[hidden] { display: none !important; }
#np-cart-scrim { position: fixed; inset: 0; z-index: 9997; background: rgba(14, 17, 23, .46); opacity: 0; transition: opacity .3s ease; }
#np-cart-scrim.np-open { opacity: 1; }
html.np-lock { overflow: hidden; }

#np-cart-drawer {
	position: fixed; top: 16px; right: 16px; bottom: 16px; z-index: 9998;
	width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column;
	background: var(--np-paper); border-radius: 20px; overflow: hidden;
	box-shadow: 0 24px 80px rgba(15, 22, 4, .35);
	transform: translateX(calc(100% + 24px)); transition: transform .34s cubic-bezier(.32, .72, 0, 1);
	font-size: 15px; color: var(--np-ink);
}
#np-cart-drawer.np-open { transform: translateX(0); }
#np-cart-drawer *, #np-cart-drawer *::before, #np-cart-drawer *::after { box-sizing: border-box; }

.np-cart-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px 15px; border-bottom: 1px solid var(--np-line); }
.np-cart-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; color: var(--np-ink); }
.np-cart-close { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: transparent; color: var(--np-ink); cursor: pointer; transition: background .15s ease; }
.np-cart-close:hover { background: var(--np-mist); }

.np-cart-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.np-cart-empty { padding: 46px 30px; text-align: center; color: var(--np-ink-soft); font-size: 15px; }
.np-cart-empty a { display: inline-block; margin-top: 12px; color: var(--np-ember); font-weight: 700; }

.np-cart-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--np-line); align-items: start; }
.np-cart-thumb { display: block; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--np-mist); }
.np-cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-cart-name { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.35; color: var(--np-ink); text-decoration: none; }
.np-cart-name:hover { text-decoration: underline; }
.np-cart-var { display: block; margin-top: 3px; font-size: 12.5px; color: var(--np-ink-soft); }
.np-cart-rowfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.np-cart-step { display: inline-flex; align-items: center; border: 1px solid var(--np-line); border-radius: 999px; background: #fff; }
.np-cart-step button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 17px; line-height: 1; color: var(--np-ink); cursor: pointer; border-radius: 999px; }
.np-cart-step button:hover { background: var(--np-mist); }
.np-cart-step input { width: 36px; border: 0; text-align: center; font: inherit; font-weight: 700; font-size: 14px; background: transparent; -moz-appearance: textfield; }
.np-cart-step input::-webkit-outer-spin-button, .np-cart-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.np-cart-line { font-size: 15px; color: var(--np-ink); white-space: nowrap; }
.np-cart-del { width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: #98a1b3; font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.np-cart-del:hover { background: #f9ece9; color: #b3402a; }

.np-cart-coupons { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px 0; }
.np-coupon { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #FFEDE4; color: #C2410C; font-size: 12.5px; font-weight: 700; }
.np-coupon button { border: 0; background: transparent; color: #C2410C; font-size: 15px; cursor: pointer; padding: 0; line-height: 1; }

.np-cart-coupon-form { display: flex; gap: 8px; padding: 12px 22px 2px; }
.np-cart-coupon-input { flex: 1; min-width: 0; border: 1px solid var(--np-line); border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 14px; background: #fff; }
.np-cart-coupon-form button { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--np-navy); color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; }

.np-cart-foot { border-top: 1px solid var(--np-line); padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); background: #FCFCFE; }
.np-cart-subtotal { display: flex; align-items: baseline; justify-content: space-between; font-size: 17px; color: var(--np-ink); }
.np-cart-subtotal strong { font-size: 19px; letter-spacing: -.01em; }
.np-cart-note { margin: 4px 0 13px; font-size: 12px; color: var(--np-ink-soft); }

.np-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: .98rem; padding: 13px 26px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.np-btn-ember { background: linear-gradient(135deg, var(--np-ember), var(--np-ember-2)); color: #fff !important; box-shadow: 0 8px 22px rgba(255, 107, 44, .35); }
.np-btn-ember:hover { filter: brightness(1.07); }
#np-cart-checkout { display: flex; width: 100%; }
.np-cart-continue { display: block; margin-top: 11px; text-align: center; font-size: 13px; color: var(--np-ink-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ── Toasts ────────────────────────────────────────────── */
.np-toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.np-toast { display: flex; align-items: center; gap: 14px; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; background: var(--np-navy); color: #F2F4F8; font-size: 14px; box-shadow: 0 12px 34px rgba(15, 22, 4, .35); opacity: 0; transform: translateY(10px); transition: opacity .22s ease, transform .22s ease; pointer-events: auto; }
.np-toast-in { opacity: 1; transform: translateY(0); }
.np-toast button { border: 0; background: transparent; color: var(--np-ember); font-weight: 800; font-size: 13.5px; cursor: pointer; padding: 0; white-space: nowrap; }

/* ── Sticky add-to-cart (product pages) ────────────────── */
#np-sticky-atc { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9989; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--np-line); box-shadow: 0 -8px 26px rgba(20,30,5,.12); transform: translateY(115%); transition: transform .3s cubic-bezier(.32,.72,0,1); }
#np-sticky-atc.np-show { transform: translateY(0); }
#np-sticky-atc img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--np-mist); }
.np-sticky-name { display: block; font-size: 13.5px; font-weight: 700; color: var(--np-ink); line-height: 1.25; }
.np-sticky-price { font-size: 13px; color: var(--np-ink-soft); }
#np-sticky-atc .np-btn { min-height: 46px; padding: 8px 22px; font-size: 14px; }

@media (max-width: 640px) {
	#np-cart-drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; transform: translateY(calc(100% + 24px)); }
	#np-cart-drawer.np-open { transform: translateY(0); }
	.np-cart-step button, .np-cart-del { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
	#np-cart-drawer, #np-cart-scrim, .np-toast, #np-sticky-atc { transition: none; }
}
