/* Layered Moose — global styles. Palette values mirror shared/config.js
   (main.js re-applies config colors to these variables at load). */

:root {
  --ink: #20272b;
  --ink-soft: #37444b;
  --accent: #e8722c;
  --accent-dark: #c25a1c;
  --bg: #f7f5f1;
  --card: #ffffff;
  --ok: #2e8b57;
  --line: #e5e2db;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(32, 39, 43, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
img { max-width: 100%; }
a { color: var(--accent-dark); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}
.brand img { width: 38px; height: 38px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.9;
}
.nav a:hover, .nav a.active { background: var(--ink-soft); opacity: 1; }
.nav a.nav-cta { background: var(--accent); opacity: 1; }
.nav a.nav-cta:hover { background: var(--accent-dark); }
.nav-toggle {
  margin-left: auto;
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  padding: 4px 8px;
}
@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 18px 18px;
    gap: 6px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1.05rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--ink); }
.btn.secondary:hover { background: var(--ink-soft); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.small { padding: 9px 16px; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.55; cursor: wait; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 56px 0 64px;
  background-image: radial-gradient(ellipse at 85% 10%, rgba(232, 114, 44, 0.25), transparent 55%);
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.12; margin: 0 0 14px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { font-size: 1.2rem; max-width: 34em; opacity: 0.92; margin: 0 0 26px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- cards / grids ---------- */
.cards { display: grid; gap: 18px; }
@media (min-width: 700px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 1-2-3 steps strip ---------- */
.steps-strip {
  display: grid;
  gap: 10px;
  margin: 18px 0 22px;
}
@media (min-width: 700px) { .steps-strip { grid-template-columns: repeat(3, 1fr); } }
.steps-strip .step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.steps-strip .step b { display: block; }
.steps-strip .num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- catalog size filter chips ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 20px;
  padding: 7px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.door {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.door:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(32,39,43,0.14); }
.door .door-emoji { font-size: 2rem; }
.door .go { color: var(--accent-dark); font-weight: 700; margin-top: auto; }

section.block { padding: 46px 0; }
section.block.tint { background: #efece5; }
h2.section-title { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 20px; }

.trust-row { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .trust-row { grid-template-columns: repeat(4, 1fr); } }
.trust-row .card { padding: 16px; text-align: center; font-weight: 600; font-size: 0.95rem; }
.trust-row .card span { display: block; font-size: 1.6rem; margin-bottom: 6px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; font-weight: 600; }
label.field small { font-weight: 400; color: var(--ink-soft); display: block; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin: 14px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; }
.form-note { color: var(--ink-soft); font-size: 0.9rem; }
.error-msg { color: #b3261e; font-weight: 600; }

/* ---------- product grid ---------- */
.product-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.product-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.product-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eceae4; }
.product-card .pbody { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .price { font-weight: 800; font-size: 1.1rem; }
.product-card .ships { color: var(--ink-soft); font-size: 0.88rem; }
.product-card .btn { margin-top: auto; }
.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(32,39,43,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 520px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  padding: 24px;
  position: relative;
}
.modal .close-x {
  position: absolute; top: 10px; right: 14px;
  background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink-soft);
}
.modal .live-price { font-size: 1.5rem; font-weight: 800; }

/* ---------- estimate output ---------- */
.estimate-panel { position: sticky; top: 80px; }
.price-range { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; color: var(--ink); }
.price-range .dash { color: var(--accent); }
.two-col { display: grid; gap: 26px; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- status timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 24px 0; }
.timeline li {
  position: relative;
  padding: 0 0 26px 38px;
  color: var(--ink-soft);
}
.timeline li::before {
  content: "";
  position: absolute; left: 10px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #cfcbc2;
}
.timeline li::after {
  content: "";
  position: absolute; left: 16px; top: 20px; bottom: 0;
  width: 2px; background: #cfcbc2;
}
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--ok); }
.timeline li.current { color: var(--ink); font-weight: 800; }
.timeline li.current::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(232,114,44,0.25); }

.camera-slot {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--ink-soft);
  background: repeating-linear-gradient(-45deg, #faf9f6, #faf9f6 12px, #f3f1ec 12px, #f3f1ec 24px);
}

/* ---------- steps (how it works) ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 1.1rem;
  margin-bottom: 10px;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: #fff;
  margin-top: 60px;
  padding: 40px 0 30px;
}
.site-footer .cols { display: grid; gap: 24px; }
@media (min-width: 700px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { color: #fff; opacity: 0.85; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer .tagline { color: var(--accent); font-weight: 700; }
.site-footer .fine { opacity: 0.6; font-size: 0.85rem; margin-top: 26px; }

/* ---------- admin ---------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  top: 66px;
  z-index: 40;
  background: var(--bg);
  padding: 10px 0;
  margin-bottom: 10px;
}
.admin-tabs .chip { font-size: 1rem; padding: 10px 18px; }
.table-wrap { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #fff; }
table.admin th, table.admin td { border: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
table.admin th { background: #efece5; }
table.admin select, table.admin .btn { font-size: 16px; } /* 16px stops iOS auto-zoom */
.photo-thumbs img { width: 110px; border-radius: 6px; margin: 4px; border: 1px solid var(--line); }

/* Phone: each row becomes a card, cells stack, controls go full-width */
@media (max-width: 760px) {
  table.admin, table.admin tbody { display: block; }
  table.admin tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; background: #fff; padding: 6px 2px; }
  table.admin tr:first-child { display: none; } /* header row */
  table.admin td { display: block; border: 0; border-bottom: 1px dashed var(--line); }
  table.admin td:last-child { border-bottom: 0; }
  table.admin select { width: 100%; padding: 12px; }
  table.admin .btn { display: block; width: 100%; margin: 6px 0; text-align: center; }
}

/* ---------- upload zone ---------- */
.upload-zone {
  text-align: center;
  border: 2px dashed var(--line);
  padding: 34px 22px;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone.drag { border-color: var(--accent); background: #fdf3ec; }

/* ---------- design studio chat ---------- */
.chat-log {
  height: min(52vh, 460px);
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #faf9f6;
}
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.bubble.assistant {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.bubble.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.bubble.typing { color: var(--ink-soft); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input-row input { margin-top: 0; flex: 1; }

/* ---------- new-features banner ---------- */
.feature-banner {
  background: linear-gradient(100deg, var(--ink), var(--ink-soft));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.feature-banner strong { font-size: 1.15rem; }
.feature-banner .btn { white-space: nowrap; }

/* ---------- print progress bar ---------- */
.print-progress { margin-bottom: 10px; }
.progress-outer {
  height: 14px;
  border-radius: 8px;
  background: #37444b;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f2984f);
  border-radius: 8px;
  transition: width 1s ease;
}
.progress-label { margin-top: 6px; font-size: 0.95rem; }

/* ---------- live cam ---------- */
.live-cam img { width: 100%; border-radius: var(--radius); display: block; }
.live-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #e33; margin-right: 6px; animation: pulse 1.5s infinite;
}

.hidden { display: none !important; }
.success-box {
  background: #eef7f0;
  border: 1.5px solid var(--ok);
  border-radius: var(--radius);
  padding: 22px;
}
