/* Kkachi Cache — dark & premium "treasure vault" design system.
   Royal gold + royal purple: purple-tinted blacks for the vault, gold spent
   sparingly (price, CTA, hover) so it stays premium, not gaudy. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:        #0B0912;
  --surface:   #151119;
  --surface-2: #1E1826;
  --line:      #302940;
  --ink:       #EDE9DF;
  --muted:     #99929F;
  --gold:      #D4AF37;
  --gold-hi:   #F2DE9B;
  --royal:     #9B7BD4;
  --royal-deep:#6C4AB6;
  --danger:    #E0564A;
  --holo: linear-gradient(120deg, var(--gold-hi), var(--royal), var(--royal-deep));
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 90% 60% at 50% -10%, #1a1428 0%, var(--bg) 65%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--gold-hi); }
img { max-width: 100%; display: block; }
button { font-family: var(--sans); cursor: pointer; }

.wrap { width: min(1200px, 92vw); margin: 0 auto; }
main.wrap { flex: 1; }

/* --- header ---------------------------------------------------------------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 12, .82);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 40;
}
header.site .wrap {
  display: flex; align-items: center; gap: 28px;
  padding: 16px 0;
}
.brand {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  color: var(--ink); letter-spacing: .02em; display: flex; align-items: center; gap: 10px;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 28px; height: 28px; }
.brand em {
  font-style: normal;
  background: var(--holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
nav.main { display: flex; gap: 22px; margin-left: auto; align-items: center; }
nav.main a { color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
nav.main a:hover, nav.main a.active { color: var(--ink); }
#cart-btn {
  background: none; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; transition: border-color .15s;
}
#cart-btn:hover { border-color: var(--gold); }
#cart-btn .count {
  background: var(--gold); color: #131316; border-radius: 999px;
  font-size: 11px; font-weight: 600; min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
#cart-btn .count:empty { display: none; }

/* --- hero (landing) -------------------------------------------------------- */
.hero { padding: 96px 0 72px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 8%, rgba(212, 175, 55, .07), transparent 70%),
    radial-gradient(ellipse 70% 55% at 50% 30%, rgba(108, 74, 182, .12), transparent 70%);
}
.hero .kicker {
  color: var(--gold); font-size: 13px; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(44px, 7vw, 84px); line-height: 1.04; letter-spacing: -.01em;
  margin-bottom: 26px;
}
.hero h1 em {
  font-style: normal;
  background: var(--holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede {
  color: var(--muted); font-size: 19px; max-width: 560px; margin: 0 auto 40px;
}
.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 13px 32px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent; transition: all .15s;
}
.btn-gold { background: var(--gold); color: #0A0A0C; }
.btn-gold:hover { background: var(--gold-hi); color: #0A0A0C; box-shadow: 0 0 32px rgba(212, 175, 55, .25); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.crumb { display: inline-block; color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.crumb:hover { color: var(--gold-hi); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  a.card:hover { transform: none; }
}

/* --- trust band ------------------------------------------------------------ */
.trust {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.trust .wrap {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 26px 0;
}
.trust div { text-align: center; font-size: 14px; color: var(--muted); }
.trust b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* --- sections / product grid ------------------------------------------------ */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { font-family: var(--serif); font-size: 32px; font-weight: 600; }
.section-head a { font-size: 14px; color: var(--muted); }
.section-head a:hover { color: var(--gold-hi); }

.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: 14px;
  overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s;
  display: flex; flex-direction: column; color: var(--ink);
}
a.card:hover {
  transform: translateY(-4px); border-color: var(--gold); color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.card .ph {
  aspect-ratio: 3 / 4; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .ph .noimg { font-family: var(--serif); font-size: 40px; opacity: .18; }
/* Placeholder before photos are uploaded: the magpie mark, quiet and centered. */
.ph img.noimg-mark, .main-img img.noimg-mark {
  width: 38% !important; height: auto !important; object-fit: contain;
  opacity: .22; filter: saturate(.6);
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.card .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.card .price {
  margin-top: auto; padding-top: 8px;
  color: var(--gold); font-weight: 600; font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  border-radius: 5px; padding: 2px 7px; text-transform: uppercase;
}
.badge-grade { background: rgba(212, 175, 55, .14); color: var(--gold-hi); }
.badge-cond { background: rgba(155, 123, 212, .16); color: var(--royal); }
.badge-order { background: var(--surface-2); color: var(--muted); }
.badge-sold { background: rgba(224, 86, 74, .14); color: var(--danger); }

/* Sold-out cards stay visible but step back: greyed art, muted price, badge. */
.card.sold .ph img, .card.sold .ph .noimg { filter: grayscale(1); opacity: .45; }
.card.sold .price { color: var(--muted); }
a.card.sold:hover { transform: none; border-color: var(--line); box-shadow: none; }
.card .ph { position: relative; }
.so-badge {
  position: absolute; inset: auto 0 0 0; text-align: center;
  background: rgba(11, 9, 18, .78); backdrop-filter: blur(3px);
  color: var(--ink); font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; padding: 9px 0;
  border-top: 1px solid var(--line);
}
.pd .price.sold { color: var(--muted); }

/* --- shop filters ----------------------------------------------------------- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 36px; padding: 44px 0 72px; }
.filters { display: flex; flex-direction: column; gap: 20px; align-self: start; position: sticky; top: 92px; }
.filters h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.filters label { display: block; font-size: 14px; color: var(--ink); padding: 3px 0; cursor: pointer; }
.filters input[type="radio"], .filters input[type="checkbox"] { accent-color: var(--gold); margin-right: 8px; }
select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 9px; padding: 10px 13px; font-size: 14.5px; font-family: var(--sans); width: 100%;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold); }
.empty { color: var(--muted); text-align: center; padding: 80px 0; font-size: 15px; }

/* --- product detail ---------------------------------------------------------- */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; padding: 56px 0 80px; }
.pd .gallery .main-img {
  aspect-ratio: 3 / 4; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.pd .gallery .main-img img { width: 100%; height: 100%; object-fit: contain; }
.pd .thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pd .thumbs img {
  width: 64px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer;
}
.pd .thumbs img.active { border-color: var(--gold); }
.pd h1 { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.15; margin: 10px 0 14px; }
.pd .badges { display: flex; gap: 8px; }
.pd .price { color: var(--gold); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 18px 0 6px; }
.pd .stock { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.pd .desc { color: var(--muted); font-size: 15.5px; margin: 24px 0; white-space: pre-line; }
.pd dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; font-size: 14px; margin: 22px 0; }
.pd dt { color: var(--muted); }
.pd .note {
  font-size: 13.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 15px; margin-top: 18px; background: var(--surface);
}

/* --- cart slide-over --------------------------------------------------------- */
#cart-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); z-index: 61;
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
body.cart-open #cart-overlay { opacity: 1; pointer-events: auto; }
body.cart-open #cart-panel { transform: none; }
#cart-panel .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
#cart-panel .head h3 { font-family: var(--serif); font-size: 20px; }
#cart-panel .close { background: none; border: none; color: var(--muted); font-size: 22px; }
#cart-items { flex: 1; overflow-y: auto; padding: 12px 22px; }
.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img, .cart-item .noimg {
  width: 56px; height: 74px; object-fit: cover; border-radius: 7px;
  background: var(--surface-2); flex-shrink: 0;
}
.cart-item .t { font-size: 14px; font-weight: 500; line-height: 1.3; }
.cart-item .p { color: var(--gold); font-size: 14px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cart-item .qty { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13.5px; }
.cart-item .qty button {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  width: 24px; height: 24px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.cart-item .rm { background: none; border: none; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.cart-item .rm:hover { color: var(--danger); }
#cart-panel .foot { padding: 18px 22px 22px; border-top: 1px solid var(--line); }
#cart-panel .row { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 14px; }
#cart-panel .row b { font-variant-numeric: tabular-nums; }

/* --- checkout ---------------------------------------------------------------- */
.co { display: grid; grid-template-columns: 1fr 380px; gap: 44px; padding: 52px 0 88px; align-items: start; }
.co h1 { font-family: var(--serif); font-size: 34px; margin-bottom: 26px; grid-column: 1 / -1; }
.co form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.co form .full { grid-column: 1 / -1; }
.co label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.co .summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; position: sticky; top: 92px;
}
.co .summary h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 14px; }
.co .summary .li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.co .summary .li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.co .summary .tot {
  display: flex; justify-content: space-between; font-weight: 600; font-size: 16px;
  border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px;
}
.co .summary .tot span:last-child { color: var(--gold); font-variant-numeric: tabular-nums; }
#pay-area { margin-top: 20px; }
#pay-msg { font-size: 13.5px; margin-top: 12px; color: var(--muted); }
#pay-msg.err { color: var(--danger); }

/* --- confirm ------------------------------------------------------------------ */
.confirm { max-width: 620px; margin: 0 auto; padding: 72px 0 96px; text-align: center; }
.confirm .mark-big { font-size: 52px; margin-bottom: 18px; }
.confirm h1 { font-family: var(--serif); font-size: 36px; margin-bottom: 10px; }
.confirm .oid { color: var(--gold); font-weight: 600; letter-spacing: .06em; }
.confirm .box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; margin-top: 32px; text-align: left;
}

/* --- footer ------------------------------------------------------------------- */
footer.site { border-top: 1px solid var(--line); margin-top: auto; }
footer.site .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 12px;
}
footer.site .f-brand { font-family: var(--serif); color: var(--ink); font-size: 15px; }

/* --- responsive ---------------------------------------------------------------- */
@media (max-width: 860px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static; flex-direction: row; flex-wrap: wrap; gap: 14px 28px; }
  .pd { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .co { grid-template-columns: 1fr; }
  .co .summary { position: static; order: -1; }
  .trust .wrap { grid-template-columns: 1fr; gap: 14px; }
  nav.main { gap: 14px; }
}
