:root {
  --bg: #07080c;
  --bg-2: #0e1018;
  --surface: #141824;
  --surface-2: #1b2030;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f5fb;
  --muted: #9aa3b8;
  --cyan: #3ee0c6;
  --cyan-dim: rgba(62, 224, 198, 0.14);
  --amber: #f5b942;
  --rose: #ff6b7a;
  --good: #5ee9a0;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 1180px;
  --font: "Sora", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(62, 224, 198, 0.12), transparent 60%),
    radial-gradient(700px 360px at 90% 0%, rgba(245, 185, 66, 0.08), transparent 55%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(7, 8, 12, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.08em; font-size: 15px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #1a9b8a);
  color: #04110e;
  display: grid; place-items: center;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(62, 224, 198, 0.35);
}
.search {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
}
.search input {
  flex: 1; background: transparent; border: 0; outline: none;
  padding: 8px 10px; min-width: 0;
}
.search button, .icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cyan); color: #04110e; font-weight: 700;
  display: grid; place-items: center;
}
.icon-btn {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  position: relative;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--amber); color: #1a1200;
  min-width: 18px; height: 18px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center; padding: 0 4px;
}
.user-chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--muted);
}

.nav-cats {
  display: flex; gap: 6px; overflow: auto; padding: 0 0 12px;
  scrollbar-width: none;
}
.nav-cats::-webkit-scrollbar { display: none; }
.nav-cats a, .chip {
  white-space: nowrap;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 12px; color: var(--muted);
}
.nav-cats a:hover, .chip.active, .nav-cats a.active {
  color: var(--cyan); border-color: rgba(62, 224, 198, 0.4); background: var(--cyan-dim);
}

.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px;
  padding: 48px 0 20px; align-items: center;
}
.kicker {
  color: var(--cyan); letter-spacing: 0.18em; text-transform: uppercase;
  font-size: 12px; font-weight: 600; margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400; line-height: 0.95; letter-spacing: -0.03em;
}
.hero p { color: var(--muted); margin: 18px 0 26px; max-width: 46ch; font-size: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
}
.btn-primary { background: var(--cyan); color: #04110e; }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.btn-amber { background: var(--amber); color: #1a1200; }
.btn-danger { background: var(--rose); color: #2a0508; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hero-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
}
.hero-card img { height: 280px; width: 100%; object-fit: cover; }
.hero-card .meta { padding: 18px 20px 22px; }
.hero-card h3 { font-size: 20px; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 500; margin-left: 8px; font-size: 0.85em; }
.deal { color: var(--amber); font-size: 12px; font-weight: 600; }

.section { padding: 42px 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  font-family: var(--display); font-size: 34px; font-weight: 400;
}
.section-head p { color: var(--muted); font-size: 14px; }

.cat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.cat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; min-height: 110px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}
.cat-card:hover { transform: translateY(-3px); border-color: rgba(62, 224, 198, 0.4); }
.cat-card span { font-size: 22px; }
.cat-card strong { font-size: 13px; }
.cat-card small { color: var(--muted); font-size: 11px; }

.product-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb {
  height: 190px; background: #0a0c12; position: relative; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--amber); color: #1a1200;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px;
}
.stock-out { background: var(--rose); color: #fff; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.brand { color: var(--cyan); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.card h3 { font-size: 15px; line-height: 1.3; }
.stars { color: var(--amber); font-size: 12px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.add-mini {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--cyan-dim); color: var(--cyan); font-size: 18px;
}

.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 28px 0 60px; }
.filters {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; height: fit-content; position: sticky; top: 96px;
}
.filters h3 { font-size: 13px; margin: 14px 0 8px; }
.filters label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 6px 0; cursor: pointer; }
.filters input[type="number"] {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; margin-top: 6px;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
select, .field {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; outline: none; width: 100%;
}
textarea.field { min-height: 100px; resize: vertical; }

.product-page { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 36px; padding: 36px 0; }
.gallery { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.gallery img { width: 100%; height: 420px; object-fit: cover; }
.thumbs { display: flex; gap: 8px; padding: 12px; }
.thumbs img { width: 72px; height: 56px; object-fit: cover; border-radius: 10px; opacity: 0.7; cursor: pointer; border: 1px solid var(--line); }
.thumbs img.active, .thumbs img:hover { opacity: 1; border-color: var(--cyan); }
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.qty button { width: 40px; height: 40px; background: var(--surface-2); }
.qty input { width: 52px; text-align: center; background: transparent; border: 0; outline: none; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.spec {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.spec small { color: var(--muted); display: block; font-size: 11px; }

.cart-layout { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 24px; padding: 28px 0 70px; }
.cart-item {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; align-items: center;
}
.cart-item img { width: 96px; height: 76px; object-fit: cover; border-radius: 10px; }
.summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; height: fit-content; position: sticky; top: 96px;
}
.line { display: flex; justify-content: space-between; margin: 8px 0; color: var(--muted); font-size: 14px; }
.line.total { color: var(--text); font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

.auth-box {
  width: min(440px, 100%); margin: 48px auto 80px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px;
}
.auth-box h1 { font-family: var(--display); font-size: 36px; font-weight: 400; margin-bottom: 8px; }
.form-grid { display: grid; gap: 12px; margin-top: 18px; }
.form-grid label { font-size: 12px; color: var(--muted); display: grid; gap: 6px; }
.notice {
  padding: 10px 12px; border-radius: 12px; background: var(--cyan-dim); color: var(--cyan); font-size: 13px; margin-top: 12px;
}
.notice.error { background: rgba(255, 107, 122, 0.12); color: var(--rose); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.status { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status.paid, .status.delivered { background: rgba(94, 233, 160, 0.15); color: var(--good); }
.status.shipped { background: var(--cyan-dim); color: var(--cyan); }
.status.pending { background: rgba(245, 185, 66, 0.15); color: var(--amber); }
.status.cancelled { background: rgba(255, 107, 122, 0.15); color: var(--rose); }

.order-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin: 12px 0;
}
.order-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.order-item img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}
.order-item span { min-width: 0; }
.order-item strong, .order-item small { display: block; }
.order-item strong { overflow-wrap: anywhere; font-size: 12px; }
.order-item small { color: var(--muted); font-size: 11px; margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 28px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 26px; margin-top: 6px; }

.site-footer {
  border-top: 1px solid var(--line); padding: 36px 0 24px; margin-top: 20px; color: var(--muted); font-size: 13px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.site-footer h4 { color: var(--text); margin-bottom: 10px; font-size: 13px; }
.site-footer a { display: block; margin: 6px 0; color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  background: var(--surface-2); border: 1px solid var(--cyan);
  padding: 12px 16px; border-radius: 12px; display: none;
}

@media (max-width: 980px) {
  .header-inner { grid-template-columns: auto auto; }
  .search { grid-column: 1 / -1; }
  .hero, .shop-layout, .product-page, .cart-layout, .footer-grid, .cat-grid, .product-grid, .stats {
    grid-template-columns: 1fr 1fr;
  }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .hero, .shop-layout, .product-page, .cart-layout, .footer-grid, .product-grid, .stats, .specs, .cat-grid {
    grid-template-columns: 1fr;
  }
  .filters { position: static; }
  .cart-item { grid-template-columns: 72px 1fr; }
}
