/* Aurora Goods — storefront + admin styles. Plain CSS, no build step. */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #191b1a;
  --muted: #6f6d67;
  --line: #e5e1d9;
  --accent: #2f4f3f;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0ea;
  --warn: #b45309;
  --bad: #b3261e;
  --ok: #1f7a4d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(25, 27, 26, 0.04), 0 8px 24px -12px rgba(25, 27, 26, 0.12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem); line-height: 1.1; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

code {
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.9em;
}

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.main { padding: 32px 0 80px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  background: var(--ink);
  color: #f2efe9;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 8px 16px;
}

.site-header {
  background: rgba(247, 245, 241, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; font-size: 0.95rem; font-family: var(--serif);
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--muted);
}
.main-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }

.cart-link { position: relative; }
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  margin-left: 6px; padding: 0 5px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-size: 0.7rem; font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
  background: var(--bg);
}
.footer-inner { display: grid; gap: 14px; }
.footer-inner .muted { margin: 4px 0 0; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* -------------------------------------------------------------------- hero */

.hero { padding: 56px 0 48px; max-width: 720px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero h1 { margin-bottom: 12px; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 54ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; border-color: #cfc9bd; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #274235; border-color: #274235; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--bad); }

/* ------------------------------------------------------------------- cards */

.section { padding-top: 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); border-color: #d8d2c6; }
.card-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #efeae1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-size: 1rem; }
.card-sub { margin: 0; font-size: 0.82rem; color: var(--muted); flex: 1; }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.price.big { font-size: 1.5rem; }
.price-was { color: var(--muted); text-decoration: line-through; font-size: 0.85rem; }

.badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.badge.inline { position: static; display: inline-block; margin-bottom: 10px; background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- product */

.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; display: flex; gap: 8px; }

.product-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: start;
}
.product-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #efeae1;
  position: sticky;
  top: 88px;
}
.product-info h1 { margin-bottom: 8px; }
.product-info .card-price { margin-bottom: 16px; }
.prose { color: #3a3a37; }

.buy-form { display: flex; align-items: flex-end; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.qty-label { display: grid; gap: 6px; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.qty-label input {
  width: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
}

.trust { list-style: none; padding: 18px 0 0; margin: 0; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); display: grid; gap: 6px; }
.trust li::before { content: "·"; margin-right: 8px; }

/* ------------------------------------------------------------------- cart */

.page-title { margin-bottom: 24px; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }

.cart-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.cart-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.cart-table tbody tr:last-child td { border-bottom: 0; }
.cart-table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); }
.cart-table .total-row td { color: var(--ink); font-weight: 600; font-size: 1rem; }

.cell-product { display: flex; gap: 12px; align-items: center; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #efeae1; flex: none; }
.thumb.sm { width: 40px; height: 40px; }
.cell-total, .cell-qty { white-space: nowrap; }
.qty-input { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cell-remove { text-align: right; }

.inline-form { display: flex; gap: 8px; align-items: center; }

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 88px;
}
.summary h2 { font-size: 1.05rem; margin-bottom: 14px; }
.summary dl { margin: 0 0 18px; display: grid; gap: 8px; }
.summary dl > div { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); }
.summary dl > div.total { border-top: 1px solid var(--line); padding-top: 10px; color: var(--ink); font-weight: 600; font-size: 1rem; }
.summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary dt { margin: 0; }

.mini-lines { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: 0.86rem; }
.mini-lines li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }

/* --------------------------------------------------------------- checkout */

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.checkout-main { display: grid; gap: 18px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1rem; margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 0.84rem; }
.field > span { color: var(--muted); }
.field input, .field select, .field textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fdfcfa;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, select:focus {
  outline: 2px solid rgba(47, 79, 63, 0.25);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field.span-2 { grid-column: 1 / -1; }
.field.checkbox { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.field.checkbox input { width: auto; }

.pay-options { display: grid; gap: 10px; }
.pay-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-option:hover { border-color: #cfc9bd; }
.pay-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-option.is-disabled { opacity: 0.55; cursor: not-allowed; }
.pay-option input { margin-top: 3px; accent-color: var(--accent); }
.pay-body { display: grid; gap: 2px; }
.pay-label { font-weight: 600; font-size: 0.94rem; }
.pay-desc { font-size: 0.82rem; color: var(--muted); }

/* ------------------------------------------------------------ sandbox pay */

.pay-sandbox { max-width: 520px; margin: 24px auto; }
.sandbox-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 24px 0; }
.sandbox-card dl { display: grid; gap: 10px; margin: 0 0 20px; }
.sandbox-card dl > div { display: flex; justify-content: space-between; font-size: 0.92rem; }
.sandbox-card dt { color: var(--muted); }
.sandbox-card dd { margin: 0; }
.sandbox-actions { margin-bottom: 14px; }

/* --------------------------------------------------------------- order ok */

.confirm { max-width: 860px; margin: 0 auto; }
.check {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.check.is-bad { background: #fdecea; color: var(--bad); }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
.confirm-grid .panel + .panel { margin-top: 0; }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.address { line-height: 1.7; margin: 0; }

.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #eeece6;
  color: var(--muted);
}
.status-paid { background: #e6f4ec; color: var(--ok); }
.status-pending { background: #fdf1e0; color: var(--warn); }
.status-failed { background: #fdecea; color: var(--bad); }
.status-shipped, .status-completed { background: #e8eef8; color: #2b4d8f; }
.status-refunded { background: #f0e9f8; color: #6b3fa0; }

/* ------------------------------------------------------------------ misc */

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error { background: #fdecea; border-color: #f5c6c2; color: #8c1d18; }
.alert-ok { background: #e6f4ec; border-color: #bfe0cd; color: #15603c; }
.alert-warn { background: #fdf1e0; border-color: #f3ddbb; color: #8a4b06; }

.empty { text-align: center; padding: 70px 20px; }
.empty .btn { margin-top: 12px; }

.lookup-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; max-width: 720px; margin-bottom: 30px; }

.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.84rem; color: var(--muted); background: var(--surface); }
.chip:hover { text-decoration: none; color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ admin */

body.is-admin { background: #f4f2ee; }
body.is-admin .main { padding-top: 28px; }

.admin-login { max-width: 380px; margin: 60px auto; }
.admin-login .panel { margin-top: 20px; display: grid; gap: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.stat-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 1.5rem; }
.stat-hint { font-size: 0.8rem; color: var(--muted); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.9rem; vertical-align: middle; }
.admin-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .cell-actions { display: flex; gap: 12px; align-items: center; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.form-wide { max-width: 900px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.kv { display: grid; gap: 8px; margin: 0 0 16px; font-size: 0.9rem; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; word-break: break-all; }

.checklist { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 8px; font-size: 0.9rem; }

.gateway { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; background: #fdfcfa; }
.gateway-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch-label { font-weight: 600; }
.gateway .form-grid { margin-top: 12px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .product-page, .checkout-layout, .cart-layout, .confirm-grid, .two-col { grid-template-columns: 1fr; }
  .product-media, .summary { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .lookup-form { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 28px; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .cart-table td { border: 0; padding: 6px 14px; }
  .cell-remove { text-align: left; }
}
