/* === NXRE Official — Styles (Full Rewrite) === */

/* ---------- Theme Tokens ---------- */
:root {
  --bg: #0b0b0b;          /* main background (black) */
  --bg-side: #2b2f33;     /* gunmetal side gutters */
  --card: #141416;        /* card surface */
  --text: #f1f1f1;        /* primary text */
  --muted: #b6b6b6;       /* secondary text */
  --accent: #e11d48;      /* magenta-red primary */
  --accent-2: #ff3b5c;    /* brighter hover */
  --border: #2a2a2a;      /* subtle borders */
}

/* ---------- Resets ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Accessibility focus */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Side gutters (gunmetal) */
body::before, body::after {
  content: "";
  position: fixed; top: 0; bottom: 0;
  width: max(3vw, 18px);
  background: var(--bg-side);
  pointer-events: none;
  z-index: 0;
}
body::before { left: 0; }
body::after  { right: 0; }

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 5; /* sits below backdrop (which is 9998) */
  backdrop-filter: blur(8px);
  background: rgba(11,11,11,0.7);
  border-bottom: 2px solid var(--accent);
}
.nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 28px; width: auto; }

nav ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
nav li { padding: 8px 10px; border-radius: 8px; }
nav li:hover { background: var(--card); }

/* ---------- Buttons ---------- */
.btn {
  background: var(--accent);
  color: #0b0b0b;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .02s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn.badge { position: relative; }
.badge::after {
  content: attr(data-badge);
  position: absolute; top: -6px; right: -6px;
  background: var(--accent);
  color: #0b0b0b;
  border-radius: 10px;
  font-size: 12px;
  padding: 1px 6px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  padding: 40px 0 24px;
}
.hero-card {
  background: linear-gradient(180deg, #161616, #0f0f0f);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-content { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
h1 { font-size: clamp(28px, 4vw, 48px); line-height: 1.1; margin: 0; }
p.lead { color: var(--muted); margin: 0; }
.cta { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- Grid & Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.card img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.price { color: var(--accent); font-weight: 700; }

/* ---------- Separators ---------- */
.hr { border-top: 1px solid var(--border); margin: 24px 0; }

/* ---------- Modal (product quick view) ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }
.modal-card {
  width: min(900px, 100%);
  background: #111;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr;
}
.modal-card img { width: 100%; height: 100%; object-fit: cover; }
.modal-card .content { padding: 20px; }
.qty { display: flex; gap: 8px; align-items: center; }
.qty input {
  width: 64px; padding: 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: #0f0f0f; color: var(--text);
}

/* ---------- Cart Panel & Backdrop ---------- */
.cart-panel {
  position: fixed; top: 0; right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #111;
  border-left: 1px solid var(--border);
  transform: translateX(110%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
  /* make sure it's above the dark backdrop */
  z-index: 9999 !important;
}
.cart-panel.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.cart-items {
  flex: 1; overflow: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.cart-item {
  display: flex; gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px;
}
.cart-item img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
}
.cart-footer { padding: 14px; border-top: 1px solid var(--border); }

/* Make the cart close (X) button clearer */
.cart-header .icon-btn {
  font-size: 18px; line-height: 1;
}
.cart-header .icon-btn:hover {
  border-color: var(--accent); color: var(--accent);
}

/* Backdrop element injected by JS; sits over whole page (incl header) */
#cartBackdrop {
  z-index: 9998; /* below cart panel (9999), above everything else */
}

/* ---------- Forms ---------- */
label { font-size: 14px; color: var(--muted); }
form input, form textarea {
  width: 100%; padding: 10px; border-radius: 10px;
  border: 1px solid var(--border); background: #0f0f0f; color: var(--text);
}
form textarea { min-height: 120px; resize: vertical; }

/* ---------- Footer ---------- */
footer {
  border-top: 2px solid var(--accent);
  margin-top: 40px; padding: 24px 0; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .modal-card { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .nav { gap: 10px; }
  nav ul { gap: 12px; }
}
