:root {
  --cream: #fdf7ee;
  --ink: #26221d;
  --terracotta: #d4603a;
  --terracotta-dark: #b34d2a;
  --sage: #6f8a6a;
  --line: #e7ddcc;
  --muted: #7a7266;
  --white: #ffffff;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(38, 34, 29, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

a { color: inherit; }

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

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-weight: 800;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--terracotta); }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.main-nav a:hover { color: var(--terracotta); }
.nav-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--terracotta);
  color: var(--white) !important;
  padding: 8px 14px;
  border-radius: 999px;
}
.nav-cart:hover { background: var(--terracotta-dark); }

/* Flash messages */
.flash {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 24px;
}
.flash-msg {
  background: #fff3ea;
  border: 1px solid var(--terracotta);
  color: var(--terracotta-dark);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
}
.flash-msg.error { background: #fdecea; border-color: var(--danger); color: var(--danger); }

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--terracotta); }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero {
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 { font-size: 2.6rem; margin: 0 0 16px; line-height: 1.1; letter-spacing: -0.02em; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; }
.hero-art {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badges { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); font-weight: 600; }

.section { padding: 48px 0; }
.section h2 { font-size: 1.7rem; margin-bottom: 8px; }
.section .subtitle { color: var(--muted); margin-bottom: 30px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.step-num {
  width: 32px; height: 32px;
  background: var(--terracotta);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.step-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Customize page */
.customize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 40px 0 60px;
  align-items: start;
}
.preview-col { position: sticky; top: 90px; }
.tshirt-mockup {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
}
.tshirt-mockup svg { width: 100%; height: 100%; display: block; }
.print-area {
  position: absolute;
  left: 33%;
  top: 30%;
  width: 34%;
  height: 30%;
  overflow: hidden;
  border-radius: 6px;
  outline: 1px dashed rgba(0,0,0,0.15);
  outline-offset: 2px;
  background: rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
}
.print-area img { width: 100%; height: 100%; object-fit: cover; }
.print-area .placeholder-text {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 6px;
}

.upload-box {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  background: var(--white);
  cursor: pointer;
}
.upload-box.dragover { border-color: var(--terracotta); background: #fff6f0; }
.upload-box input[type="file"] { display: none; }
.upload-box p { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.field-group { margin: 26px 0; }
.field-group label.group-label { display: block; font-weight: 700; margin-bottom: 10px; }

.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  position: relative;
}
.swatch.selected { border-color: var(--terracotta); box-shadow: 0 0 0 2px var(--terracotta); }

.size-options { display: flex; gap: 8px; flex-wrap: wrap; }
.size-pill {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.size-pill.selected { border-color: var(--terracotta); background: var(--terracotta); color: var(--white); }

.qty-row { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
}
.price-line { font-size: 1.6rem; font-weight: 800; margin: 20px 0 6px; }
.price-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-item-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.cart-item-meta { font-size: 0.85rem; color: var(--muted); }
.remove-link { color: var(--danger); font-size: 0.85rem; text-decoration: none; font-weight: 600; }
.cart-summary { max-width: 340px; margin-left: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.95rem; }
.summary-row.total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Forms */
.form-card {
  max-width: 440px;
  margin: 60px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}
.form-card h1 { font-size: 1.5rem; margin-top: 0; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.form-group input:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.form-error { background: #fdecea; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; }
.form-footer-link { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--muted); }

/* Track order */
.track-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.track-form input { flex: 1; min-width: 180px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }

.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-paid { background: #fff3ea; color: var(--terracotta-dark); }
.status-in_production, .status-mock_pending { background: #eef3ff; color: #3050b0; }
.status-shipped, .status-fulfilled { background: #e9f6ec; color: #2c7a3d; }
.status-cancelled, .status-failed { background: #fdecea; color: var(--danger); }

.order-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.order-id { font-weight: 700; }
.order-items { font-size: 0.9rem; color: var(--muted); }

.tracking-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.9rem; }

footer.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 34px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
footer.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .customize-grid { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .steps { grid-template-columns: 1fr; }
  .main-nav { gap: 12px; }
}
