:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-alt: #f4ede2;
  --ink: #2a2018;
  --ink-muted: #6c5b4b;
  --border: #e6dac9;
  --pine: #245740;
  --pine-dark: #1a402f;
  --pine-soft: #e7f2ec;
  --clay: #b55233;
  --clay-soft: #fbece6;
  --gold: #c78b2a;
  --gold-soft: #fcf3df;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 18px rgba(42, 32, 24, 0.06);
  --shadow-lg: 0 14px 36px rgba(42, 32, 24, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 239, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  max-width: 1040px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d8b27c, #b9854a);
  color: #362010;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1.5px rgba(54, 32, 16, 0.25);
}
.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: -2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.nav-link.active, .nav-link:hover {
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}
.bag-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--pine);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.bag-btn:hover { background: var(--pine-dark); transform: translateY(-1px); }
.bag-count {
  background: rgba(255,255,255,0.22);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Status Banner */
.status-bar {
  background: var(--pine-soft);
  color: var(--pine-dark);
  border-bottom: 1px solid #cce3d6;
  padding: 8px 16px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
}
.status-bar.sold-out {
  background: var(--clay-soft);
  color: var(--clay);
  border-bottom-color: #f0c9ba;
}

/* Main Layout */
main { padding: 26px 0 64px; }

.hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 30px;
}
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
}
.hero p {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--ink-muted);
}
.pill.green { background: var(--pine-soft); color: var(--pine-dark); }
.pill.clay { background: var(--clay-soft); color: var(--clay); }
.pill.gold { background: var(--gold-soft); color: #8c5c0e; }

/* Cards & Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links .nav-hide-sm { display: none; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 8px; font-size: 1.3rem; letter-spacing: -0.015em; }
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.86rem; }

.product-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.example-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--surface-alt);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.example-strip img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease, opacity 0.12s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pine-dark); }
.btn-secondary { background: var(--surface-alt); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #ebe1d2; }
.btn-clay { background: var(--clay); color: #fff; }
.btn-clay:hover:not(:disabled) { background: #963f24; }
.btn-sm { padding: 7px 12px; font-size: 0.84rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* Form controls */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 5px;
  color: var(--ink);
}
.input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
}
.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(36, 87, 64, 0.12);
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.93rem;
}
.check-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--pine);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Upload dropzone */
.upload-box {
  border: 2px dashed #cbbba5;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

/* Slot preview cards */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 600px) {
  .slot-grid { grid-template-columns: 1fr; }
}
.slot-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.slot-card.selected {
  border-color: var(--pine);
  background: #f5fbf7;
  box-shadow: 0 0 0 3px rgba(36, 87, 64, 0.12);
}
.slot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.slot-preview-wrap {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 6px;
}
.slot-preview-wrap img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

/* Name builder layout */
.builder-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 820px) {
  .builder-layout { grid-template-columns: 1fr; }
}
.wood-stage {
  background: radial-gradient(circle at 50% 35%, #fdfaf5, #efe5d6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 18px;
  display: grid;
  place-items: center;
  min-height: 280px;
  position: sticky;
  top: 76px;
}
.wood-stage svg {
  width: 100%;
  max-width: 390px;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(42, 28, 16, 0.24));
}
.shape-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.shape-chip, .decor-chip {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.shape-chip.active, .decor-chip.active {
  border-color: var(--pine);
  background: var(--pine-soft);
  color: var(--pine-dark);
}
.decor-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}

/* Alerts & Banners */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 0.92rem;
}
.alert-warn { background: var(--gold-soft); border: 1px solid #e7cb8d; color: #6e480a; }
.alert-ok { background: var(--pine-soft); border: 1px solid #b5d9c6; color: var(--pine-dark); }
.alert-err { background: var(--danger-soft); border: 1px solid #f4b4ae; color: var(--danger); }

/* Drawer / Modal (Unified Cart & Checkout) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 12, 0.45);
  z-index: 60;
  display: none;
  justify-content: flex-end;
}
.drawer-backdrop.open { display: flex; }
.drawer {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  height: 100%;
  overflow-y: auto;
  padding: 22px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.cart-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border);
}

/* Order timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 18px 0;
}
@media (max-width: 640px) {
  .timeline { grid-template-columns: 1fr; }
}
.step-node {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.step-node.done {
  background: var(--pine-soft);
  border-color: var(--pine);
  color: var(--pine-dark);
}
.step-node.current {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

/* Spinner */
.spinner {
  width: 34px;
  height: 34px;
  border: 3.5px solid var(--border);
  border-top-color: var(--pine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}
.tab-btn.active { background: var(--pine); color: #fff; border-color: var(--pine); }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  display: none;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.86rem;
}
