/* Becky's Basement Bricks — LEGO palette + a cheeky peach accent */
:root {
  --primary: 4 77% 48%;        /* LEGO red */
  --secondary: 51 100% 50%;    /* LEGO yellow */
  --peach: 16 90% 68%;         /* Becky's peach — brand accent */
  --plum: 330 42% 26%;         /* deep plum for the hero fade */
  --lego-green: 145 100% 26%;
  --accent: 214 70% 39%;
  --destructive: 0 84% 60%;
  --background: 0 0% 100%;
  --foreground: 0 0% 4%;
  --muted: 220 14% 96%;
  --muted-foreground: 220 9% 46%;
  --border: 0 0% 85%;
  --card: 0 0% 100%;
  --radius: 0.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 1px 3px 0 hsl(0 0% 0% / .1), 0 1px 2px -1px hsl(0 0% 0% / .1);
  --shadow-md: 0 4px 6px -1px hsl(0 0% 0% / .1), 0 2px 4px -2px hsl(0 0% 0% / .1);
  --shadow-lg: 0 10px 15px -3px hsl(0 0% 0% / .1), 0 4px 6px -4px hsl(0 0% 0% / .1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  line-height: 1.5;
}
a { color: hsl(var(--accent)); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

/* layout */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.main { min-height: 60vh; padding: 2rem 0 4rem; }

/* header */
.site-header {
  background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border));
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow-sm);
}
.site-header .bar { display: flex; align-items: center; gap: 1.25rem; height: 64px; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em;
  color: hsl(var(--primary)); display: flex; align-items: center; gap: .5rem; }
.brand:hover { text-decoration: none; }
.brand img.logo { height: 38px; width: auto; display: block; }
.admin-side .brand img.logo { height: 30px; background: #fff; border-radius: 6px; padding: 5px 8px; }
.brand .stud { width: 22px; height: 22px; border-radius: 6px;
  background: hsl(var(--primary)); box-shadow: inset 0 -3px 0 hsl(0 0% 0% / .15); position: relative; }
.brand .stud::after { content: ""; position: absolute; inset: 4px 4px auto 4px; height: 6px;
  border-radius: 999px; background: hsl(0 0% 100% / .35); }
.nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; }
.nav a { color: hsl(var(--foreground)); font-weight: 500; font-size: .95rem; }
.nav a.active { color: hsl(var(--primary)); }
.cart-pill { background: hsl(var(--primary)); color: #fff; border-radius: 999px;
  padding: .35rem .8rem; font-weight: 600; font-size: .85rem; }
.cart-pill:hover { text-decoration: none; opacity: .92; }

/* hero — Flux-generated basement photo under a peach/plum gradient wash */
.hero { position: relative;
  background: linear-gradient(110deg, hsl(var(--plum) / .93) 0%, hsl(var(--plum) / .80) 38%, hsl(var(--primary) / .55) 68%, hsl(var(--peach) / .30) 100%), url(/assets/hero.png);
  background-size: cover; background-position: center 40%;
  color: #fff; padding: 3.5rem 0; }
.hero h1 { font-size: 2.4rem; max-width: 20ch; text-shadow: 0 2px 12px hsl(var(--plum) / .55); }
.hero p { font-size: 1.15rem; opacity: .96; max-width: 52ch; margin-bottom: 1.5rem; text-shadow: 0 1px 8px hsl(var(--plum) / .5); }
.hero .accent-bar { height: 6px; width: 80px; background: hsl(var(--secondary)); border-radius: 3px; margin-bottom: 1.25rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .95rem; padding: .6rem 1.1rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: hsl(var(--primary)); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(0 0% 15%); }
.btn-outline { background: transparent; border-color: currentColor; color: hsl(var(--foreground)); }
.btn-ghost { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* cards + grid */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: .15s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.set-card .thumb { aspect-ratio: 4/3; background: hsl(var(--muted)); display: flex;
  align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); font-weight: 700; font-size: 2rem; position: relative; }
/* Any .thumb is the positioning context + clips its image. */
.thumb { position: relative; overflow: hidden; }
/* Set photo covers the letter placeholder; onerror hides it to reveal the fallback. */
.thumb img.set-img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff; padding: .5rem; }
.set-card .body { padding: .85rem; }
.set-card .theme { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); font-weight: 700; }
.set-card .name { font-weight: 600; margin: .15rem 0 .35rem; display: block; color: hsl(var(--foreground)); }
.set-card .price { font-weight: 800; color: hsl(var(--lego-green)); }
.set-card .num { font-size: .8rem; color: hsl(var(--muted-foreground)); }
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-sale { background: hsl(var(--lego-green) / .12); color: hsl(var(--lego-green)); }
.badge-soon { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge-status { background: hsl(var(--accent) / .12); color: hsl(var(--accent)); }

/* forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
input, select, textarea { width: 100%; padding: .55rem .7rem; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid hsl(var(--primary) / .4); border-color: hsl(var(--primary)); }
.checkbox { display: flex; gap: .5rem; align-items: flex-start; }
.checkbox input { width: auto; margin-top: .2rem; }

/* panels */
.panel { background: #fff; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 1.25rem; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.5rem; }

/* tabs (set detail) */
.tab-bar { display: flex; gap: .25rem; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 1rem; }
.tab-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: .55rem .9rem;
  font: inherit; font-weight: 600; font-size: .92rem; color: hsl(var(--muted-foreground));
  cursor: pointer; width: auto; border-radius: 0; margin-bottom: -1px; }
.tab-btn:hover { color: hsl(var(--foreground)); }
.tab-btn.active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }
.tab-panel[hidden] { display: none; }
.tab-panel p { margin: 0; }
table.spec { width: 100%; border-collapse: collapse; }
table.spec th { text-align: left; font-weight: 600; font-size: .88rem; text-transform: none; letter-spacing: 0;
  color: hsl(var(--muted-foreground)); width: 42%; padding: .45rem .5rem .45rem 0; border: none; }
table.spec td { padding: .45rem 0; border: none; font-size: .92rem; }
table.spec tr + tr { border-top: 1px solid hsl(var(--border)); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid hsl(var(--border)); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: hsl(var(--muted-foreground)); }
tbody tr:hover { background: hsl(var(--muted) / .6); }
.table-wrap { overflow-x: auto; }

/* misc */
.muted { color: hsl(var(--muted-foreground)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.empty { text-align: center; padding: 3rem 1rem; color: hsl(var(--muted-foreground)); }
.notice { padding: .7rem .9rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1rem; }
.notice-error { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }
.notice-ok { background: hsl(var(--lego-green) / .1); color: hsl(var(--lego-green)); }
.notice-warn { background: hsl(var(--secondary) / .25); color: hsl(38 60% 30%); }
.big-price { font-size: 2rem; font-weight: 800; color: hsl(var(--lego-green)); }
.pageinfo { margin: 1.25rem 0; display: flex; gap: 1rem; align-items: center; justify-content: center; }
.footer { background: hsl(0 0% 8%); color: hsl(0 0% 75%); padding: 2.5rem 0; margin-top: 3rem; font-size: .9rem; }
.footer a { color: hsl(0 0% 88%); }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat { background: #fff; border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.1rem; }
.stat .n { font-size: 1.8rem; font-weight: 800; }
.stat .l { font-size: .8rem; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: .03em; }

/* admin shell */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.admin-side { background: hsl(220 14% 13%); color: hsl(0 0% 82%); padding: 1.25rem 0; }
.admin-side .brand { color: #fff; padding: 0 1.25rem 1rem; }
.admin-side a { display: block; color: hsl(0 0% 78%); padding: .55rem 1.25rem; font-size: .92rem; }
.admin-side a:hover, .admin-side a.active { background: hsl(220 14% 20%); color: #fff; text-decoration: none; }
.admin-main { padding: 1.75rem 2rem; background: hsl(var(--muted)); }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; flex-wrap: wrap; gap: .25rem; }
  .hero h1 { font-size: 1.8rem; }
}
