/* 4th Dimension Labs — Store Stylesheet */
:root {
  --bg:         #0a0a0f;
  --bg-card:    #111118;
  --bg-alt:     #16161f;
  --border:     rgba(0,180,255,0.12);
  --border-med: rgba(0,180,255,0.25);
  --cyan:       #00b4ff;
  --cyan-dim:   rgba(0,180,255,0.15);
  --cyan-glow:  rgba(0,180,255,0.35);
  --text:       #e0e0e0;
  --text-muted: #666;
  --text-dim:   #999;
  --green:      #00e676;
  --red:        #ff4444;
  --yellow:     #ffcc00;
  --radius:     10px;
  --radius-lg:  16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,180,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }

/* ── Nav ─────────────────────────────────────────────────────────── */
.site-nav {
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: .85rem 0;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.nav-logo img { height: 36px; filter: drop-shadow(0 0 8px var(--cyan-glow)); }
.nav-logo span { color: var(--text); font-weight: 700; font-size: 1rem; letter-spacing: .04em; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: .9rem; transition: color .2s; }
.nav-links a:hover { color: var(--cyan); }
.cart-link { display: flex; align-items: center; gap: .4rem; }
.cart-badge {
  background: var(--cyan); color: #000; font-size: .65rem; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; text-decoration: none;
  cursor: pointer; border: none; transition: all .2s; white-space: nowrap;
}
.btn-primary    { background: var(--cyan); color: #000; }
.btn-primary:hover { background: #33c4ff; box-shadow: 0 0 16px var(--cyan-glow); }
.btn-outline    { background: transparent; color: var(--cyan); border: 1px solid var(--border-med); }
.btn-outline:hover { background: var(--cyan-dim); }
.btn-danger     { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-sm         { padding: .35rem .85rem; font-size: .82rem; }
.btn-lg         { padding: .85rem 2rem; font-size: 1rem; }
.btn:disabled   { opacity: .5; cursor: not-allowed; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-body { padding: 1.5rem; }

/* ── Product Grid ────────────────────────────────────────────────── */
.shop-layout { display: flex; gap: 2rem; align-items: flex-start; padding: 2rem 0; }
.shop-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky; top: 80px;
}
.shop-sidebar h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: .85rem; }
.filter-group { margin-bottom: 1.5rem; }
.filter-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .88rem; color: var(--text-dim); cursor: pointer;
  padding: .3rem 0; transition: color .2s;
}
.filter-item:hover, .filter-item.active { color: var(--cyan); }
.filter-item input[type=checkbox] { accent-color: var(--cyan); width: 14px; height: 14px; }

/* ── Category list ───────────────────────────────────────────────── */
.cat-list {
  list-style: none;
  margin: 0; padding: 0;
}
.cat-list li { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { margin-top: 2px; }
.cat-list a {
  display: block; padding: .45rem .65rem;
  border-radius: 6px; font-size: .88rem;
  text-decoration: none; color: var(--text-dim);
  transition: all .15s;
}
.cat-list a:hover { color: var(--text); background: var(--bg-alt); }
.cat-list a.active { color: var(--cyan); font-weight: 600; background: var(--cyan-dim); }

/* ── Tag toggle pills ────────────────────────────────────────────── */
.tag-filter-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-toggle {
  display: inline-block;
  padding: .32rem .75rem;
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  text-decoration: none;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all .15s; cursor: pointer;
}
.tag-toggle:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.3);
  background: var(--bg-alt);
}
.tag-toggle.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(0,180,255,0.4);
}

/* ── Sort dropdown ───────────────────────────────────────────────── */
.sort-select {
  width: 100%;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: .45rem .65rem; font-size: .85rem;
  cursor: pointer; transition: border-color .15s;
}
.sort-select:focus { outline: none; border-color: var(--cyan); }

.product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.product-card:hover { border-color: var(--border-med); transform: translateY(-2px); }
.product-card a { text-decoration: none; color: inherit; }
.product-img {
  aspect-ratio: 1; overflow: hidden;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-img img { transform: scale(1.04); }
.product-img .no-img { color: var(--text-muted); font-size: 3rem; }
.product-info { padding: 1rem; }
.product-name { font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.product-price { color: var(--cyan); font-weight: 700; font-size: 1.05rem; }
.product-compare { color: var(--text-muted); text-decoration: line-through; font-size: .85rem; margin-left: .4rem; }
.product-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.tag-pill {
  background: var(--cyan-dim); color: var(--cyan);
  font-size: .7rem; padding: .2rem .5rem; border-radius: 999px;
  border: 1px solid rgba(0,180,255,0.2);
}

/* ── Product Detail ──────────────────────────────────────────────── */
.product-detail { padding: 2.5rem 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.product-gallery { display: flex; flex-direction: column; gap: .75rem; }
.gallery-main {
  aspect-ratio: 1; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.gallery-thumb {
  width: 72px; height: 72px; object-fit: cover;
  border: 2px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: border-color .2s; flex-shrink: 0;
}
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--cyan); }
.product-meta h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.product-meta .price-row { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; }
.product-meta .big-price { color: var(--cyan); font-size: 1.8rem; font-weight: 800; }
.product-specs { margin: 1.5rem 0; display: grid; gap: .5rem; }
.spec-row { display: flex; gap: .5rem; font-size: .88rem; }
.spec-label { color: var(--text-muted); min-width: 100px; }
.product-desc { color: var(--text-dim); line-height: 1.8; margin: 1.25rem 0; }
.qty-row { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.qty-input { width: 70px; text-align: center; }

/* ── Cart ────────────────────────────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th { text-align: left; padding: .75rem .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.cart-table td { padding: .85rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-total-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; max-width: 360px; margin-left: auto;
}
.total-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .95rem; }
.total-row.grand { font-size: 1.15rem; font-weight: 700; border-top: 1px solid var(--border); padding-top: .85rem; margin-top: .5rem; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-section { padding: 2rem 0; }
.form-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.5rem;
}
.form-card h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cyan); margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-dim); margin-bottom: .35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: .6rem .85rem; font-size: .92rem;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--cyan);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.required-star { color: var(--red); }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-success  { background: rgba(0,230,118,.15); color: #00e676; }
.badge-warning  { background: rgba(255,204,0,.15);  color: #ffcc00; }
.badge-danger   { background: rgba(255,68,68,.15);  color: #ff4444; }
.badge-info     { background: rgba(0,180,255,.12);  color: #00b4ff; }
.badge-cyan     { background: rgba(0,180,255,.12);  color: #00b4ff; }
.badge-secondary{ background: rgba(255,255,255,.08); color: #999; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { padding: .85rem 1.25rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: rgba(0,230,118,.1); border: 1px solid rgba(0,230,118,.3); color: #00e676; }
.alert-error   { background: rgba(255,68,68,.1);  border: 1px solid rgba(255,68,68,.3);  color: #ff4444; }
.alert-info    { background: var(--cyan-dim);     border: 1px solid var(--border-med);  color: var(--cyan); }

/* ── Admin ───────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .logo { padding: 0 1.25rem 1.5rem; display: flex; align-items: center; gap: .6rem; }
.admin-sidebar .logo img { height: 28px; }
.admin-sidebar .logo span { font-weight: 700; font-size: .85rem; color: var(--cyan); }
.admin-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1.25rem; color: var(--text-dim);
  text-decoration: none; font-size: .88rem;
  transition: background .15s, color .15s;
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--cyan-dim); color: var(--cyan);
}
.admin-nav .nav-section {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-muted); padding: 1rem 1.25rem .35rem;
}
.admin-main { flex: 1; padding: 2rem; overflow-x: auto; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 1.4rem; }

.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem;
}
.admin-card h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); margin-bottom: 1.1rem; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: .7rem .85rem;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: .8rem .85rem; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: .9rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(0,180,255,0.03); }

/* ── Order Timeline ──────────────────────────────────────────────── */
.timeline { position: relative; padding: 0; list-style: none; }
.timeline::before {
  content: ''; position: absolute;
  left: 18px; top: 0; bottom: 0; width: 2px;
  background: var(--border);
}
.timeline-item { display: flex; gap: 1rem; padding: 0 0 1.5rem 2.75rem; position: relative; }
.timeline-dot {
  position: absolute; left: 10px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
}
.timeline-item.latest .timeline-dot { border-color: var(--cyan); background: var(--cyan-dim); }
.timeline-content { flex: 1; }
.timeline-event { font-weight: 600; font-size: .9rem; }
.timeline-msg { color: var(--text-dim); font-size: .85rem; margin-top: .2rem; }
.timeline-time { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Stats Cards ─────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .4rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--cyan); }
.stat-sub { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Upload zone ─────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-med); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer; transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--cyan); }
.upload-zone p { color: var(--text-muted); font-size: .88rem; margin-top: .5rem; }

.img-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.img-thumb-wrap { position: relative; width: 80px; height: 80px; }
.img-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.img-thumb-wrap .del-img {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff; border: none;
  border-radius: 50%; width: 18px; height: 18px; font-size: .7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── Success / Tracking ──────────────────────────────────────────── */
.order-track-box {
  max-width: 640px; margin: 4rem auto; text-align: center;
}
.order-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.order-number-display {
  font-size: 1.5rem; font-weight: 800; color: var(--cyan);
  letter-spacing: .08em; margin-bottom: .5rem;
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-header { padding: 3rem 0 2rem; }
.page-header h1 { font-size: 2rem; margin-bottom: .5rem; }
.page-header p { color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0; margin-top: 4rem; text-align: center;
  color: var(--text-muted); font-size: .82rem;
}

/* ── Utilities ───────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-cyan    { color: var(--cyan); }
.text-center  { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

@media (max-width: 768px) {
  .shop-layout { flex-direction: column; }
  .shop-sidebar { width: 100%; position: static; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
}
