:root {
  --paper: #efe9de;
  --paper-raised: #faf7f1;
  --ink: #1b2a3d;
  --ink-soft: #4a5568;
  --line: #d9cfba;
  --mustard: #c98a2c;
  --mustard-dark: #a86f1c;
  --green: #3f6b4f;
  --radius: 3px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a { color: inherit; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-top: -2px;
}

.header-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 15px;
}
.header-nav a { text-decoration: none; }
.cart-link {
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: var(--radius);
  background: var(--paper-raised);
}
#cart-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-weight: 600;
  color: var(--mustard-dark);
}

main { max-width: 1080px; margin: 0 auto; padding: 40px 32px 80px; }

.site-footer {
  text-align: center;
  padding: 28px;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* Hero / listing header */
.listing-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.listing-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  margin: 0 0 6px;
  max-width: 480px;
}
.listing-head p { color: var(--ink-soft); margin: 0; max-width: 420px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  font-family: var(--sans);
  font-size: 14px;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-raised);
  cursor: pointer;
  color: var(--ink);
}
.filters button.active {
  background: var(--ink);
  color: var(--paper-raised);
  border-color: var(--ink);
}

/* Product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27,42,61,0.08); }
.product-card .thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.product-card .info { padding: 14px 16px 18px; }
.product-card .cat { font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.product-card h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 6px; font-weight: 600; }
.product-card .price { font-weight: 600; color: var(--mustard-dark); }

/* Product detail */
.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.detail .thumb-lg {
  height: 360px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
}
.detail .cat { color: var(--ink-soft); font-size: 13px; margin-bottom: 6px; }
.detail h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 10px; }
.detail .price { font-size: 22px; font-weight: 600; color: var(--mustard-dark); margin-bottom: 18px; }
.detail p.desc { color: var(--ink-soft); margin-bottom: 24px; max-width: 44ch; }

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-row button {
  width: 32px; height: 32px; border: 1px solid var(--line); background: var(--paper-raised);
  border-radius: var(--radius); font-size: 16px; cursor: pointer;
}
.qty-row span { min-width: 20px; text-align: center; font-weight: 600; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper-raised);
}
.btn:hover { background: var(--mustard-dark); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--paper-raised); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; color: var(--ink-soft); text-decoration: none; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 28px; }
.cart-table th { text-align: left; font-size: 12px; color: var(--ink-soft); padding-bottom: 10px; border-bottom: 1px solid var(--line); font-weight: 500; }
.cart-table td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-item-name { font-family: var(--serif); font-weight: 600; }
.cart-item-cat { font-size: 12px; color: var(--ink-soft); }
.remove-btn { background: none; border: none; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }

.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.cart-summary { max-width: 360px; margin-left: auto; }
.empty-state { text-align: center; padding: 60px 0; color: var(--ink-soft); }

/* Checkout */
.checkout-steps { display: flex; gap: 8px; margin-bottom: 32px; font-size: 13px; color: var(--ink-soft); }
.checkout-steps .step { padding: 6px 12px; border-radius: var(--radius); background: var(--paper-raised); border: 1px solid var(--line); }
.checkout-steps .step.active { background: var(--ink); color: var(--paper-raised); border-color: var(--ink); font-weight: 600; }
.checkout-steps .step.done { color: var(--green); border-color: var(--green); }

.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.form-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-card h2 { font-family: var(--serif); font-size: 22px; margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; background: #fff;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.payment-options { display: flex; gap: 10px; margin-bottom: 20px; }
.payment-options label {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.payment-options input { margin: 0; }

.mini-summary { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.mini-summary h3 { font-family: var(--serif); margin-top: 0; font-size: 17px; }
.mini-line { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; color: var(--ink-soft); }

/* Confirmation */
.confirm { text-align: center; padding: 60px 20px; }
.confirm .mark { font-size: 52px; margin-bottom: 12px; }
.confirm h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 10px; }
.confirm .order-id { color: var(--ink-soft); margin-bottom: 30px; }
.confirm .recap { max-width: 420px; margin: 0 auto 30px; text-align: left; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }

/* Toast + cart badge feedback */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper-raised);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#cart-count.bump { animation: bump 0.3s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); color: var(--mustard-dark); }
  100% { transform: scale(1); }
}

@media (max-width: 760px) {
  .detail, .checkout-layout { grid-template-columns: 1fr; }
  .site-header { padding: 16px 20px; }
  main { padding: 28px 20px 60px; }
}
