@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #060708;
  --bg-alt: #0d1013;
  --bg-card: #101418;
  --fg: #f2f3f5;
  --fg-dim: #9aa0a6;
  --fg-faint: #5b6167;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --accent: #ffffff;
  --ok: #2ecc71;
  --warn: #f5a524;
  --danger: #ef4444;
  --radius: 2px;
  --font: 'JetBrains Mono', ui-monospace, 'Fira Code', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--fg-dim); }

h1, h2, h3, h4 {
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.6em;
  font-weight: 700;
}

p { margin: 0 0 1em; color: var(--fg-dim); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 7, 8, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 15px;
  white-space: nowrap;
}
.brand img { height: 28px; width: 28px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-nav a { color: var(--fg-dim); border-bottom: 1px solid transparent; padding-bottom: 3px; }
.main-nav a:hover, .main-nav a.active { color: var(--fg); border-bottom-color: var(--fg); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.lang-switch { position: relative; }
.lang-switch select {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.cart-link { position: relative; }
.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--fg);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
}

/* ---------------- Buttons / Forms ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 22px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--fg); }

.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: transparent; color: var(--fg); }

.btn-ghost { border-color: var(--border); color: var(--fg-dim); }
.btn-ghost:hover { border-color: var(--fg); color: var(--fg); background: transparent; }

.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 11px; }
.btn-block { width: 100%; }

label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 12px;
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fg);
}

.form-group { margin-bottom: 18px; position: relative; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* ---------------- Alerts / Flash ---------------- */
.alert {
  border: 1px solid var(--border);
  border-left: 3px solid var(--fg);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  background: var(--bg-alt);
}
.alert-error { border-left-color: var(--danger); color: #ffb4b4; }
.alert-success { border-left-color: var(--ok); color: #b7f5cf; }

/* ---------------- Boot animation ---------------- */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  color: #e6e6e6;
  font-family: var(--font);
  font-size: 13px;
  padding: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#boot-log {
  white-space: pre-wrap;
  flex: 1;
  overflow: hidden;
}
#boot-log .ok { color: var(--ok); font-weight: 700; }
#boot-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  opacity: 0;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.35));
}
#boot-screen.fade-out { transition: opacity 0.4s ease; opacity: 0; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.05), transparent 60%);
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.1;
  margin-bottom: 28px;
}
.hero h1 span { display: block; }
.hero-quote {
  max-width: 620px;
  margin: 0 auto 32px;
  font-style: italic;
  color: var(--fg-dim);
  font-size: 14px;
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
  text-align: left;
}

/* ---------------- Product grid ---------------- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 40px;
  text-align: center;
}
.section-heading::before,
.section-heading::after {
  content: '';
  flex: 1;
  max-width: 220px;
  height: 1px;
  background: var(--border-strong);
}
.section-heading h2 {
  margin: 0;
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: 0.14em;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 56px 0;
}
@media (max-width: 980px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.product-card.in-view { opacity: 1; transform: translateY(0); }
.product-card.is-out-of-stock { opacity: 0.5; }
.product-card.is-out-of-stock:hover { opacity: 0.65; }

.product-thumb { aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 1px solid var(--border); background: #000; display: flex; align-items: center; justify-content: center; }
.product-thumb img { width: 70%; height: 70%; object-fit: contain; }

.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; margin: 0; }
.product-price-row { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.price { font-weight: 700; }
.price-old { color: var(--fg-faint); text-decoration: line-through; font-size: 12px; }

.badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.badge-discount { position: absolute; top: 10px; left: 10px; background: var(--fg); color: var(--bg); border: none; font-weight: 700; }
.badge-status { color: var(--fg-dim); }
.badge-unavailable { color: var(--warn); border-color: var(--warn); }

/* ---------------- Product detail ---------------- */
.product-detail { padding: 56px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail-image { border: 1px solid var(--border); background: #000; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.product-detail-image img { width: 60%; height: 60%; object-fit: contain; }
.color-options { display: flex; gap: 10px; margin: 16px 0; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
}
.color-swatch.selected { border-color: var(--fg); }

/* ---------------- Cart / tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
th { text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-dim); font-size: 11px; }

.cart-table img { width: 48px; height: 48px; object-fit: contain; background: #000; border: 1px solid var(--border); }
.qty-input { width: 60px; }

.cart-summary { max-width: 340px; margin-left: auto; margin-top: 24px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cart-summary-row.total { font-weight: 700; font-size: 16px; border-bottom: none; }

/* ---------------- Cards / auth panels ---------------- */
.panel {
  max-width: 440px;
  margin: 64px auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 36px;
}
.panel h1 { font-size: 18px; text-align: center; }
.panel-footer { text-align: center; margin-top: 18px; font-size: 12px; color: var(--fg-dim); }

.page-heading { padding: 48px 0 20px; }

/* ---------------- FAQ ---------------- */
.faq-page { max-width: 760px; margin: 0 auto; padding: 56px 0 80px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 48px; }

.faq-item {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease;
}
.faq-item:hover { border-color: var(--border-strong); }

.faq-item-question {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.faq-question-index {
  color: var(--fg-faint);
  font-weight: 400;
  font-size: 12px;
  flex-shrink: 0;
}

.faq-answer-body {
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.65;
}

.faq-ask-card { max-width: 100%; }
.faq-ask-card h2 { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------------- Footer ---------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------------- Address autocomplete ---------------- */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}
.autocomplete-list div { padding: 10px 12px; font-size: 12px; cursor: pointer; }
.autocomplete-list div:hover { background: var(--bg-card); }

.delivery-check-result { margin-top: 12px; font-size: 13px; padding: 10px 12px; border: 1px solid var(--border); }
.delivery-check-result.ok { border-color: var(--ok); color: #b7f5cf; }
.delivery-check-result.fail { border-color: var(--danger); color: #ffb4b4; }

/* ---------------- Wishlist / account ---------------- */
.tab-nav { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 28px; text-transform: uppercase; font-size: 12px; letter-spacing: 0.05em; }
.tab-nav a { padding-bottom: 12px; color: var(--fg-dim); border-bottom: 2px solid transparent; }
.tab-nav a.active { color: var(--fg); border-bottom-color: var(--fg); }

/* ---------------- Admin ---------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-sidebar .brand { padding: 0 20px 24px; }
.admin-sidebar nav a {
  display: block;
  padding: 10px 20px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  border-left: 2px solid transparent;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: var(--fg); border-left-color: var(--fg); background: var(--bg-alt); }
.admin-main { flex: 1; padding: 32px 40px; max-width: 1200px; }
.admin-main h1 { font-size: 20px; margin-bottom: 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { border: 1px solid var(--border); background: var(--bg-card); padding: 20px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-label { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); letter-spacing: 0.05em; margin-top: 4px; }

.admin-card { border: 1px solid var(--border); background: var(--bg-card); padding: 24px; margin-bottom: 24px; }
.admin-card h2 { font-size: 15px; margin-bottom: 18px; }

.thumb-sm { width: 40px; height: 40px; object-fit: contain; background: #000; border: 1px solid var(--border); }

.status-pill { display: inline-block; padding: 3px 9px; font-size: 10px; text-transform: uppercase; border: 1px solid var(--border-strong); border-radius: 999px; }
.status-pill.paid { border-color: var(--ok); color: var(--ok); }
.status-pill.pending { border-color: var(--warn); color: var(--warn); }
.status-pill.failed, .status-pill.cancelled { border-color: var(--danger); color: var(--danger); }

.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.image-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.image-grid figure { margin: 0; border: 1px solid var(--border); padding: 6px; text-align: center; }
.image-grid img { width: 70px; height: 70px; object-fit: contain; background: #000; }
.image-grid figcaption { font-size: 10px; color: var(--fg-dim); margin-top: 4px; }

.empty-state { color: var(--fg-faint); font-size: 13px; padding: 40px 0; text-align: center; }

/* ---------------- Inline flex form rows (checkout delivery check, admin quick-add forms) ---------------- */
.inline-form-row { display: flex; gap: 10px; align-items: flex-end; }
.inline-form-row > * { min-width: 0; }

/* ---------------- Mobile nav ---------------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--fg); }

.nav-menu { display: flex; align-items: center; gap: 24px; min-width: 0; }

@media (max-width: 860px) {
  .site-header .container { gap: 12px; }
  .main-nav { font-size: 13px; }
  .nav-toggle { display: block; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav-menu.open { display: flex; }

  .main-nav, .nav-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    font-size: 14px;
  }
  .main-nav a, .nav-right > a {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }
  .nav-right { padding: 4px 0 12px; }
  .lang-switch { padding: 12px 24px; }
  .lang-switch select { width: 100%; }
  .cart-link { display: flex; justify-content: space-between; align-items: center; }
  .cart-count { position: static; }
}

/* ---------------- Responsive tables ---------------- */
@media (max-width: 700px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-card { overflow-x: auto; }
}

@media (max-width: 640px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 4px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 14px;
    margin-bottom: 12px;
  }
  .cart-table td { border: none; padding: 0; }
  .cart-table td:nth-child(1) { grid-row: 1 / 4; }
  .cart-table td:nth-child(2), .cart-table td:nth-child(3), .cart-table td:nth-child(4) { grid-column: 2; }
  .cart-table td:nth-child(3) { display: flex; align-items: center; gap: 8px; }
  .cart-table td:nth-child(3)::before { content: attr(data-label) ':'; color: var(--fg-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
  .cart-table td:nth-child(4) { font-weight: 700; }
  .cart-table td:nth-child(5) { grid-column: 1 / 3; margin-top: 8px; }
  .cart-table td:nth-child(5) .btn { width: 100%; }
}

/* ---------------- Admin mobile ---------------- */
@media (max-width: 780px) {
  .admin-shell { flex-direction: column; min-height: 0; }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }
  .admin-sidebar .brand { padding: 0 16px 14px; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
  .admin-sidebar nav a {
    padding: 8px 10px;
    border-left: none;
    border: 1px solid var(--border);
    white-space: nowrap;
  }
  .admin-sidebar nav a:hover, .admin-sidebar nav a.active { border-color: var(--fg); background: var(--bg-alt); }
  .admin-main { padding: 20px 16px; max-width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------------- Small-screen polish ---------------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .panel { padding: 28px 20px; margin: 40px auto; }
  #boot-screen { padding: 20px; }
  .color-row { flex-wrap: wrap; }
}
