/* Redd's Wares — shop UI patterned on what NookMart / Nook Shop actually do:
   dark chrome, category icons, lifestyle hero, dense white product tiles. */

:root {
  --leaf: #6fbf4a;
  --leaf-deep: #3d8c28;
  --navy: #162033;
  --navy-2: #1e2a44;
  --ink: #15202b;
  --muted: #4a5a68;
  --line: #d5dde4;
  --bg: #eef3e8;
  --surface: #ffffff;
  --accent: #e4570e;
  --accent-hover: #c2410c;
  --danger: #c1121f;
  --font: "Nunito", "Segoe UI", sans-serif;
  --display: "Nunito", "Segoe UI", sans-serif;
  --pad: clamp(0.65rem, 1.5vw, 1.25rem);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf-deep); }
a:hover { color: var(--accent); }
.hidden { display: none !important; }

/* —— Top promo —— */
.promo-bar {
  background: var(--navy);
  color: #e8f5d8;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem var(--pad);
}
.promo-bar strong { color: #fff; }

/* —— Header (NookMart-style dark chrome) —— */
.site-header {
  background: var(--navy-2);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 3px solid var(--leaf);
}
.site-header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.65rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  padding: 2px;
}
.header-search {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
}
.header-search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  background: #fff;
  color: var(--ink);
}
.header-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: auto;
}
.header-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 0.5rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}
.header-nav a[aria-current="page"],
.header-nav a:hover {
  background: rgba(111, 191, 74, 0.25);
}
.badge {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0.05rem 0.35rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

/* —— Category icon rail —— */
.cat-rail-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cat-rail {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.55rem var(--pad);
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cat-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 76px;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  border-radius: var(--radius-sm);
}
.cat-chip img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
.cat-chip:hover,
.cat-chip.is-active {
  color: var(--leaf-deep);
  background: rgba(111, 191, 74, 0.12);
}

/* —— Hero with game mosaic (proof we play) —— */
.hero {
  background: linear-gradient(135deg, #1b3d1f 0%, #2f6b35 55%, #1e4d28 100%);
  color: #fff;
}
.hero-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem var(--pad) 1.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 3.8vw, 2.55rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.hero-lead {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e5f7d8;
  max-width: 38ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.trust-pill {
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #f3ffe8;
}

.hero-mosaic {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.45rem;
  min-height: 240px;
}
.hero-mosaic figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}
.hero-mosaic figure:first-child {
  grid-row: 1 / span 2;
  min-height: 100%;
  background: #0f2414;
}
.hero-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  padding: 0.45rem;
}
.hero-mosaic figure:first-child img {
  object-fit: cover;
  padding: 0;
  image-rendering: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-leaf {
  background: #fff;
  color: var(--ink);
  border-color: transparent;
}
.btn-leaf:hover { background: #f2ffe8; color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* —— Main shop —— */
main,
.page-foot {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem var(--pad) 1.5rem;
}
.shop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0.35rem 0 0.65rem;
}
.shop-head h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}
.shop-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.toolbar {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(22, 32, 51, 0.06);
}
.toolbar input,
.toolbar select,
.card .var-select {
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.toolbar select { flex: 0 1 200px; }
.meta {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.75rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 1px 0 rgba(22, 32, 51, 0.03);
  min-width: 0;
}
.card-media {
  position: relative;
  aspect-ratio: 1;
  background: #f7fafc;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.card-media .card-hero {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  padding: 0.35rem;
}
.card-media .diy-badge {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  width: 34%;
  max-width: 2.6rem;
  image-rendering: pixelated;
  pointer-events: none;
}
.fake-banner {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  pointer-events: none;
}
.card--fake { border-color: #f5b5b5; }
.card .name {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  min-height: 2.4em;
  overflow-wrap: anywhere;
}
.card .meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.card .var-select { width: 100%; font-size: 0.85rem; min-height: 38px; }
.card .nofly-note {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a3412;
  line-height: 1.35;
}
.card .btn {
  width: 100%;
  margin-top: auto;
  border-radius: var(--radius-sm);
  background: var(--leaf);
  color: #102010;
  border: 0;
  min-height: 42px;
  font-size: 0.95rem;
}
.card .btn:hover { background: var(--leaf-deep); color: #fff; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
}
.pager .btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pager .btn:hover { border-color: var(--leaf); color: var(--leaf-deep); }
#page-label { font-weight: 800; color: var(--muted); }

.how {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}
.how h2 { margin: 0 0 0.5rem; font-size: 1.2rem; font-weight: 800; }
.how ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.65;
}
.how strong { color: var(--ink); }

.page-foot {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.cart-list { list-style: none; padding: 0; margin: 0; }
.cart-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.msg { margin: 0.75rem 0; color: var(--leaf-deep); font-weight: 800; }
.err { color: var(--danger); font-weight: 800; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mosaic { min-height: 180px; }
  .toolbar { top: 56px; }
}

@media (max-width: 640px) {
  .promo-bar { font-size: 0.78rem; padding: 0.35rem var(--pad); }
  .header-search { order: 3; flex-basis: 100%; }
  .hero-inner { padding: 0.75rem var(--pad); gap: 0.65rem; }
  .hero h1 { font-size: 1.3rem; margin-bottom: 0.35rem; }
  .hero-lead { font-size: 0.9rem; margin-bottom: 0.55rem; }
  .hero-mosaic { display: none; } /* phone: catalog first, mosaic is desktop proof */
  .trust-row { display: none; }
  .hero-actions { margin-bottom: 0; }
  .hero-actions .btn { min-height: 42px; padding: 0.45rem 0.9rem; font-size: 0.92rem; }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .shop-head { margin-top: 0.55rem; }
  .shop-head p { display: none; }
  .toolbar {
    top: 108px; /* header + search row */
    padding: 0.5rem;
  }
  .toolbar input,
  .toolbar select { flex: 1 1 100%; }
  .meta { margin-left: 0; width: 100%; }
  .cat-chip { width: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
