/* =========================================================================
   starphotocard — pastel "K-pop fancy" design system
   Ported from the Claude Design prototypes (Fredoka + Poppins, oklch pastels).
   ========================================================================= */

:root {
  --font-head: 'Fredoka', sans-serif;
  --font-body: 'Poppins', sans-serif;

  /* surface / ink */
  --bg: oklch(0.985 0.012 320);
  --ink-head: oklch(0.34 0.05 330);
  --ink-body: oklch(0.5 0.03 320);
  --ink-soft: oklch(0.55 0.03 320);
  --ink-mute: oklch(0.6 0.02 320);
  --border: oklch(0.94 0.015 330);
  --border-in: oklch(0.9 0.02 330);
  --panel: oklch(0.99 0.006 320);

  /* accent */
  --accent: oklch(0.7 0.16 340);
  --accent-strong: oklch(0.5 0.14 340);
  --accent-tint: oklch(0.96 0.03 340);
  --indigo: oklch(0.82 0.09 280);
  --green: oklch(0.55 0.14 160);

  --shadow-card: 0 30px 80px -34px oklch(0.5 0.1 330 / 0.45);
  --shadow-soft: 0 10px 26px -20px oklch(0.5 0.1 330 / 0.6);
  --shadow-btn: 0 12px 22px -12px oklch(0.7 0.16 340);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-body);
  background:
    radial-gradient(1200px 600px at 12% -5%, oklch(0.96 0.04 330), transparent),
    radial-gradient(1100px 600px at 100% 0%, oklch(0.96 0.035 250), transparent),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: oklch(0.44 0.16 340); }

h1, h2, h3 { font-family: var(--font-head); color: var(--ink-head); margin: 0; }

input, select, textarea, button { font-family: var(--font-body); }

img { max-width: 100%; }

/* ------------------------------------------------------------------ layout */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 1000px; }
.stack { display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ top nav */
.gonav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid oklch(0.95 0.015 330);
}
.gonav__inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.gonav__brand { display: flex; align-items: center; gap: 10px; }
.gonav__star {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, oklch(0.78 0.13 340), oklch(0.82 0.11 250));
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: var(--font-head); font-weight: 700; font-size: 16px;
}
.gonav__name { font-family: var(--font-head); font-weight: 600; font-size: 18px; color: var(--ink-head); }
.gonav__links { display: flex; align-items: center; gap: 22px; }
.gonav__link {
  position: relative; font-size: 14px; font-weight: 500; color: oklch(0.62 0.02 320);
  padding: 4px 0;
}
.gonav__link:hover { color: var(--accent-strong); }
.gonav__link.is-active { color: var(--accent-strong); }
.gonav__link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px;
  height: 3px; border-radius: 3px; background: oklch(0.72 0.16 340);
}
.gonav__actions { display: flex; align-items: center; gap: 12px; }
.gonav__logout { font-size: 12.5px; color: oklch(0.62 0.02 320); }
.gonav__icon {
  width: 38px; height: 38px; border-radius: 50%; background: oklch(0.96 0.02 330);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.gonav__user {
  display: flex; align-items: center; gap: 8px; background: oklch(0.96 0.02 330);
  color: oklch(0.42 0.04 330); font-weight: 500; font-size: 13px;
  padding: 7px 13px; border-radius: 999px;
  /* a signed-in buyer's email goes here — truncate rather than push the header wide */
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Buyer account chip — the nav's sign-in / my-account entry point. */
.gonav__acct {
  display: flex; align-items: center; gap: 8px; background: oklch(0.96 0.02 330);
  color: oklch(0.42 0.04 330); font-weight: 600; font-size: 13px;
  padding: 6px 14px 6px 6px; border-radius: 999px; text-decoration: none;
}
.gonav__acct--out { padding: 8px 15px; }
.gonav__acct:hover { background: oklch(0.93 0.035 330); }
.gonav__acct-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: oklch(0.72 0.16 340); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}
.gonav__acct-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Narrow screens: icon-only brand, tighter links (scrollable if they still
   overflow), and the cart pill pinned on the right so checkout stays reachable. */
@media (max-width: 720px) {
  .gonav__inner { padding: 12px 14px; gap: 10px; }
  .gonav__name { display: none; }
  .gonav__links { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .gonav__links::-webkit-scrollbar { display: none; }
  .gonav__link { font-size: 13px; white-space: nowrap; }
  .gonav__link.is-active::after { bottom: -8px; }
  .gonav__icon { width: 34px; height: 34px; font-size: 14px; }
  .gonav__actions { flex: 0 0 auto; gap: 8px; }
  /* Only drop the user chip where it competes with the cart pill for room.
     Admin pages have no cart, and the chip is their only header label. */
  .gonav__actions:has(#cart-open) .gonav__user { display: none; }
  /* Keep the avatar (the tap target) but drop the name where the cart pill
     competes for width. */
  .gonav__acct { padding: 6px; gap: 0; }
  .gonav__acct--out { padding: 7px 12px; font-size: 12.5px; }
  .gonav__acct-name { display: none; }
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; line-height: 1; text-align: center;
  transition: transform .06s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: white; box-shadow: var(--shadow-btn); }
.btn--primary:hover { color: white; }
.btn--ghost { background: white; border-color: var(--border-in); color: oklch(0.45 0.1 330); }
.btn--soft { background: var(--accent-tint); color: var(--accent-strong); border-color: oklch(0.9 0.05 340); }
.btn--muted { background: oklch(0.96 0.02 330); color: var(--ink-soft); }
.btn--dark { background: #111827; color: white; }
.btn--danger { background: oklch(0.95 0.05 25); color: oklch(0.52 0.16 25); }
.btn--green { background: var(--green); color: white; box-shadow: 0 12px 22px -12px var(--green); }
.btn--lg { padding: 11px 18px; font-size: 13.5px; }
.btn--sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn--full { width: 100%; }
.btn--pill { border-radius: 999px; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.pill--green  { background: oklch(0.9 0.06 160);  color: oklch(0.42 0.12 160); }
.pill--blue   { background: oklch(0.9 0.06 250);  color: oklch(0.42 0.13 250); }
.pill--amber  { background: oklch(0.93 0.07 75);  color: oklch(0.46 0.13 75); }
.pill--violet { background: oklch(0.92 0.06 300); color: oklch(0.46 0.12 300); }
.pill--gray   { background: oklch(0.95 0.02 330); color: oklch(0.5 0.03 330); }
.pill--red    { background: oklch(0.92 0.07 25);  color: oklch(0.5 0.16 25); }

/* ------------------------------------------------------------------ chips */
.chip {
  font-size: 13px; font-weight: 500; padding: 8px 15px; border-radius: 999px;
  background: oklch(0.96 0.02 330); color: oklch(0.45 0.04 330);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: inherit; line-height: 1.2;
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.is-active { background: var(--accent); color: white; font-weight: 600; }

/* ------------------------------------------------------------------ cards */
.card {
  background: white; border: 1px solid oklch(0.92 0.02 330);
  border-radius: 24px; box-shadow: var(--shadow-card); overflow: hidden;
}
.card--soft { border-radius: 16px; box-shadow: var(--shadow-soft); }

/* ------------------------------------------------------------------ forms */
.field { display: block; }
.field__label { font-size: 11px; color: oklch(0.5 0.03 330); margin-bottom: 5px; display: block; }
.field__label--up { text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.input, .select, .textarea {
  width: 100%; height: 36px; border: 1px solid var(--border-in); border-radius: 9px;
  background: white; padding: 0 12px; font-size: 12.5px; color: var(--ink-head);
  outline: none;
}
.textarea { height: auto; padding: 11px 12px; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: oklch(0.8 0.1 340); }
.input--sm { height: 32px; border-radius: 7px; font-size: 12px; }

/* checkout field validation + copy affordances (shared, used on /checkout) */
.input.is-invalid { border-color: oklch(0.52 0.16 25); }
.field__err { font-size: 12px; color: oklch(0.52 0.16 25); margin-top: 4px; }
.co-copy {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  padding: 3px 9px; font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--accent-strong); background: var(--accent-tint);
  border: 1px solid oklch(0.9 0.05 340); border-radius: 999px;
  cursor: pointer; line-height: 1;
}
.co-copy.is-copied { background: oklch(0.9 0.06 160); color: oklch(0.42 0.12 160); border-color: oklch(0.85 0.08 160); }

/* the placeholder "image pending" fill (pastel + diagonal stripes) */
.ph-stripe {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent, transparent 12px,
    oklch(1 0 0 / 0.16) 12px, oklch(1 0 0 / 0.16) 24px);
}
.ph-stripe--sm {
  background: repeating-linear-gradient(135deg, transparent, transparent 6px,
    oklch(1 0 0 / 0.2) 6px, oklch(1 0 0 / 0.2) 12px);
}
.imgfill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* generic admin scaffolding ---------------------------------------------- */
.adminwrap { max-width: 1240px; margin: 0 auto; padding: 30px 24px 90px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead h2 { font-weight: 500; font-size: 26px; }
.pagehead__sub { font-size: 13px; color: var(--ink-soft); margin-top: 4px; max-width: 640px; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: oklch(0.52 0.05 330); }
.rule { height: 1px; flex: 1; background: oklch(0.93 0.02 330); }
.hint { font-size: 11.5px; color: var(--ink-soft); }

/* data table shared bits */
.dgrid { display: grid; align-items: center; gap: 10px; }
.dhead {
  padding: 11px 18px; background: oklch(0.98 0.008 330);
  font-size: 9.5px; font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; color: oklch(0.56 0.03 320);
}
.drow { padding: 11px 18px; border-top: 1px solid oklch(0.97 0.01 330); font-size: 12.5px; color: oklch(0.42 0.03 320); }
.tbl-scroll { overflow-x: auto; }

.check {
  width: 15px; height: 15px; border: 1.5px solid oklch(0.84 0.03 330); border-radius: 4px;
  background: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 10px; font-weight: 700; flex: 0 0 auto;
}
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on::after { content: "✓"; }
.check--green.on { background: var(--green); border-color: var(--green); }
.thumb { position: relative; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flash messages */
.flash-wrap { max-width: 640px; margin: 16px auto -8px; padding: 0 24px; }
.flash {
  background: oklch(0.97 0.03 340); border: 1px solid oklch(0.86 0.06 340);
  color: oklch(0.44 0.14 340); font-size: 13px; font-weight: 500;
  padding: 11px 15px; border-radius: 12px; margin-bottom: 8px;
}

/* Mobile top nav: wrap instead of overflowing the viewport.
   Previously the brand + links + actions sat on one non-wrapping flex row,
   pushing every page ~120px past a phone-width screen (horizontal scroll). */
@media (max-width: 640px) {
  .gonav__inner { flex-wrap: wrap; gap: 8px 14px; padding: 11px 16px; }
  .gonav__links { gap: 14px; row-gap: 6px; flex-wrap: wrap; }
  .gonav__link.is-active::after { bottom: -6px; }
}

/* In-flight submit: the order POST is on the wire, so block a second click
   without hiding the button. */
.btn.is-busy { opacity: .65; pointer-events: none; }
