/* ============================================================
   Nova theme - animated aurora background, glass cards, motion
   ============================================================ */
:root {
  --bg: #0b0f1a; --bg-2: #111827; --fg: #eef2ff; --muted: #9aa3b8; --line: rgba(255,255,255,.09);
  --glass: rgba(255,255,255,.05); --glass-2: rgba(255,255,255,.09);
  --a1: #7c5cff; --a2: #22d3ee; --a3: #fb7185; --a4: #fbbf24;
  --grad: linear-gradient(120deg, var(--a1), var(--a2), var(--a3), var(--a4), var(--a1));
  --bad: #fb7185; --good: #34d399; --warn: rgba(251,191,36,.18);
  --radius: 18px; --ease: cubic-bezier(.22,.8,.3,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--fg); background: var(--bg); overflow-x: hidden; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--a1); color: #fff; }

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 80% -10%, #1a1f3d 0%, var(--bg) 60%); }
.bg span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .42; mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}
.bg span:nth-child(1) { width: 520px; height: 520px; left: -140px; top: -120px; background: var(--a1); }
.bg span:nth-child(2) { width: 460px; height: 460px; right: -120px; top: 10%; background: var(--a2); animation-duration: 32s; animation-delay: -8s; }
.bg span:nth-child(3) { width: 420px; height: 420px; left: 30%; bottom: -200px; background: var(--a3); animation-duration: 38s; animation-delay: -16s; }
.bg span:nth-child(4) { width: 300px; height: 300px; right: 25%; bottom: 10%; background: var(--a4); opacity: .3; animation-duration: 30s; animation-delay: -4s; }
.bg::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 70%); }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.15); }
  100% { transform: translate(-40px, 60px) scale(.95); }
}

/* ---------- nav ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 28px;
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px) saturate(140%);
  background: rgba(11,15,26,.55); border-bottom: 1px solid var(--line);
  animation: slide-down .7s var(--ease) both;
}
@keyframes slide-down { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.4px; background: var(--grad); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.nav nav a { margin-left: 22px; color: var(--muted); position: relative; padding: 4px 0; transition: color .25s; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--grad); background-size: 300% 100%; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); border-radius: 2px; }
.nav nav a:hover { color: var(--fg); }
.nav nav a:hover::after { transform: scaleX(1); }
.cart-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 20px; background: var(--a3); color: #fff; font-size: 12px; text-align: center; line-height: 20px; animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.container { max-width: 1140px; margin: 0 auto; padding: 28px 20px 80px; }
.footer { display: flex; gap: 28px; justify-content: center; padding: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- hero ---------- */
.hero { padding: 70px 0 40px; position: relative; }
.hero h1 {
  font-size: clamp(38px, 6vw, 68px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -1.5px; font-weight: 800;
  background: var(--grad); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 10s linear infinite, rise .9s var(--ease) both;
}
.hero p { color: var(--muted); margin: 0; font-size: 18px; animation: rise .9s .15s var(--ease) both; }
.hero .cta { margin-top: 26px; animation: rise .9s .3s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero .orbit { position: absolute; right: 0; top: 30px; width: 260px; height: 260px; pointer-events: none; }
.hero .orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255,255,255,.15); animation: spin 22s linear infinite; }
.hero .orbit i:nth-child(2) { inset: 40px; animation-duration: 15s; animation-direction: reverse; }
.hero .orbit i:nth-child(3) { inset: 80px; animation-duration: 9s; }
.hero .orbit i::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 18px var(--a2); }
.hero .orbit i:nth-child(2)::before { background: var(--a3); box-shadow: 0 0 18px var(--a3); }
.hero .orbit i:nth-child(3)::before { background: var(--a4); box-shadow: 0 0 18px var(--a4); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .hero .orbit { display: none; } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); margin: 10px 0 34px; padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee div { display: flex; gap: 48px; width: max-content; animation: marquee 28s linear infinite; }
.marquee span { color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.marquee span::before { content: "\2726"; color: var(--a2); margin-right: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card {
  position: relative; display: block; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s;
}
.card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); background-size: 300% 100%; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .45s; animation: shimmer 6s linear infinite; pointer-events: none; }
.card:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 24px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
.card:hover::before { opacity: 1; }
.card-img { aspect-ratio: 1; background: var(--bg-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.card:hover .card-img img { transform: scale(1.08); }
.card-body { padding: 14px 16px 18px; }
.card-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--a2); }
.card h3 { font-size: 15px; margin: 5px 0 10px; font-weight: 600; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; }
.price.big { font-size: 28px; margin: 12px 0; }
.badge { background: rgba(52,211,153,.16); color: var(--good); font-size: 12px; padding: 4px 10px; border-radius: 20px; margin-left: 8px; vertical-align: middle; }

/* scroll reveal */
[data-reveal] { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; } }
.gallery { position: sticky; top: 90px; }
.gallery img#main-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); animation: rise .8s var(--ease) both; transition: transform .6s var(--ease); }
.gallery:hover img#main-img { transform: scale(1.02); }
.thumbs { display: flex; gap: 10px; margin-top: 10px; }
.thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; opacity: .7; transition: opacity .3s, transform .3s var(--ease); }
.thumbs img:hover { opacity: 1; transform: translateY(-3px); }
.details > * { animation: rise .8s var(--ease) both; }
.details > *:nth-child(2) { animation-delay: .08s } .details > *:nth-child(3) { animation-delay: .16s }
.details > *:nth-child(4) { animation-delay: .24s } .details > *:nth-child(5) { animation-delay: .32s } .details > *:nth-child(6) { animation-delay: .4s } .details > *:nth-child(7) { animation-delay: .48s }
.details h1 { font-size: 34px; margin: 4px 0; letter-spacing: -.8px; line-height: 1.1; }
.buy { display: flex; gap: 12px; align-items: end; margin: 20px 0 12px; }
.buy input { width: 70px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--glass); color: var(--fg); font: inherit; }
.buy label { color: var(--muted); font-size: 13px; }
.desc { margin-top: 22px; color: #c7cde0; }
.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-block; padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--glass-2); color: var(--fg); cursor: pointer; font: inherit; font-weight: 600;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--grad); background-size: 300% 100%; border: none; color: #fff; animation: shimmer 6s linear infinite; box-shadow: 0 8px 24px rgba(124,92,255,.35); }
.btn.primary:hover { box-shadow: 0 14px 34px rgba(124,92,255,.5); }
.btn.primary[disabled] { opacity: .5; cursor: not-allowed; animation: none; }
.btn.link { border: none; background: none; color: var(--a2); padding: 4px 6px; font-weight: 500; }
.btn.link:hover { background: none; text-decoration: underline; transform: none; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- tables & forms ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 16px 0; animation: rise .6s var(--ease) both; }
.table th, .table td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: rgba(255,255,255,.03); }
.table tr { transition: background .25s; }
.table tbody tr:hover, .table tr:hover { background: rgba(255,255,255,.04); }
.table.small td, .table.small th { font-size: 13px; padding: 9px 11px; }
.table tr.total td { font-weight: 700; border-bottom: none; font-size: 16px; }
.table tr.dim { opacity: .45; }
.table tr.error td { background: rgba(251,113,133,.08); }
.table tr.warning td { background: rgba(251,191,36,.08); }
.mini { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 8px; }
.flash { background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.3); color: #cffafe; padding: 11px 15px; border-radius: 12px; margin-bottom: 18px; animation: rise .5s var(--ease) both; }
.notice { background: var(--warn); border: 1px solid rgba(251,191,36,.35); padding: 11px 15px; border-radius: 12px; }
.notice.bad { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.35); color: #fecdd3; }
.form label { display: block; margin: 12px 0; font-size: 13px; color: var(--muted); }
.form input, .inline input { display: block; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-top: 5px; background: var(--glass); color: var(--fg); transition: border-color .25s, box-shadow .25s; }
.form input:focus, .inline input:focus, .buy input:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .btn { margin-top: 18px; }
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
@media (max-width: 760px) { .checkout { grid-template-columns: 1fr; } }
.summary { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; height: fit-content; position: sticky; top: 90px; animation: rise .7s .1s var(--ease) both; }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary .line.total { font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 17px; }
.narrow { max-width: 660px; }
h1, h2 { letter-spacing: -.5px; }

/* order status steps */
.status-row { display: flex; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.step { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; background: var(--glass); transition: all .4s var(--ease); }
.step.on { background: var(--grad); background-size: 300% 100%; color: #fff; border-color: transparent; animation: shimmer 6s linear infinite, pop .6s var(--ease); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; transition: transform .3s var(--ease), border-color .3s; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad); background-size: 300% 100%; animation: shimmer 6s linear infinite; opacity: .7; }
.stat:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.2); }
.stat span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat b { font-size: 24px; display: block; margin-top: 4px; }
.stat.warn { background: rgba(251,113,133,.1); }
.bad { color: var(--bad); } .good { color: var(--good); }
.jobs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 26px; }
.job { display: flex; flex-direction: column; gap: 3px; }
.inline { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.inline input { width: auto; margin: 0; }
.pill { padding: 3px 10px; border-radius: 20px; font-size: 12px; background: rgba(255,255,255,.1); }
.pill.paid, .pill.active { background: rgba(34,211,238,.18); color: #a5f3fc; }
.pill.fulfilling { background: rgba(251,191,36,.18); color: #fde68a; }
.pill.shipped { background: rgba(124,92,255,.22); color: #ddd6fe; }
.pill.delivered { background: rgba(52,211,153,.18); color: #a7f3d0; }
.pill.failed { background: rgba(251,113,133,.18); color: #fecdd3; }
.pill.paused { background: rgba(255,255,255,.08); color: var(--muted); }
.pill.active { position: relative; padding-left: 18px; }
.pill.active::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 0 0 rgba(34,211,238,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34,211,238,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); } }
body.admin .hero, body.admin .marquee { display: none; }
body.admin .bg span { opacity: .3; }

/* settings page */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.settings section { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; animation: rise .6s var(--ease) both; }
.settings h2 { font-size: 15px; margin: 4px 0 6px; color: var(--a2); text-transform: uppercase; letter-spacing: .1em; }
.settings h2 + h2, .settings label + h2 { margin-top: 20px; }
.settings h2 em { font-style: normal; text-transform: none; letter-spacing: 0; font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 8px; background: rgba(255,255,255,.08); color: var(--muted); }
.settings h2 em.on { background: rgba(52,211,153,.18); color: #a7f3d0; }
.settings .section-title { font-size: 20px; color: var(--fg); text-transform: none; letter-spacing: -.4px; margin: 34px 0 12px; }
.settings select { display: block; width: 100%; padding: 10px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--fg); font: inherit; }
.form label.check { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.form label.check input { width: auto; margin: 0; accent-color: var(--a1); }
code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 6px; font-size: 12px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
