/* Bitty Twister — retro professional theme
   Palette: warm cream paper · ink navy · sunset orange · deep teal · arcade gold · arcade green */

:root {
  --cream: #f6f1e4;
  --cream-2: #efe7d3;
  --paper: #fffaf0;
  --ink: #16152b;
  --ink-soft: #2b2a45;
  --orange: #e94e1b;
  --orange-dark: #b93a10;
  --teal: #1e6e7a;
  --teal-dark: #144952;
  --gold: #f5b700;
  --green: #2fae6b;
  --tan: #d9cfb6;
  --line: #c9bda0;
  --shadow: 0 6px 0 var(--ink);
  --shadow-sm: 0 3px 0 var(--ink);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.grain {
  pointer-events: none; position: fixed; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.06'/></svg>");
  mix-blend-mode: multiply;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--orange); }

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

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }

h1, h2, h3 { font-family: "Rubik Mono One", "Manrope", sans-serif; letter-spacing: 0.5px; margin: 0 0 0.6em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.2; }

.pixel { font-family: "VT323", monospace; font-size: 1.4rem; letter-spacing: 1px; color: var(--teal); text-transform: uppercase; }

.muted { color: #5a5870; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.site-header__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark {
  display: inline-block; width: 44px; height: 44px; text-align: center; line-height: 44px;
  background: var(--ink); color: var(--gold);
  font-family: "Rubik Mono One"; font-size: 1.05rem; border-radius: 8px;
  box-shadow: 3px 3px 0 var(--orange);
}
.brand__word { font-family: "Rubik Mono One"; font-size: 1.35rem; letter-spacing: 1px; }
.brand__tag { font-family: "VT323"; color: var(--teal); margin-left: 8px; font-size: 1.1rem; white-space: nowrap; }
.brand--footer .brand__mark { background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--gold); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  color: var(--ink); font-weight: 600; letter-spacing: 0.2px;
  padding: 6px 2px; position: relative;
}
.nav a:hover { color: var(--orange); }
.nav a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--orange);
}
.nav__cart {
  background: var(--ink); color: var(--paper) !important;
  padding: 10px 14px !important; border-radius: 8px;
  box-shadow: 3px 3px 0 var(--orange);
}
.nav__cart:hover { background: var(--teal); color: var(--paper) !important; }
.nav__cart:hover::after { display: none; }
.badge {
  display: inline-block; background: var(--gold); color: var(--ink); font-weight: 800;
  border-radius: 999px; padding: 0 8px; font-size: 0.8rem; margin-left: 4px;
}

.marquee {
  background: var(--ink); color: var(--gold);
  font-family: "VT323"; font-size: 1.15rem;
  overflow: hidden; border-bottom: 3px solid var(--orange);
}
.marquee__track {
  display: inline-flex; gap: 38px; white-space: nowrap;
  padding: 8px 0; animation: bt-marquee 40s linear infinite;
}
@keyframes bt-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-family: "Manrope"; letter-spacing: 0.3px;
  padding: 14px 22px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--orange); color: var(--paper);
  box-shadow: var(--shadow); transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
  text-decoration: none; font-size: 1rem;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); color: var(--paper); background: var(--orange-dark); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--teal { background: var(--teal); }
.btn--teal:hover { background: var(--teal-dark); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--sm { padding: 9px 14px; font-size: 0.9rem; box-shadow: var(--shadow-sm); }
.btn--block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  background:
    radial-gradient(circle at 10% 20%, rgba(245,183,0,.15), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(30,110,122,.12), transparent 40%),
    var(--cream);
  border-bottom: 3px solid var(--ink);
  position: relative; overflow: hidden;
}
.hero__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; align-items: center; }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__eyebrow {
  display: inline-block; padding: 6px 12px; background: var(--ink); color: var(--gold);
  font-family: "VT323"; font-size: 1.2rem; border-radius: 6px; letter-spacing: 2px;
}
.hero__title { margin: 18px 0 14px; }
.hero__title em { font-style: normal; color: var(--orange); }
.hero__sub { font-size: 1.1rem; max-width: 52ch; }
.hero__cta { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.hero__stack {
  position: relative; aspect-ratio: 1 / 1; background: var(--paper);
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: 10px 10px 0 var(--ink);
  padding: 22px; overflow: hidden;
}
.hero__stack::before {
  content: ""; position: absolute; inset: 14px; border: 2px dashed var(--tan); border-radius: 14px;
}
.hero__chip {
  position: absolute; padding: 8px 12px; background: var(--gold); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px; font-family: "VT323"; font-size: 1.2rem;
  box-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg);
}
.hero__chip--2 { background: var(--green); color: var(--ink); top: 30px; right: 40px; transform: rotate(5deg); }
.hero__chip--3 { background: var(--orange); color: var(--paper); bottom: 40px; left: 30px; transform: rotate(-8deg); }
.hero__chip--1 { top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-2deg); background: var(--teal); color: var(--paper); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section__head .pixel { color: var(--orange); }
.section__link { font-weight: 700; }

/* ---------- Product grid + cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 740px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--ink); }
.card__media {
  aspect-ratio: 1 / 1; background: var(--cream-2); position: relative; overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--gold); color: var(--ink); font-family: "VT323"; font-size: 1rem; letter-spacing: 1px;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip--teal { background: var(--teal); color: var(--paper); }
.chip--green { background: var(--green); color: var(--ink); }
.chip--orange { background: var(--orange); color: var(--paper); }
.card__body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { font-family: "VT323"; color: var(--teal); letter-spacing: 1px; font-size: 0.95rem; }
.card__title { font-family: "Manrope"; font-weight: 800; font-size: 1.02rem; line-height: 1.25; color: var(--ink); }
.card__row { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; gap: 8px; }
.card__price { font-family: "Rubik Mono One"; font-size: 1.15rem; color: var(--orange); }
.card__cta { font-weight: 700; color: var(--teal); }

/* ---------- Single product ---------- */
.product { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; padding: 40px 0; }
@media (max-width: 880px) { .product { grid-template-columns: 1fr; } }
.gallery {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: 12px;
  box-shadow: 8px 8px 0 var(--ink);
}
.gallery__main {
  aspect-ratio: 1 / 1; background: var(--cream-2); border-radius: 10px; overflow: hidden; position: relative;
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumbs button {
  width: 68px; height: 68px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper);
  padding: 0; cursor: pointer; overflow: hidden; box-shadow: 2px 2px 0 var(--ink);
}
.gallery__thumbs button.is-active { outline: 3px solid var(--orange); outline-offset: 2px; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--gold); border: none; border-radius: 8px;
  width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__nav:hover { background: var(--orange); }

.product__title { margin-bottom: 6px; }
.product__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.product__price { font-family: "Rubik Mono One"; font-size: 2.2rem; color: var(--orange); margin: 8px 0 18px; }
.product__desc { line-height: 1.7; white-space: pre-line; }
.product__spec { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.product__spec dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
.product__spec dt { font-family: "VT323"; color: var(--teal); font-size: 1.1rem; }

.product__actions { display: flex; gap: 10px; margin: 20px 0 10px; flex-wrap: wrap; }
.product__trust { margin-top: 20px; display: flex; gap: 16px; flex-wrap: wrap; font-family: "VT323"; color: var(--teal); font-size: 1.1rem; }

/* ---------- Cart & forms ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 10px; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: middle; }
.table th { font-family: "VT323"; color: var(--teal); letter-spacing: 1px; }
.cart-item-thumb { width: 64px; height: 64px; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--cream-2); }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--paper); }
.qty button { background: transparent; border: none; width: 34px; height: 34px; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty input { width: 44px; height: 34px; border: none; text-align: center; font-weight: 700; background: transparent; color: var(--ink); }

.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--paper); font-family: inherit; font-size: 1rem; color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--orange); }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .fields-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: 22px;
  box-shadow: 6px 6px 0 var(--ink);
}

.summary { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 22px; }
.summary h3 { color: var(--gold); }
.summary__row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary__total { border-top: 1px dashed #444; margin-top: 8px; padding-top: 14px; font-weight: 800; font-size: 1.2rem; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border: 2px solid var(--ink); border-radius: 10px; margin: 14px 0; font-weight: 600; }
.alert--ok   { background: #d9f4e3; }
.alert--err  { background: #fbd5cc; }
.alert--info { background: #fff1b8; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); margin-top: 60px; border-top: 4px solid var(--orange); }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 28px; padding: 46px 20px 28px; }
@media (max-width: 780px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: "Rubik Mono One"; color: var(--gold); font-size: 0.95rem; letter-spacing: 1px; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--gold); }
.site-footer .muted { color: #9e9ab4; }
.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pay-badges span { background: var(--paper); color: var(--ink); padding: 4px 8px; border-radius: 6px; font-weight: 800; font-size: 0.8rem; }
.site-footer__legal { display: flex; justify-content: space-between; padding: 14px 20px 28px; border-top: 1px solid #2a294e; font-size: 0.9rem; }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .admin { grid-template-columns: 1fr; } }
.admin__side { background: var(--ink); color: var(--cream); padding: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin__side .brand__word { color: var(--paper); }
.admin__side .brand__tag { color: var(--gold); }
.admin__menu { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; }
.admin__menu a { color: var(--cream); padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.admin__menu a:hover, .admin__menu a.is-active { background: var(--orange); color: var(--paper); }
.admin__main { padding: 28px 28px 60px; background: var(--cream); }
.admin__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.admin__stat {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 18px 20px; box-shadow: 4px 4px 0 var(--ink);
}
.admin__stat strong { font-family: "Rubik Mono One"; font-size: 1.8rem; color: var(--orange); display: block; }
.admin__stat span { font-family: "VT323"; color: var(--teal); font-size: 1.1rem; }

/* Auth screen */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px; background:
   radial-gradient(circle at 20% 20%, rgba(245,183,0,.18), transparent 50%),
   radial-gradient(circle at 80% 80%, rgba(30,110,122,.18), transparent 50%), var(--cream); }
.auth-card { width: 100%; max-width: 420px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 28px; box-shadow: 10px 10px 0 var(--ink); }

/* Utility */
.flex { display: flex; } .flex-1 { flex: 1; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.mt-0{margin-top:0}.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.center { text-align: center; } .right { text-align: right; }
.hidden { display: none; }
