@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

:root {
  --bg: #f0f2f8;
  --bg-elevated: #fafbff;
  --ink: #12141c;
  --ink-soft: #5c6378;
  --line: #d8dce8;
  --accent: #4f46b8;
  --accent-dark: #1e1b4b;
  --sale: #dc2626;
  --wrap: min(1280px, 92vw);
  --serif: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.wrap { width: var(--wrap); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240, 242, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  justify-self: start;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.main-nav {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 0.9rem;
}

.main-nav a {
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active { color: var(--ink); }

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

.bag-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  transition: all 0.25s var(--ease);
}

.bag-link:hover {
  background: var(--ink);
  color: var(--bg);
}

.cart-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sale);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-badge[hidden] { display: none !important; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin-top: 24px;
  max-width: 420px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 300;
}

.hero-side {
  padding-bottom: 12px;
}

.hero-stat {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
}

.hero-stat div span {
  display: block;
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1;
}

.hero-stat div small {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.hero-cta {
  display: inline-block;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: opacity 0.2s;
}

.hero-cta:hover { opacity: 0.6; }

/* Shop section */
.shop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 0 28px;
}

.shop-head h2 {
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 500;
}

.shop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

#toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  color: var(--ink-soft);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.search-input {
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  min-width: 200px;
  outline: none;
}

.search-input:focus { border-color: var(--ink); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px 20px;
  padding-bottom: 80px;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e8e2d9;
  margin-bottom: 16px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.product-card:hover .card-media img {
  transform: scale(1.04);
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  background: var(--bg-elevated);
  font-size: 0.75rem;
}

.card-cat {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.card-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 6px 0 10px;
  line-height: 1.25;
}

.card-title a:hover { opacity: 0.65; }

.card-price {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.price-now {
  font-size: 1rem;
  font-weight: 500;
}

.price-was {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: line-through;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  background: transparent;
}

.btn-dark {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-dark:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-outline {
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover { border-color: var(--ink); }

.btn-ghost {
  color: var(--ink-soft);
  border: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-lg { padding: 16px 32px; }
.btn-block { width: 100%; }

.product-card .btn { width: 100%; }

/* Detail */
.page-pad { padding: 48px 0 80px; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.breadcrumb a:hover { color: var(--ink); }

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.detail-gallery {
  background: #e8e2d9;
  aspect-ratio: 4 / 5;
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-tag {
  display: inline-block;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.detail-cat {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.detail-info h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  margin: 8px 0 12px;
  line-height: 1.15;
}

.detail-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.detail-price {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 24px;
}

.detail-price .price-now {
  font-family: var(--serif);
  font-size: 2rem;
}

.detail-desc {
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 400px;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.qty-label {
  font-size: 0.9rem;
  margin-right: 8px;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 1.1rem;
  transition: border-color 0.2s;
}

.qty-btn:hover { border-color: var(--ink); }

.qty-row input {
  width: 52px;
  text-align: center;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 8px 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Cart */
.cart-page h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 40px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.cart-row {
  display: grid;
  grid-template-columns: 88px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.cart-thumb {
  width: 88px;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e8e2d9;
}

.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cart-cat {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.cart-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  display: block;
  margin: 4px 0;
}

.cart-name:hover { opacity: 0.7; }

.cart-unit { font-size: 0.85rem; color: var(--ink-soft); }

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty .qty-btn { width: 32px; height: 32px; }

.cart-qty input {
  width: 40px;
  text-align: center;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.cart-line-total {
  font-weight: 500;
  min-width: 72px;
  text-align: right;
}

.cart-remove {
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.cart-remove:hover { color: var(--sale); }

.cart-summary {
  position: sticky;
  top: 100px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.summary-row strong {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
}

.summary-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.cart-summary .btn { margin-bottom: 10px; }

.cart-layout:has(.empty-state) {
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: 0 auto;
}

/* Content pages */
.content-page {
  padding: 56px 0 80px;
  max-width: 640px;
}

.content-page h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 28px;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 28px 0 10px;
}

.prose p {
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.contact-card {
  padding: 64px 32px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.contact-company {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
}

.empty-state,
.empty-msg {
  text-align: center;
  padding: 64px 24px;
  color: var(--ink-soft);
}

.empty-state h2 {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 12px;
}

.empty-state .btn { margin-top: 24px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  display: block;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: block;
  margin-top: 4px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  font-size: 0.875rem;
}

.footer-nav a { color: var(--ink-soft); }
.footer-nav a:hover { color: var(--ink); }

.footer-legal {
  justify-self: end;
  text-align: right;
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.footer-legal p + p { margin-top: 4px; }

.footer-icp {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink-soft);
}

.footer-icp:hover { color: var(--ink); }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 14px 28px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease);
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .hero,
  .detail-layout,
  .cart-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-side { order: -1; }

  .footer-legal { text-align: left; justify-self: start; }

  .cart-row {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
  }

  .cart-qty,
  .cart-line-total,
  .cart-remove {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .main-nav { display: none; }

  .header-inner { padding: 14px 0; }
}
