/* Minnesota Made 3D — storefront styles */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #1c2430;
  --muted: #5d6773;
  --line: #e4dfd5;
  --brand: #1f6f9f;
  --brand-dark: #165d86;
  --brand-soft: #e6f0f7;
  --accent: #e2762b;
  --ok: #2e8b57;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.06), 0 8px 24px rgba(28, 36, 48, 0.06);
  --max: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.container { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.logo svg { width: 32px; height: 32px; }
.logo span small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-link .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-link .count[hidden] { display: none; }
@media (max-width: 560px) {
  .nav a:not(.cart-link) { display: none; }
  .logo span small { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(40px, 8vw, 88px);
  background:
    radial-gradient(1200px 400px at 10% -10%, #dcecf6 0%, transparent 60%),
    radial-gradient(800px 300px at 100% 0%, #fbe7d6 0%, transparent 60%);
}
.hero .container { display: grid; gap: 28px; grid-template-columns: 1.15fr 0.85fr; align-items: center; }
.hero .eyebrow { color: var(--brand-dark); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 12px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.hero .art { justify-self: center; width: min(100%, 420px); }
@media (max-width: 760px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero .art { order: -1; width: min(100%, 300px); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--brand); color: #fff; transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #c9651f; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 26px; font-size: 1.05rem; }
.btn.sm { padding: 7px 12px; font-size: 0.9rem; border-radius: 8px; }
.btn.ghost { background: transparent; color: var(--brand-dark); border-color: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }

/* ---------- sections & cards ---------- */
.section { padding-block: clamp(32px, 6vw, 64px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.product-card { text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28,36,48,0.06), 0 14px 32px rgba(28,36,48,0.10); }
.product-card .thumb { aspect-ratio: 4 / 3; background: #eef3f7; display: grid; place-items: center; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: 1.05rem; }
.product-card .short { color: var(--muted); font-size: 0.93rem; margin: 0; flex: 1; }
.price { font-weight: 700; font-size: 1.1rem; }
.price .compare { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.badge.accent { background: #fbe7d6; color: #a54f13; }

.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 10px; }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- product page ---------- */
.product { display: grid; gap: 36px; grid-template-columns: 1.1fr 0.9fr; align-items: start; padding-block: 28px 56px; }
.product .gallery { background: #eef3f7; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.product .gallery img { width: 100%; height: 100%; object-fit: cover; }
.product .buy { display: flex; flex-direction: column; gap: 16px; }
.product .price { font-size: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
select, input[type="text"], input[type="number"], input[type="search"], textarea {
  font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid #cfc9be; background: #fff; color: var(--ink);
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.qty { display: inline-flex; align-self: flex-start; align-items: stretch; border: 1px solid #cfc9be; border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { font: inherit; font-size: 1.1rem; width: 42px; border: 0; background: #f3f0ea; cursor: pointer; color: var(--ink); }
.qty button:hover { background: #e9e4dc; }
.qty input { width: 56px; text-align: center; border: 0; border-radius: 0; padding: 10px 4px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.details { padding-left: 1.2em; margin: 0; color: var(--muted); }
.details li { margin-bottom: 4px; }
.ship-note { background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; font-size: 0.92rem; color: var(--brand-dark); }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; gap: 22px; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast a { color: #fff; font-weight: 700; }

/* ---------- cart ---------- */
.cart-layout { display: grid; gap: 28px; grid-template-columns: 1.4fr 0.8fr; align-items: start; padding-block: 24px 56px; }
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px; }
.cart-line .thumb { width: 84px; height: 84px; border-radius: 10px; background: #eef3f7; overflow: hidden; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .name { font-weight: 600; margin: 0; }
.cart-line .opts { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cart-line .controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cart-line .line-total { font-weight: 700; text-align: right; white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--danger); }
@media (max-width: 480px) {
  .cart-line { grid-template-columns: 64px 1fr; }
  .cart-line .thumb { width: 64px; height: 64px; }
  .cart-line .line-total { grid-column: 2; text-align: left; }
}
.summary { padding: 20px; position: sticky; top: 84px; }
.summary h2 { font-size: 1.2rem; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 1.1rem; }
.summary .note { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pay-methods span { font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: #f1eee8; color: var(--muted); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.95rem; }
.alert.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }
.alert[hidden] { display: none; }
.empty { text-align: center; padding: 56px 20px; }
.empty svg { width: 72px; height: 72px; margin: 0 auto 12px; color: #b9c3cc; }

/* ---------- success ---------- */
.success { max-width: 640px; margin: 0 auto; padding-block: 40px 64px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: #e3f3e9; color: var(--ok); display: grid; place-items: center; margin-bottom: 16px; }
.receipt { padding: 20px; margin-top: 20px; }
.receipt .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.receipt .row:last-child { border-bottom: 0; font-weight: 700; }
.address { white-space: pre-line; color: var(--muted); }

/* ---------- prose pages ---------- */
.prose { max-width: 720px; padding-block: 28px 64px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: 0.92rem; margin-top: 24px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- admin ---------- */
.admin { padding-block: 24px 64px; }
.admin .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin .toolbar .spacer { flex: 1; }
.orders { display: flex; flex-direction: column; gap: 12px; }
.order { padding: 16px 18px; }
.order .top { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.order .top .id { font-weight: 700; }
.order .top .when { color: var(--muted); font-size: 0.9rem; }
.order .top .amt { margin-left: auto; font-weight: 700; }
.status { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.status.new { background: #fbe7d6; color: #a54f13; }
.status.printing { background: var(--brand-soft); color: var(--brand-dark); }
.status.shipped { background: #e3f3e9; color: #1f6b3f; }
.status.canceled { background: #eee; color: #666; }
.status.unpaid { background: #fdecea; color: var(--danger); }
.order .body { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
@media (max-width: 640px) { .order .body { grid-template-columns: 1fr; } }
.order .items { margin: 0; padding-left: 1.1em; }
.order .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.order textarea { width: 100%; min-height: 56px; resize: vertical; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; }
