/* ===== VortexAlts — shared theme (clean dark store) ===== */

:root{
  --bg:          #0b0b0f;
  --surface:     #131317;
  --surface-2:   #1a1a20;
  --border:      #26262e;
  --border-soft: #1c1c22;

  --purple:      #8b5cf6;
  --purple-dark: #6d3ff2;
  --purple-soft: rgba(139,92,246,0.12);

  --text:        #f1f1f4;
  --text-dim:    #9a9aa6;
  --text-faint:  #66666f;

  --ok:          #34d399;
  --warn:        #fbbf24;
  --danger:      #f87171;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }
::selection{ background: rgba(139,92,246,0.35); color: #fff; }

:focus-visible{
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== nav ===== */
.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,11,15,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-mark{
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--purple);
  flex-shrink: 0;
}
.brand-name span{ color: var(--purple); }

.nav-links{
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  color: var(--text-dim);
}
.nav-links a:hover{ color: var(--text); }

.nav-cta{
  padding: 8px 16px;
  border-radius: 7px;
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  transition: background .15s ease;
}
.nav-cta:hover{ background: var(--purple-dark); }

/* ===== hero ===== */
.hero{
  padding: 68px 0 56px;
  border-bottom: 1px solid var(--border-soft);
}
.hero .wrap{ max-width: 720px; }
.hero h1{
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 700;
}
.hero h1 .accent{ color: var(--purple); }
.hero p{
  color: var(--text-dim);
  font-size: 16px;
  max-width: 54ch;
  margin: 0 0 28px;
}
.hero-actions{ display: flex; gap: 12px; flex-wrap: wrap; }

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary{
  background: var(--purple);
  color: #fff;
}
.btn-primary:hover{ background: var(--purple-dark); }
.btn-ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover{ border-color: var(--text-faint); background: var(--surface); }

.hero-meta{
  display: flex;
  gap: 22px;
  margin-top: 34px;
  font-size: 13px;
  color: var(--text-faint);
}
.hero-meta b{ color: var(--text); font-weight: 600; }

/* ===== section headers ===== */
.section{ padding: 52px 0; }
.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head h2{
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head p{ color: var(--text-faint); margin: 0; font-size: 14px; }

.filters{ display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip{
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover{ border-color: var(--text-faint); color: var(--text); }
.filter-chip.active{
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--purple);
}

/* ===== product grid ===== */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}
.card{
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s ease;
}
.card:hover{ border-color: var(--border); }
.card-top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.card-tag{
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--purple);
  background: var(--purple-soft);
  padding: 3px 8px;
  border-radius: 5px;
}
.stock{
  font-size: 12px;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 5px;
}
.stock::before{ content:""; width:6px; height:6px; border-radius:50%; background: var(--ok); }
.stock.low{ color: var(--warn); }
.stock.low::before{ background: var(--warn); }
.stock.out{ color: var(--danger); }
.stock.out::before{ background: var(--danger); }

.card h3{
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.card p.desc{
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0 0 16px;
  min-height: 36px;
}
.card-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}
.price{
  font-size: 18px;
  font-weight: 700;
}
.price span{ font-size: 12px; color: var(--text-faint); font-weight: 400; }
.buy-btn{
  padding: 8px 15px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.buy-btn:hover{ background: var(--purple); border-color: var(--purple); color: #fff; }
.buy-btn:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}
.buy-btn:disabled:hover{ background: var(--surface-2); border-color: var(--border); color: var(--text); }

.empty{
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ===== footer ===== */
footer{
  padding: 36px 0 30px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 13px;
}
footer .wrap{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== modal ===== */
.modal-backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open{ display: flex; }
.modal{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 400px;
  width: 100%;
}
.modal h3{ margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.modal p{ color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }
.modal-close{
  float: right;
  background: none; border: none;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 720px){
  .nav-links{ display: none; }
}

/* ===== admin-specific ===== */
.admin-shell{ min-height: 100vh; }
.admin-header{
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11,11,15,0.9);
}
.admin-header .wrap{
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.admin-badge{
  font-size: 11px;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-soft);
  padding: 4px 9px;
  border-radius: 5px;
  letter-spacing: 0.03em;
}
.admin-layout{
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  padding: 30px 0 56px;
  align-items: start;
}
.panel{
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
}
.panel h2{ font-size: 16px; margin: 0 0 4px; font-weight: 700; }
.panel .sub{ color: var(--text-faint); font-size: 12.5px; margin: 0 0 18px; }

.field{ margin-bottom: 14px; }
.field label{
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input, .field select, .field textarea{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font);
}
.field textarea{ resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--purple); }
.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.table-wrap{
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
table{ width: 100%; border-collapse: collapse; }
thead th{
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
}
tbody td{
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td{ border-bottom: none; }
tbody tr:hover{ background: var(--surface-2); }
.row-name{ font-weight: 600; }
.row-desc{ color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.icon-btn{
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  margin-right: 6px;
}
.icon-btn:hover{ border-color: var(--purple); color: var(--purple); }
.icon-btn.danger:hover{ border-color: var(--danger); color: var(--danger); }

.toast{
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 200;
}
.toast.show{ transform: translateY(0); opacity: 1; }

.gate{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.gate-card{
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
}
.gate-card .brand-mark{ margin: 0 auto 16px; width: 30px; height: 30px; }
.gate-card h1{ font-size: 18px; margin: 0 0 6px; font-weight: 700; }
.gate-card p{ color: var(--text-faint); font-size: 13px; margin: 0 0 20px; }
.gate-card .field{ text-align: left; }
.gate-err{ color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

@media (max-width: 900px){
  .admin-layout{ grid-template-columns: 1fr; }
}
