:root {
  --bg: #fbf8f4;
  --surface: #ffffff;
  --text: #2f2a26;
  --muted: #6f665e;
  --border: #e7e0d7;
  --accent: #b5506f;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6ec;
  --leaf: #5f7f45;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3, .brand { font-family: Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.2; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(251,248,244,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-size: 1.35rem; color: var(--text); text-decoration: none; }
.cart-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.cart-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 22px; height: 22px; font-size: .8rem; display: inline-grid; place-items: center; padding: 0 6px; }

/* Hero */
.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; max-width: 60ch; }
.notice { margin: 20px 0 8px; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius); font-size: .95rem; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 0 48px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.card img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--border); }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: #e9f0e3; color: var(--leaf); width: fit-content; }
.badge.digital { background: #e6edf6; color: #3f5f86; }
.badge.soldout { background: #f2e3e1; color: var(--danger); }

/* Product page */
.product { display: grid; gap: 24px; padding: 24px 0 48px; }
@media (min-width: 820px) { .product { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.gallery-main img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 64px; height: 64px; flex: none; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 6px; }
.product .price { font-size: 1.4rem; margin: 8px 0 16px; }
.desc { white-space: pre-line; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input, select, textarea { font: inherit; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 520px) { .row-3 { grid-template-columns: 1fr 1fr; } .row-3 > :first-child { grid-column: 1 / -1; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; padding: 14px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 48px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.95); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.qty button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.qty input { width: 44px; text-align: center; border: 0; padding: 0; background: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); font-size: .95rem; z-index: 50; }
.toast a { color: #ffd3df; margin-left: 8px; }

/* Cart */
.cart-layout { display: grid; gap: 24px; padding: 24px 0 48px; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; } }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 1.25rem; }
.line { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line:last-of-type { border-bottom: 0; }
.line img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.line-title { font-weight: 600; margin: 0; }
.line-meta { color: var(--muted); font-size: .85rem; }
.line-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; padding: 6px; }
.totals { display: flex; justify-content: space-between; font-weight: 700; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.small { font-size: .88rem; color: var(--muted); }
.error { color: var(--danger); font-size: .92rem; }
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-group label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-weight: 500; cursor: pointer; background: var(--surface); }
.radio-group input { width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
ol.steps { padding-left: 1.2em; } ol.steps li { margin-bottom: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 36px; color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.order-card { margin-bottom: 14px; }
.order-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.status { font-size: .78rem; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filters button { border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; }
.filters button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
