/* ==========================================================================
   Swoon Ceramics — design system
   Palette: muted putty / taupe, editorial, low-contrast.
   Type: Fraunces (serif, editorial headings) + Work Sans (quiet functional UI)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,400&family=Work+Sans:wght@300;400;500&family=Poppins:wght@200;300;400&display=swap');

:root {
  --bg: #ece7de;
  --bg-alt: #e2dccd;
  --surface: #f5f2ec;
  --ink: #332f28;
  --ink-soft: #6d6558;
  --ink-faint: #9a927f;
  --line: #d3cabb;
  --accent: #a48a68;
  --accent-ink: #4a3f2d;
  --error: #9c4b3e;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --brand: 'Poppins', 'Century Gothic', var(--sans);

  --max: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: 0.002em;
}

p { margin: 0 0 1em; max-width: 62ch; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

button, input, select, textarea { font-family: var(--sans); font-size: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: block;
}

.wordmark {
  font-family: var(--brand);
  font-weight: 200;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wordmark span { display: block; color: var(--ink-soft); font-weight: 200; font-size: 0.62em; letter-spacing: 0.3em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}

.main-nav a {
  font-size: 0.94rem;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover, .main-nav a.active { color: var(--ink); border-color: var(--accent); }

.cart-link {
  position: relative;
  font-family: var(--sans);
  color: var(--ink) !important;
}

.cart-count {
  display: inline-block;
  min-width: 1.2em;
  text-align: center;
  margin-left: 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 13px 26px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: var(--ink); color: var(--bg); }

.btn-primary {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--surface);
}

.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn-quiet {
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  color: var(--ink-soft);
}

.btn-quiet:hover { background: transparent; color: var(--ink); }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:hover { background: transparent; color: var(--ink); }
.btn-primary[disabled]:hover { background: var(--accent-ink); color: var(--surface); }

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

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gutter);
  align-items: center;
  padding: clamp(40px, 7vw, 96px) 0;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  max-width: 14ch;
}

.hero-copy p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 42ch;
}

.hero-figure {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
}

.hero-figure img, .hero-figure svg { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
}

/* ---------- section ---------- */

.section { padding: clamp(36px, 6vw, 72px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.section-head .note { color: var(--ink-faint); font-size: 0.92rem; }

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

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 32px);
}

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card { display: block; }

.card-figure {
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 14px;
}

.card-figure img, .card-figure svg { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-figure img, .card:hover .card-figure svg { transform: scale(1.03); }

.card-title { font-family: var(--serif); font-size: 1.08rem; margin-bottom: 2px; }
.card-meta { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 0.9rem; }
.badge-placeholder {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 2px 8px;
}

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

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(28px, 5vw, 56px) 0;
}

.product-figure { aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.product-figure img, .product-figure svg { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); max-width: none; }
.product-price { font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 20px; }
.product-desc { color: var(--ink-soft); }

.qty-row { display: flex; align-items: center; gap: 16px; margin: 26px 0; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); }
.qty-control button {
  background: none; border: none; width: 38px; height: 42px; cursor: pointer; font-size: 1rem; color: var(--ink);
}
.qty-control input {
  width: 40px; text-align: center; border: none; background: none; color: var(--ink); border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 42px;
}

.product-meta-list { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
.product-meta-list dl { display: grid; grid-template-columns: 9em 1fr; row-gap: 8px; margin: 0; }
.product-meta-list dt { color: var(--ink-faint); font-size: 0.9rem; }
.product-meta-list dd { margin: 0; font-size: 0.92rem; }

@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }

.share-row { margin-top: 28px; }
.share-row label { display: block; font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 6px; }
.share-control { display: flex; gap: 8px; }
.share-control input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 0.85rem;
}
.share-control .btn { padding: 10px 18px; font-size: 0.85rem; }

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

.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.cart-table th {
  text-align: left; font-weight: 400; color: var(--ink-faint); font-size: 0.85rem; border-bottom: 1px solid var(--line); padding: 0 0 10px;
}
.cart-table td { padding: 18px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart-line { display: flex; gap: 16px; align-items: center; }
.cart-thumb { width: 74px; height: 92px; background: var(--surface); overflow: hidden; flex: none; }
.cart-thumb img, .cart-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.cart-line-title { font-family: var(--serif); font-size: 1.02rem; }
.cart-remove { color: var(--ink-faint); font-size: 0.85rem; margin-top: 6px; display: inline-block; cursor: pointer; border: none; background: none; padding: 0; }
.cart-remove:hover { color: var(--error); }

.cart-summary {
  max-width: 340px; margin-left: auto; border-top: 1px solid var(--ink); padding-top: 16px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--ink-soft); }
.summary-row.total { color: var(--ink); font-size: 1.1rem; font-family: var(--serif); margin-top: 14px; }

.empty-state { padding: 60px 0; text-align: left; color: var(--ink-soft); }

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

.checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

@media (max-width: 860px) { .checkout-layout { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.field input:focus { border-color: var(--accent-ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.order-summary { background: var(--surface); padding: 26px; border: 1px solid var(--line); }
.order-summary h2 { font-size: 1.15rem; margin-bottom: 18px; }
.order-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 0.94rem; color: var(--ink-soft); }
.order-line .name { color: var(--ink); }

.payment-methods {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-faint);
}

.form-error {
  color: var(--error); font-size: 0.88rem; margin: -6px 0 14px; display: none;
}
.form-error.show { display: block; }

/* ---------- status pages (success/cancel) ---------- */

.status-page { padding: clamp(60px, 12vw, 140px) 0; text-align: left; max-width: 640px; }
.status-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.status-page p { color: var(--ink-soft); font-size: 1.05rem; }
.status-mark { font-family: var(--serif); font-style: italic; color: var(--ink-faint); margin-bottom: 18px; display: block; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(48px, 8vw, 96px);
  padding: 40px 0;
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--ink-faint); display: inline-flex; }
.footer-social a:hover { color: var(--ink); }
.footer-social svg { width: 18px; height: 18px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
