:root {
  --bg: #f7f2ec;
  --card: #fffaf5;
  --ink: #1e1d1b;
  --muted: #776f67;
  --line: #eadfd3;
  --accent: #caa77d;
  --accent-dark: #9c7650;
  --soft: #efe4d7;
  --success: #267b5c;
  --danger: #b33a3a;
  --shadow: 0 24px 70px rgba(39, 29, 21, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #fffaf4 0, #f7f2ec 38%, #efe6dc 100%);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(320px, 920px);
  gap: 28px;
  align-items: start;
  padding: 36px;
}

.hero-card, .form-card {
  border: 1px solid rgba(232, 218, 203, .9);
  background: rgba(255, 250, 245, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  border-radius: 28px;
}

.hero-card {
  position: sticky;
  top: 28px;
  padding: 34px;
}
.brand-logo {
  width: 210px;
  height: auto;
  margin-bottom: 30px;
}
.eyebrow, .mini-label {
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}
.hero-card h1 {
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.02;
  margin: 0 0 18px;
}
.hero-copy {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 26px;
}
.trust-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 6px;
  line-height: 1.45;
}
.trust-card span { color: var(--muted); }

.form-card {
  padding: 26px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
.topbar h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}
.step-counter {
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  font-size: 13px;
}
.progress {
  height: 10px;
  border-radius: 999px;
  background: #efe4da;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width .25s ease;
}
.step { display: none; }
.step.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.muted { color: var(--muted); line-height: 1.55; margin-top: 0; }
.small { font-size: 14px; }
.hint { color: var(--muted); margin: 10px 0 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.product-card, .subproduct-card {
  cursor: pointer;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  min-height: 100%;
}
.product-card:hover, .subproduct-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(39,29,21,.08); }
.product-card.selected, .subproduct-card.selected, .option-card.selected, .swatch.selected, .animal-card.selected {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 4px rgba(202, 167, 125, .20);
}
.product-card input, .subproduct-card input, .option-card input, .swatch input, .animal-card input { position: absolute; opacity: 0; pointer-events: none; }
.product-image {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  background: var(--soft);
}
.product-body, .subproduct-body {
  padding: 16px;
}
.product-body h3, .subproduct-body h3 {
  margin: 0 0 7px;
  font-size: 17px;
}
.product-body p, .subproduct-body p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}
.price-pill {
  display: inline-flex;
  background: #f3eadf;
  color: #6b4f33;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.selected-product {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 20px;
}
.selected-product img {
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
}
.selected-product h3 { margin: 0 0 6px; }
.selected-product p { margin: 0; color: var(--muted); line-height: 1.45; }

.conditional-block {
  display: none;
  background: rgba(255,255,255,.64);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 18px;
}
.conditional-block.visible { display: block; }
.conditional-block h3 { margin: 0 0 12px; }
.conditional-block h4 { margin: 22px 0 12px; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.field span, fieldset legend {
  color: #3a342e;
  font-weight: 800;
  font-size: 14px;
}
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 4px rgba(202, 167, 125, .20);
}
textarea { resize: vertical; }

.option-grid, .subproduct-grid, .swatch-grid, .animal-grid {
  display: grid;
  gap: 12px;
}
.option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-grid.compact { grid-template-columns: repeat(2, 150px); }
.option-card {
  cursor: pointer;
  position: relative;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 6px;
}
.option-card strong { font-size: 16px; }
.option-card small { color: var(--muted); }
.subproduct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subproduct-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.swatch-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.swatch {
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}
.swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 24px;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.animal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.animal-card {
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
}
.animal-card img { width: 100%; aspect-ratio: 1 / .85; object-fit: contain; margin-bottom: 6px; }
.reference-box {
  margin-top: 14px;
  border: 1px dashed var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}
.reference-box summary { cursor: pointer; color: var(--accent-dark); font-weight: 800; }
.reference-box img { margin-top: 12px; border-radius: 12px; }

.upload-box {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  border: 2px dashed #d5c2ad;
  background: rgba(255,255,255,.72);
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 14px;
  cursor: pointer;
}
.upload-box input { display: none; }
.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 900;
  font-size: 26px;
}
.upload-box small { color: var(--muted); }
.upload-summary {
  margin: 10px 0 16px;
  color: var(--muted);
  line-height: 1.45;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 10px;
}
.preview-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.upload-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
}
.upload-section h3 { margin: 0 0 8px; }

.review-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 12px;
}
.review-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  border-bottom: 1px solid #f1e7dc;
  padding-bottom: 10px;
}
.review-row:last-child { border-bottom: 0; padding-bottom: 0; }
.review-row strong { color: #453d35; }
.review-row span { color: var(--muted); }
.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
button, .whatsapp-link {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform .14s ease, opacity .14s ease;
}
button:hover, .whatsapp-link:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary, .whatsapp-link { background: var(--ink); color: #fff; }
.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.hidden { display: none !important; }
.form-error { color: var(--danger); font-weight: 800; min-height: 22px; }
.success-step { text-align: center; padding: 26px 0; }
.success-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  background: #e4f3ec;
  color: var(--success);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
}
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 1fr; padding: 20px; }
  .hero-card { position: static; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .app-shell { padding: 12px; gap: 14px; }
  .hero-card, .form-card { border-radius: 20px; padding: 20px; }
  .brand-logo { width: 160px; }
  .topbar { display: grid; }
  .step-counter { justify-self: start; }
  .product-grid, .two-col, .option-grid, .option-grid.compact, .subproduct-grid, .swatch-grid, .animal-grid, .selected-product, .review-row {
    grid-template-columns: 1fr;
  }
  .selected-product img { width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  button, .whatsapp-link { width: 100%; }
}
