/* Koto Riyo Shop — global styles
   Theme: cream + pastel palette. Nav stays dark for contrast.

   Palette (user-supplied):
     Main:   #F0EDE4 cream · #2B2B2B black · #E8DCC4 warm-beige · #F5C7D0 pastel-pink
     Accent: #A4B16A olive · #F0D5DC soft-pink · #C9E2D0 mint · #828282 gray
*/

:root {
  --bg:           #F0EDE4;
  --surface:      #FFFFFF;
  --surface-2:    #E8DCC4;
  --line:         #D9CFB8;
  --text:         #2B2B2B;
  --text-dim:     #828282;
  --nav-bg:       #2B2B2B;
  --nav-text:     #F0EDE4;
  --accent:       #F5C7D0;
  --accent-soft:  #F0D5DC;
  --accent-2:     #A4B16A;
  --mint:         #C9E2D0;
  --error:        #C0392B;
  --success:      #A4B16A;
  --warning:      #D4A017;
  --beige:        #E8DCC4;
  --pink:         #F5C7D0;
  --olive:        #A4B16A;
  --gray:         #828282;
  --max:          1200px;
  --gap:          16px;
  --radius:       6px;
}

* { box-sizing: border-box; }
html { color-scheme: light only; }
html, body { margin: 0; padding: 0; }
body { overflow-x: hidden; max-width: 100vw; }
@media (prefers-color-scheme: dark) {
  html { background: #F0EDE4; color: #2B2B2B; }
  body { background: #F0EDE4; color: #2B2B2B; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans Thai", "Sarabun", -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ─── Top nav ──────────────────────────────────────────────── */

.nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__brand {
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 18px;
  color: var(--nav-text);
}
.nav__brand:hover { color: var(--accent); }
.nav__links {
  display: flex;
  gap: 28px;
  flex: 1;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--nav-text);
}
.nav__links a:hover { color: var(--accent); }
.nav__cart {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--nav-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav__cart:hover { color: var(--accent); }
.nav__cart-badge {
  background: var(--accent);
  color: var(--text);
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  min-width: 18px;
  text-align: center;
}
.nav__cart-badge[data-count="0"] { display: none; }
@media (max-width: 700px) {
  .nav__inner { padding: 0 10px; gap: 8px; height: 52px; }
  .nav__brand { font-size: 12px; white-space: nowrap; }
  .nav__links { gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a { font-size: 10px; letter-spacing: 0.03em; white-space: nowrap; }
  .nav__cart { font-size: 10px; }
}

/* ─── Layout ───────────────────────────────────────────────── */

main { flex: 1; }
.container { max-width: var(--max); margin: 0 auto; padding: 32px 24px; }
.section { margin-bottom: 48px; }
.section__title {
  background: transparent;
  color: var(--text);
  display: inline-block;
  padding: 4px 0 8px;
  font-size: 14px;
  letter-spacing: 0.12em;
  border-bottom: 2px solid var(--accent-2);
}
.section__title--center {
  display: block;
  text-align: center;
  margin: 0 auto 16px;
  width: fit-content;
}

/* ─── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--bg); color: var(--text); }
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--accent-2);
}
.btn--outline:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bg); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
}
.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--bg);
}
.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 12px; }

/* ─── Home — hero ──────────────────────────────────────────── */

.hero {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2.133%;
  display: flex;
  gap: 2.133%;
  align-items: center;
  margin-bottom: 32px;
  border-radius: var(--radius);
  aspect-ratio: 3 / 1;
  box-sizing: border-box;
  overflow: hidden;
}
.hero__img {
  width: 16.867%;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1.35%;
}
.hero__img img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: calc(var(--radius) - 1px); display: block; }
.hero__body { flex: 1; min-width: 0; }
.hero__body h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: 0.05em; }
.hero__body p  { margin: 0; color: var(--text-dim); max-width: 480px; }

.hero.has-banner .hero__body h1,
.hero.has-banner .hero__body p,
.hero.has-banner .btn {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.hero.has-banner .btn {
  border-color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.18);
}
.hero.has-banner .btn:hover { background: rgba(0,0,0,0.35); }

.info-header.has-banner h1,
.info-header.has-banner p,
.info-header.has-banner .muted,
.info-header.has-banner h4 {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.info-header.has-banner .info-header__socials a {
  background: rgba(0,0,0,0.3);
  color: #fff;
}
.info-header.has-banner .info-header__socials a:hover { background: rgba(0,0,0,0.5); }


/* ─── Now collection block ─────────────────────────────────── */

.now-collection {
  background: var(--surface-2);
  border: 1px solid var(--line);
  aspect-ratio: 3 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.now-collection a { position: absolute; inset: 0; }
.now-collection__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ─── Old merch grid ───────────────────────────────────────── */

.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
  gap: 12px;
  justify-content: center;
}
@media (max-width: 540px) { .merch-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 160px)); } }

.merch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
}
.merch-card:hover { border-color: var(--accent-2); }
.merch-card img { width: 100%; height: 100%; object-fit: cover; }
.merch-card__label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: var(--bg);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 3px;
}

/* ─── Events grid ─────────────────────────────────────────── */

.events-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.event-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
a.event-card:hover { border-color: var(--accent-2); }
.event-card img { width: 100%; display: block; object-fit: cover; }

/* ─── Footer ──────────────────────────────────────────────── */

.footer {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 32px 24px;
  margin-top: 48px;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 24px;
}
.footer__brand h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: 0.1em; color: var(--nav-text); }
.footer__brand p  { margin: 0; font-size: 11px; color: var(--beige); line-height: 1.6; opacity: 0.7; }
.footer__col h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.12em; color: var(--nav-text); }
.footer__col a, .footer__col span {
  display: block;
  font-size: 12px;
  color: var(--beige);
  opacity: 0.8;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}
.footer__col a:hover { color: var(--accent); opacity: 1; }
@media (max-width: 700px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: span 2; }
}

/* ─── Shop / Collection ────────────────────────────────────── */

.shop-banner {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: block;
}

.col-banner {
  width: 100%;
  aspect-ratio: 3 / 1;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
@media (max-width: 700px) { .col-banner { aspect-ratio: 2 / 1; } }

.collection-header {
  text-align: center;
  margin-bottom: 32px;
}
.collection-header h1 {
  font-size: 36px;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
}
.collection-header p { color: var(--text-dim); margin: 0; }

.shop-item {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}
.shop-item--full {
  grid-template-columns: 200px 1fr 200px;
  border-color: var(--accent-2);
  background: #fff;
}
.shop-item__img {
  aspect-ratio: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 4px;
}
.shop-item__img img { width: 100%; height: 100%; object-fit: cover; }
.shop-item__body h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: 0.05em; }
.shop-item__body p  { margin: 0; color: var(--text-dim); font-size: 14px; white-space: pre-wrap; }
.shop-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.shop-item__price { font-size: 24px; font-weight: 700; color: var(--text); }
.shop-item__thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.shop-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.55; border: 2px solid transparent; transition: opacity 0.15s; }
.shop-thumb.active, .shop-thumb:hover { opacity: 1; border-color: var(--accent); }
.shop-option-select { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; letter-spacing: 0.04em; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.qty button {
  background: var(--bg);
  color: var(--text);
  border: 0;
  width: 32px;
  height: 32px;
  font-size: 16px;
}
.qty button:hover { background: var(--accent); }
.qty input {
  width: 40px;
  height: 32px;
  background: var(--bg);
  color: var(--text);
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
}
@media (max-width: 700px) {
  .shop-item, .shop-item--full {
    grid-template-columns: 1fr;
  }
  .shop-item__side { align-items: flex-start; }
}

/* ─── Checkout (cream + pastel pink theme) ────────────────── */

body.checkout { background: var(--bg); }
body.checkout .container { padding: 32px 24px; }
.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.card-purple {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
}
.card-purple h2 {
  margin: 0 0 20px;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.card-purple h2 .step { color: var(--accent-2); margin-right: 8px; font-weight: 700; }
.field {
  display: block;
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field label .req { color: var(--error); }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
  font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: -1px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pay-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.pay-tabs button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.pay-tabs button:hover { background: var(--accent-soft); }
.pay-tabs button.active {
  background: var(--accent);
  border-color: var(--accent-2);
  color: var(--text);
  font-weight: 600;
}
.pay-panel { padding-top: 8px; }
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qr-block img {
  width: 200px;
  height: 200px;
  background: var(--surface);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.bank-info { font-family: ui-monospace, "Cascadia Mono", monospace; line-height: 1.8; text-align: center; }

.summary { position: sticky; top: 80px; background: var(--accent-soft); }
.summary h2 { margin: 0 0 16px; font-size: 14px; letter-spacing: 0.12em; color: var(--text-dim); }
.summary__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.summary__item img,
.summary__item .ph {
  width: 48px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dim);
}
.summary__item-info { flex: 1; }
.summary__item-info strong { display: block; font-size: 13px; }
.summary__item-info small  { color: var(--text-dim); font-size: 11px; }
.summary__item-price { font-size: 14px; font-weight: 600; }
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.qty-ctrl button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-ctrl button:hover { border-color: var(--accent-2); }
.qty-ctrl span { font-size: 13px; min-width: 20px; text-align: center; }

.summary__row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.summary__row--total {
  font-size: 16px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}
.discount-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 16px;
}
.discount-input input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
}
.discount-input button {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--bg);
  padding: 0 16px;
  border-radius: 4px;
  font-size: 13px;
}
.discount-input button:hover { background: var(--accent-2); border-color: var(--accent-2); }
.discount-msg {
  font-size: 12px;
  margin-top: -8px;
  margin-bottom: 12px;
  min-height: 16px;
}
.discount-msg.ok    { color: var(--accent-2); }
.discount-msg.error { color: var(--error); }

.policy-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  transition: border-color 0.15s;
}
.policy-agree input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.policy-agree:has(input:checked) {
  border-color: var(--accent);
}
.policy-agree a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn--primary.btn--confirmed {
  background: var(--nav-bg);
  border-color: var(--nav-bg);
  color: var(--nav-text);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}
.btn--primary.btn--confirmed:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--bg);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.secure-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
}

/* ─── All merch archive ───────────────────────────────────── */

.collection-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  border-radius: var(--radius);
}
.collection-block__top {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: stretch;
  min-height: 260px;
}
.collection-block__setpng {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  aspect-ratio: 1;
}
.collection-block__setpng img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.collection-block__info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 0 12px 12px;
}
.collection-block__info h2 { margin: 0; font-size: 28px; letter-spacing: 0.1em; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.collection-block__toggle-wrap {
  display: flex;
  justify-content: flex-end;
}
.collection-block__items {
  margin-top: 24px;
  display: none;
}
.collection-block__items.open { display: block; }
.collection-block__items-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .collection-block__items-grid { grid-template-columns: repeat(3, 1fr); } }
.collection-block__items-grid figure { margin: 0; }
.collection-block__items-grid img,
.collection-block__items-grid .ph {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  display: block;
  border-radius: 4px;
}
.collection-block__items-grid figcaption {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-top: 8px;
  color: var(--text);
}
@media (max-width: 700px) {
  .collection-block__top { grid-template-columns: 1fr; }
  .collection-block__setpng { aspect-ratio: 1; }
}

/* ─── Info page ───────────────────────────────────────────── */

.info-header {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2.133%;
  display: flex;
  gap: 2.133%;
  align-items: flex-start;
  margin-bottom: 24px;
  border-radius: var(--radius);
  aspect-ratio: 3 / 1;
  box-sizing: border-box;
  overflow: hidden;
}
.info-header__body { flex: 1; min-width: 0; padding-top: 6%; }
@media (max-width: 700px) {
  .hero__body h1 { font-size: clamp(14px, 4.5vw, 32px); }
  .hero__body p  { font-size: 11px; line-height: 1.4; }
  .hero .btn     { padding: 6px 10px; font-size: 11px; }
  .tabs { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { display: inline-flex; padding: 8px 10px; font-size: 11px; letter-spacing: 0.06em; white-space: nowrap; border-bottom-width: 2px; }
}
.info-header__avatar {
  width: 16.867%;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1.35%;
  align-self: center;
}
.info-header__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: calc(var(--radius) - 1px); display: block; }
.info-header__body h1 { margin: 0 0 16px; font-size: 32px; letter-spacing: 0.1em; }
.info-header__socials { display: flex; gap: 12px; margin-bottom: 16px; }
.info-header__socials a {
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  border-radius: 999px;
}
.info-header__socials a:hover { background: var(--accent); }
@media (max-width: 700px) {
  .info-header__body h1 { font-size: clamp(12px, 4vw, 32px); margin-bottom: 8px; }
  .info-header__socials { gap: 6px; margin-bottom: 8px; }
  .info-header__socials a { width: clamp(20px, 6vw, 40px); height: clamp(20px, 6vw, 40px); font-size: clamp(8px, 2vw, 14px); }
  .tab-panel { padding: 16px; min-height: 160px; }
  .tab-panel p, .tab-panel .muted { word-break: break-word; overflow-wrap: break-word; }
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.1em;
  border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent-2);
  font-weight: 600;
}
.tab-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px;
  min-height: 320px;
  display: none;
  border-radius: var(--radius);
}
.tab-panel.active { display: block; }

/* ─── Modal ──────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 43, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal.open { display: flex; }
.modal__inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text);
}
.modal__close {
  float: right;
  background: transparent;
  color: var(--text-dim);
  border: 0;
  font-size: 20px;
}
.modal__close:hover { color: var(--text); }

/* ─── Fanart ─────────────────────────────────────────────── */

.fanart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.fanart-grid--multi {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.fanart-grid--4col {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 700px) { .fanart-grid--4col { grid-template-columns: repeat(2, 1fr); } }
.fanart-grid--multi .fanart-card {
  background: var(--surface);
  border: 1px solid var(--line);
}
.fanart-grid--multi .fanart-card img {
  aspect-ratio: 1;
  object-fit: cover;
}
.fanart-card {
  border-radius: var(--radius);
  overflow: hidden;
}
.fanart-card img {
  width: 100%;
  display: block;
  flex-shrink: 0;
}
.fanart-card__artist {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.fanart-card__artist span { color: var(--text); }
.fanart-card__artist a { color: var(--accent-2); }
.fanart-card__artist a:hover { text-decoration: underline; }

/* ─── Drawer ────────────────────────────────────────────── */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.drawer.open { pointer-events: all; }
.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer.open .drawer__overlay { opacity: 1; }
.drawer__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 40px 28px 40px 32px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.drawer.open .drawer__panel { transform: translateX(0); }
.drawer__close {
  float: right;
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  margin: -8px -8px 0 0;
}
.drawer__close:hover { color: var(--text); }

/* ─── Cart Drawer ────────────────────────────────────────── */
.cart-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-drawer-item__info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-drawer-item__controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cart-qty-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); background: var(--bg);
  border-radius: 4px; cursor: pointer; font-size: 14px; display: flex;
  align-items: center; justify-content: center; color: var(--text);
}
.cart-qty-btn:hover { background: var(--surface-2); }
.cart-qty-num { min-width: 28px; text-align: center; font-size: 14px; }
.cart-drawer__footer { border-top: 1px solid var(--line); padding-top: 16px; margin-top: auto; }

/* ─── Lightbox ───────────────────────────────────────────── */

.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lb-overlay.open { display: flex; }
.lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}
.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.lb-close:hover { opacity: 1; }
[data-lightbox] { cursor: zoom-in; }

/* ─── Admin ──────────────────────────────────────────────── */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}
.admin-table th {
  background: var(--surface-2);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: var(--surface-2);
  color: var(--text);
}
.status-badge.pending   { background: #FCEABA; color: #876200; }
.status-badge.paid      { background: var(--mint); color: #2E5A3C; }
.status-badge.confirmed { background: var(--accent-2); color: var(--bg); }
.status-badge.shipped   { background: var(--accent); color: var(--text); }
.status-badge.cancelled { background: #F0D5D5; color: #8B2A2A; }

.admin-tabs { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tabs button {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  border-radius: 4px;
}
.admin-tabs button:hover { color: var(--text); }
.admin-tabs button.active {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent-2);
  font-weight: 600;
}

/* ─── Toggle Switch ─────────────────────────────────────── */

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--line); border-radius: 22px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-2); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── Utility ────────────────────────────────────────────── */

.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.muted { color: var(--text-dim); }
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  z-index: 200;
  box-shadow: 0 4px 16px rgba(43, 43, 43, 0.15);
  animation: toast-in 0.2s ease-out;
}
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--accent-2); }
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
