:root {
  color-scheme: light dark;
  --bg: #faf6ef;
  --fg: #241d13;
  --muted: #8a7658;
  --accent: #b4832c;
  --accent-fg: #2a1d08;
  --card: #f3ead8;
  --border: #e2d3ae;
  --img-bg: #ece1c9;
  --gold-line: linear-gradient(90deg, transparent, #b4832c, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130d;
    --fg: #f3ead8;
    --muted: #ab9873;
    --accent: #d1a545;
    --accent-fg: #1c1305;
    --card: #241d14;
    --border: #3c3120;
    --img-bg: #2b2318;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

button, input, textarea, select { font-family: inherit; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.brand-header {
  text-align: center;
  padding: 12px 0 18px;
  position: relative;
}
.lang-switch {
  position: absolute;
  top: 8px;
  right: 0;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lang-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang-switch button.active { background: var(--accent); color: var(--accent-fg); }
.brand-header .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}
.brand-header .name {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-header .tag {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}
.brand-header .rule {
  height: 1px;
  background: var(--gold-line);
  margin-top: 14px;
}

h1 { font-family: "Playfair Display", Georgia, serif; font-size: 21px; font-weight: 700; margin: 8px 0 4px; }
p.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.step-indicator .dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}
.step-indicator .dot.active { background: var(--accent); }
.step-indicator .dot.done { background: var(--accent); opacity: 0.55; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.field input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.grid.one { grid-template-columns: 1fr; }
.card { position: relative; }
.card .name { padding: 8px 10px; font-size: 13px; }
.card .price { padding: 0 10px 8px; margin-top: -8px; font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
}
.tab.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }

.summary {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.summary .total { font-family: "Playfair Display", Georgia, serif; font-size: 26px; font-weight: 700; margin-top: 8px; color: var(--accent); }

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--fg); border: 1px solid var(--border); margin-top: 10px; }
.btn.skip, .btn.share { margin: 0 0 14px; }

/* Primary actions stay reachable on long catalog screens */
.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  margin: 16px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.actions .btn { margin-top: 0; }
.actions .btn.secondary { flex: 0 0 32%; }
.actions .btn:not(.secondary) { flex: 1; }

.note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* image placeholder shimmer + zoom */
.imgbox { position: relative; height: 130px; overflow: hidden; background: linear-gradient(90deg, var(--img-bg) 0%, var(--border) 50%, var(--img-bg) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.imgbox.tall { height: auto; aspect-ratio: 3 / 2; }
.imgbox.cover { height: 150px; }
.card .imgbox:not(.tall) { height: auto; aspect-ratio: 4 / 5; }
.imgbox img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.25s ease; }
.imgbox.tall img { object-fit: contain; }
.imgbox.loaded { animation: none; background: var(--img-bg); }
.imgbox.loaded img { opacity: 1; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.zoom-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .icon-close { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, 0.15); color: #fff; border-color: transparent; }

.error { color: #c14a4a; font-size: 14px; margin: 8px 0; }
.success { text-align: center; padding: 40px 0; }
.success .icon { font-size: 48px; margin-bottom: 12px; }

/* multi-window summary rows (add-more step + final summary) */
.window-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.window-row:last-of-type { border-bottom: none; }
.window-title { font-weight: 600; font-size: 14px; }
.window-title .muted { font-weight: 400; color: var(--muted); }
.window-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.window-price { text-align: right; font-size: 13px; color: var(--accent); margin: -6px 0 4px; }

/* portfolio gallery overlay */
.portfolio-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.portfolio-header h1 { margin: 0; }
.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 15px;
  cursor: pointer;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.portfolio-card {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
.portfolio-card .caption { padding: 8px 10px; font-size: 12px; color: var(--muted); }
