:root {
  --navy: #122635;
  --navy-2: #1a3448;
  --navy-soft: #243f54;
  --gold: #caa367;
  --gold-dark: #a88245;
  --gold-soft: #e8d4b0;
  --cream: #f6f1e8;
  --cream-2: #efe7d8;
  --card: #fffcf7;
  --ink: #122635;
  --ink-2: #3a4d5c;
  --muted: #6b7a86;
  --line: #e2d8c6;
  --ok: #1a7f4b;
  --danger: #9b3a2f;
  --radius: 12px;
  --shadow: 0 10px 32px rgba(18, 38, 53, 0.1);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; }
button, input, select { font: inherit; }
img, svg { display: block; max-width: 100%; }

.demo-strip {
  background: var(--navy);
  color: #f5f0e6;
  font-size: 0.82rem;
  padding: 0.65rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.demo-strip strong { color: var(--gold); }
.demo-strip-back {
  color: #b8c4ce;
  text-decoration: none;
  margin-left: 0.5rem;
}
.demo-strip-back:hover { color: #fff; }

.demo-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f5ebcf;
  color: #6b5200;
  border: 1px solid #e2c98a;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  vertical-align: middle;
}

.store-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(18, 38, 53, 0.12);
}
.logo-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.logo-tag {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.header-nav > a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.header-nav > a:hover { color: var(--gold-dark); }
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}
.cart-btn:hover { background: var(--navy-2); }
.cart-count {
  background: var(--gold);
  color: var(--navy);
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

#app { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }

.hero {
  background:
    radial-gradient(ellipse at 85% 20%, rgba(202, 163, 103, 0.22), transparent 45%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, #2a4a60 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.85rem 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.4fr auto;
    align-items: center;
  }
}
.hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
  letter-spacing: -0.03em;
}
.hero p { margin: 0; color: rgba(255,255,255,.82); max-width: 36rem; font-size: 0.95rem; }
.hero-badge {
  display: inline-block;
  margin-top: 0.9rem;
  background: rgba(202,163,103,.18);
  border: 1px solid rgba(202,163,103,.45);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.hero-logo {
  order: -1;
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  justify-self: center;
}
@media (min-width: 720px) {
  .hero-logo { order: 0; width: 260px; justify-self: end; }
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.results-meta h2 { margin: 0; font-size: 1.05rem; font-family: var(--display); }
.results-meta span { color: var(--muted); font-size: 0.85rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-art {
  background: linear-gradient(180deg, #f3ecdf, #e8dfcf);
  aspect-ratio: 1.15 / 1;
  display: grid;
  place-items: center;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.cond-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  color: var(--navy);
  z-index: 2;
}
.stock-tag {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: var(--navy);
  color: var(--gold);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  z-index: 2;
}
.card-body { padding: 0.95rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-brand { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card-name { font-weight: 650; font-size: 1rem; margin: 0; letter-spacing: -0.01em; }
.card-name a { text-decoration: none; color: inherit; }
.card-name a:hover { color: var(--gold-dark); }
.card-meta { color: var(--ink-2); font-size: 0.88rem; }
.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.55rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.price { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.price small { font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-left: 0.2rem; }
.add-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.add-btn:hover { background: var(--navy-2); }
.add-btn:disabled { opacity: .45; cursor: not-allowed; }
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Photo placeholder — elegant card; swap via PRODUCT_PHOTOS array in store.js */
.photo-slot {
  width: 82%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1.5px dashed rgba(18, 38, 53, 0.28);
  background:
    linear-gradient(145deg, rgba(255,252,247,.95), rgba(232,212,176,.35));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  padding: 1rem;
  color: var(--navy-soft);
  box-shadow: inset 0 0 0 6px rgba(255,252,247,.55);
}
.photo-slot .photo-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(18, 38, 53, 0.08);
  display: grid;
  place-items: center;
  color: var(--gold-dark);
}
.photo-slot strong {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--navy);
}
.photo-slot span {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 12rem;
  line-height: 1.35;
}
.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.photo-slot.has-photo {
  border-style: solid;
  border-color: var(--line);
  padding: 0;
  box-shadow: none;
  background: #ddd;
}

/* Cart drawer */
.cart-scrim {
  position: fixed; inset: 0;
  background: rgba(18,38,53,.4);
  z-index: 50;
}
.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  background: var(--card);
  z-index: 60;
  transform: translateX(100%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(18,38,53,.16);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head, .cart-drawer-foot {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cart-drawer-head h2 { margin: 0; font-size: 1.05rem; font-family: var(--display); }
.cart-drawer-foot { border-bottom: none; border-top: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0.65rem; }
.cart-drawer-body { flex: 1; overflow: auto; padding: 0.75rem 1.1rem; }
.icon-btn {
  border: none; background: transparent; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 0.2rem 0.4rem;
}
.icon-btn:hover { color: var(--ink); }
.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: none; }
.cart-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--cream-2); display: grid; place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
}
.cart-thumb .photo-slot {
  width: 100%;
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  border: none;
  padding: 0.25rem;
  box-shadow: none;
  gap: 0;
}
.cart-thumb .photo-slot strong,
.cart-thumb .photo-slot span,
.cart-thumb .photo-slot .photo-icon { display: none; }
.cart-thumb .photo-slot::after {
  content: "Photo";
  font-size: 0.58rem;
  color: var(--muted);
  font-weight: 600;
}
.cart-line h3 { margin: 0; font-size: 0.9rem; }
.cart-line p { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--muted); }
.qty-row { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.4rem; }
.qty-row button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; color: var(--navy);
}
.qty-row button:hover { background: var(--cream-2); }
.qty-row button:disabled { opacity: .4; cursor: not-allowed; }
.cart-line-price { font-weight: 650; font-size: 0.95rem; text-align: right; }
.remove-link {
  border: none; background: none; color: var(--muted); font-size: 0.75rem;
  cursor: pointer; text-decoration: underline; padding: 0; margin-top: 0.25rem;
}
.cart-empty { text-align: center; color: var(--muted); padding: 2rem 0.5rem; }
.cart-total-row {
  display: flex; justify-content: space-between; font-weight: 700; font-size: 1.05rem;
}
.primary-btn, .secondary-btn {
  display: inline-flex; justify-content: center; align-items: center;
  border-radius: 10px; padding: 0.75rem 1rem; font-weight: 650; cursor: pointer;
  text-decoration: none; border: none; width: 100%;
}
.primary-btn { background: var(--navy); color: #fff; }
.primary-btn:hover { background: var(--navy-2); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.secondary-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.secondary-btn:hover { background: var(--cream-2); }

/* Checkout */
.checkout {
  max-width: 640px;
  margin: 0 auto;
}
.checkout h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  font-family: var(--display);
}
.checkout-sub { color: var(--muted); margin: 0 0 1.1rem; font-size: 0.9rem; }
.steps {
  display: flex; gap: 0.5rem; margin-bottom: 1.1rem; flex-wrap: wrap;
}
.step-pill {
  font-size: 0.78rem; font-weight: 600;
  padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--cream-2); color: var(--muted);
}
.step-pill.on { background: var(--navy); color: #fff; }
.step-pill.done { background: #d9f0e4; color: var(--ok); }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}
.panel h2 { margin: 0 0 0.85rem; font-size: 1.05rem; font-family: var(--display); }
.field { margin-bottom: 0.85rem; }
.field label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--ink-2); margin-bottom: 0.3rem;
}
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: 2px solid rgba(202,163,103,.35);
  border-color: var(--gold);
}
.field-row { display: grid; gap: 0.75rem; }
@media (min-width: 560px) {
  .field-row.two { grid-template-columns: 1fr 1fr; }
  .field-row.three { grid-template-columns: 1.4fr 0.8fr 0.8fr; }
}
.radio-group { display: grid; gap: 0.5rem; }
.radio-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex; gap: 0.65rem; align-items: flex-start;
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: var(--gold);
  background: #faf4e8;
}
.radio-card strong { display: block; font-size: 0.92rem; }
.radio-card span { display: block; font-size: 0.8rem; color: var(--muted); }
.test-banner {
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #6b5200;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.test-banner code {
  background: #fff;
  border: 1px solid #ecd89a;
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  font-size: 0.8rem;
}
.pay-key {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
  word-break: break-all;
}
.order-summary { font-size: 0.9rem; }
.order-summary .line {
  display: flex; justify-content: space-between;
  padding: 0.35rem 0;
}
.order-summary .total {
  border-top: 1px solid var(--line);
  margin-top: 0.4rem;
  padding-top: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
}
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.actions .primary-btn, .actions .secondary-btn { width: auto; min-width: 140px; }
.err {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
.confirm {
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.confirm-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: #d9f0e4; color: var(--ok);
  display: grid; place-items: center;
  font-size: 1.8rem; margin: 0 auto 1rem;
}
.confirm h1 { margin-bottom: 0.4rem; }
.confirm p { color: var(--muted); max-width: 28rem; margin: 0 auto 0.5rem; }
.confirm-box {
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin: 1.25rem auto;
  max-width: 360px;
  font-size: 0.9rem;
}

.store-footer {
  border-top: 1px solid var(--line);
  background: var(--navy);
  color: #c8d2da;
  padding: 1.75rem 1.25rem;
  margin-top: 1rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  font-size: 0.8rem;
  text-align: center;
}
.footer-logo {
  margin: 0 auto 0.85rem;
  height: 48px;
  width: auto;
  border-radius: 6px;
  background: rgba(255,255,255,.06);
}
.footer-inner p { margin: 0.3rem 0; }
.footer-inner a { color: var(--gold); }
.footer-inner strong { color: #fff; }
.store-footer .demo-pill {
  background: rgba(202,163,103,.15);
  color: var(--gold);
  border-color: rgba(202,163,103,.4);
}

body.cart-open { overflow: hidden; }

/* Product detail */
.product-page { max-width: 960px; margin: 0 auto; }
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.back-link:hover { color: var(--gold-dark); }
.product-layout {
  display: grid;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 720px) {
  .product-layout { grid-template-columns: 1fr 1.15fr; }
}
.product-art {
  background: linear-gradient(180deg, #f3ecdf, #e8dfcf);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  position: relative;
  min-height: 260px;
}
.product-art .photo-slot { width: 78%; }
.product-info { padding: 1.25rem 1.35rem 1.5rem; }
.product-info h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
  font-family: var(--display);
}
.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.product-price-row .add-btn { padding: 0.7rem 1.15rem; font-size: 0.95rem; }
.qty-picker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.qty-picker label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
}
.qty-picker select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  min-width: 4.5rem;
}
.stock-note {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--danger);
}
.product-desc {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.product-desc p { margin: 0 0 0.75rem; }
.product-desc ul {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.15rem;
}
.product-desc li { margin: 0.25rem 0; }
.specs {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
}
.specs h3 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.specs dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.85rem;
  font-size: 0.88rem;
}
.specs dt { color: var(--muted); font-weight: 500; }
.specs dd { margin: 0; color: var(--ink); font-weight: 600; }
.policy-box {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.policy-box h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-family: var(--display);
  color: var(--navy);
}
.policy-box p { margin: 0 0 0.55rem; }
.product-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Policies page */
.policies-page {
  max-width: 720px;
  margin: 0 auto;
}
.policies-page h1 {
  font-family: var(--display);
  margin: 0 0 0.5rem;
}
.policies-page .panel h2 { margin-top: 0; }
.policies-page p { color: var(--ink-2); font-size: 0.95rem; }

@media (max-width: 560px) {
  .header-nav > a:not(.cart-btn) { display: none; }
  .logo-tag { display: none; }
}
