:root {
  --bg: #e4e8ef;
  --slate: #cbd2dd;
  --ink: #1e1e1e;
  --yellow: #ffc93c;
  --coral: #ef5f4f;
  --blue: #29a3dc;
  --white: #fff;
  --muted: #5b6577;
  --radius: 18px;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(30,30,30,.07) 1.5px, transparent 0);
  background-size: 22px 22px;
  line-height: 1.5;
}
h1, h2, h3, .btn, .price, legend, .stats b { font-family: 'Baloo 2', 'Nunito', sans-serif; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.1; margin: .3em 0 .4em; font-weight: 800; }
h2 { font-size: 1.3rem; margin: .2em 0 .5em; font-weight: 700; }
a { color: #1675a6; }
img { max-width: 100%; display: block; }
code { background: var(--slate); padding: 1px 6px; border-radius: 6px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: var(--line);
}
.brand img { height: 52px; width: auto; }
.cartbtn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; text-decoration: none; color: var(--ink);
  background: var(--yellow); border: var(--line); border-radius: 999px;
  padding: 6px 14px; box-shadow: 3px 3px 0 var(--ink);
}
.cartcount { background: var(--ink); color: #fff; border-radius: 999px; min-width: 24px; text-align: center; padding: 0 7px; font-size: .9rem; }
.cartcount.has { background: var(--coral); }
.adminnav { display: flex; flex-wrap: wrap; gap: 4px; }
.adminnav a { text-decoration: none; color: var(--ink); font-weight: 800; padding: 6px 10px; border-radius: 10px; }
.adminnav a:hover { background: var(--slate); }

/* Hero */
.hero {
  text-align: center; margin: 22px 0 26px; padding: 26px 18px;
  background: var(--white); border: var(--line); border-radius: 28px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; opacity: .9; z-index: 0;
}
.hero::before { width: 120px; height: 120px; background: var(--yellow); top: -50px; left: -40px; }
.hero::after { width: 90px; height: 90px; background: var(--blue); bottom: -40px; right: -25px; }
.hero h1 { position: relative; z-index: 1; color: var(--coral); text-shadow: 2px 2px 0 var(--ink); }
.hero p { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; font-size: 1.1rem; }

/* Grid of fidgets */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 230px), 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--white); border: var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.card:hover, .card:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.card-img { aspect-ratio: 1; background: var(--slate); border-bottom: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; }
.card-body h2 { font-size: 1.1rem; margin: 0 0 4px; line-height: 1.2; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--coral); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches.mini { gap: 3px; align-items: center; }
.swatches.mini i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.swatches.mini small { font-size: .75rem; color: var(--muted); }

/* Detail page */
.back { display: inline-block; margin: 16px 0 6px; font-weight: 800; text-decoration: none; color: var(--ink); }
.detail { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .detail { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.gallery-main { aspect-ratio: 1; background: var(--white); border: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: 0 0 64px; height: 64px; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: var(--slate); cursor: pointer; }
.thumb.on { border-color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.panel { background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.desc { color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }

.swatch input, .pill input, .colorchip input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { cursor: pointer; position: relative; }
.swatch i { display: block; width: 42px; height: 42px; border-radius: 50%; border: var(--line); transition: transform .1s; }
.swatch input:checked + i { box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--blue); transform: scale(1.06); }
.swatch input:focus-visible + i { outline: 3px dashed var(--blue); outline-offset: 6px; }

.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { cursor: pointer; position: relative; }
.pill span { display: inline-block; padding: 8px 18px; border: var(--line); border-radius: 999px; font-weight: 800; background: var(--white); }
.pill input:checked + span { background: var(--blue); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.pill input:focus-visible + span { outline: 3px dashed var(--coral); outline-offset: 3px; }
.pill small { font-weight: 600; opacity: .85; }

.qty { display: inline-flex; align-items: center; border: var(--line); border-radius: 999px; overflow: hidden; background: var(--white); }
.qty button { width: 44px; height: 44px; border: 0; background: var(--yellow); font-size: 1.4rem; font-weight: 800; cursor: pointer; color: var(--ink); }
.qty input, .qty span { width: 52px; text-align: center; border: 0; font: inherit; font-weight: 800; font-size: 1.1rem; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.small button { width: 32px; height: 32px; font-size: 1.1rem; }
.qty.small span { width: 34px; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  font-weight: 800; font-size: 1.05rem; color: #fff; background: var(--coral);
  border: var(--line); border-radius: 999px; padding: 8px 20px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.big { width: 100%; padding: 12px 20px; font-size: 1.2rem; }
.btn.small { padding: 3px 12px; font-size: .9rem; }
.btn.ghost { background: var(--white); color: var(--ink); }
.btn.danger { color: #b3261e; }
.btn.pop { animation: pop .4s; }
@keyframes pop { 50% { transform: scale(1.05) rotate(-1deg); background: var(--blue); } }
.linkbtn { background: none; border: 0; padding: 0; color: #1675a6; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.added { font-weight: 800; color: #1b7a3a; margin: 10px 0 0; }

/* Cart & checkout */
.checkout { display: grid; gap: 18px; }
@media (min-width: 820px) { .checkout { grid-template-columns: 1fr 1fr; align-items: start; } }
.lines { list-style: none; margin: 0 0 8px; padding: 0; }
.line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 2px dashed var(--slate); }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 2px solid var(--ink); flex: none; }
.line-info { flex: 1; min-width: 0; }
.line-info small { display: block; color: var(--muted); margin-bottom: 4px; }
.line-right { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.lines.static li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 2px dashed var(--slate); }
.total-row { display: flex; justify-content: space-between; padding: 6px 0; }
.total-row.big { font-size: 1.25rem; border-top: var(--line); margin-top: 6px; padding-top: 10px; }
.free { color: #1b7a3a; }

.form label { display: block; font-weight: 800; margin-bottom: 12px; }
.form label small { font-weight: 600; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]), .form textarea, .form select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  font: inherit; font-weight: 600; border: var(--line); border-radius: 12px; background: #fbfcfe;
}
.form input:focus, .form textarea:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.form.narrow { max-width: 420px; margin: 30px auto; }
.form .check, .check { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.check.small { font-size: .85rem; font-weight: 600; }
.check.small input { width: 16px; height: 16px; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; align-items: end; }
.fine { font-size: .9rem; color: var(--muted); }
.flash { background: #fff4d6; border: var(--line); border-radius: 12px; padding: 10px 14px; margin: 14px 0; font-weight: 700; }
.flash.err { background: #ffe1dd; }
.empty { text-align: center; padding: 40px 10px; font-size: 1.1rem; color: var(--muted); }

/* Status page */
.status { text-align: center; }
.steps { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 22px 0 6px; position: relative; }
.steps::before { content: ''; position: absolute; top: 18px; left: 10%; right: 10%; height: 4px; background: var(--slate); }
.steps li { flex: 1; position: relative; font-weight: 700; font-size: .85rem; color: var(--muted); }
.steps li span { display: flex; margin: 0 auto 6px; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: var(--white); border: var(--line); font-weight: 800; position: relative; }
.steps li.done { color: var(--ink); }
.steps li.done span { background: var(--yellow); }
.steps li.now span { background: var(--coral); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(239,95,79,.25); } }

.foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 0 16px 30px; }

/* Admin */
.admin .wrap { max-width: 900px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.stats div { background: var(--white); border: var(--line); border-radius: var(--radius); padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stats div:nth-child(1) { background: var(--yellow); }
.stats div:nth-child(2) { background: #bfe5f7; }
.stats b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stats span { font-size: .85rem; font-weight: 700; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { text-decoration: none; color: var(--ink); font-weight: 800; padding: 5px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-size: .9rem; }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs small { opacity: .7; }
.orderrow { display: block; text-decoration: none; color: var(--ink); padding: 14px 16px; margin-bottom: 12px; }
.orderrow:hover { background: #fffbea; }
.orow-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.orow-top h1 { margin: 0; font-size: 1.6rem; }
.orow-items { margin: 4px 0; font-weight: 600; }
.orow-meta { font-size: .85rem; color: var(--muted); }
.badge { display: inline-block; font-size: .8rem; font-weight: 800; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; white-space: nowrap; }
.s-paid { background: var(--yellow); }
.s-printing { background: #bfe5f7; }
.s-out_for_delivery { background: var(--blue); color: #fff; }
.s-delivered { background: #b9eac8; }
.s-cancelled, .s-pending_payment { background: var(--slate); }
.note { background: #fff4d6; padding: 8px 12px; border-radius: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.adminlist .panel { margin-bottom: 10px; }
.fidgetrow { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 10px; }
.fidgetrow img { width: 70px; height: 70px; object-fit: cover; border-radius: 12px; border: 2px solid var(--ink); flex: none; }
.hidden-item { opacity: .6; }
.form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; }
.form.inline input[name=name] { flex: 1 1 180px; width: auto !important; margin: 0 !important; }
.form.inline input.short { width: 70px !important; margin: 0 !important; }
input[type=color] { width: 46px; height: 40px; padding: 2px; border: var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.colorpick { display: flex; flex-wrap: wrap; gap: 8px; }
.colorchip { position: relative; display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 5px 12px 5px 6px; border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; font-weight: 700 !important; background: #fff; }
.colorchip i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); }
.colorchip:has(input:checked) { background: var(--ink); color: #fff; }
.colorchip:has(input:focus-visible) { outline: 3px dashed var(--blue); outline-offset: 2px; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.photo { width: 110px; cursor: grab; }
.photo img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; border: var(--line); }
.photo.dragging { opacity: .4; }
.table { width: 100%; border-collapse: collapse; background: var(--white); border: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--slate); }
.table th { background: var(--yellow); font-family: 'Baloo 2', sans-serif; }
.danger { margin-top: 4px; }
textarea[readonly] { font-family: monospace; font-size: .85rem; }

/* QR sign */
.sign { max-width: 640px; margin: 10px auto; text-align: center; background: var(--white); border: 5px solid var(--ink); border-radius: 36px; padding: 28px; box-shadow: 8px 8px 0 var(--ink); }
.sign-logo { width: 300px; margin: 0 auto; }
.sign h1 { color: var(--coral); font-size: 2.6rem; text-shadow: 2px 2px 0 var(--ink); margin: 10px 0 4px; }
.sign-sub { font-size: 1.35rem; margin: 0 0 16px; }
.sign-qr { width: 300px; margin: 0 auto; border: 5px solid var(--ink); border-radius: 22px; overflow: hidden; background: #fff; }
.sign-qr svg { display: block; width: 100%; height: auto; }
.sign-url { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.5rem; margin: 12px 0 0; }
@media print {
  .topbar, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .sign { box-shadow: none; margin-top: 0; }
}
