:root {
  --bg: #f6f3ee;
  --ink: #16140f;
  --muted: #6b665c;
  --line: #e2ddd3;
  --card: #fffdf9;
  --red: #e3000b;
  --yellow: #ffcf00;
  --blue: #0055bf;
  --radius: 18px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* barra superior: marca + un solo botón de menú */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(18px, 4vw, 44px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.02em; background: rgba(246, 243, 238, .82); backdrop-filter: blur(10px); padding: 8px 14px 8px 10px; border-radius: 999px; }
.brand-mark { width: 26px; height: 18px; border-radius: 4px; background: var(--red); position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: -5px; width: 8px; height: 6px; border-radius: 2px 2px 0 0; background: var(--red); }
.brand-mark::before { left: 3px; } .brand-mark::after { right: 3px; }
.menu-btn { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--ink); display: grid; place-content: center; gap: 6px; transition: transform .2s; }
.menu-btn span { display: block; width: 20px; height: 2px; background: #fff; transition: transform .25s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.drawer { position: fixed; z-index: 40; top: 0; right: 0; height: 100dvh; width: min(420px, 100vw); background: var(--ink); color: #fff; padding: 110px 40px 40px; display: flex; flex-direction: column; gap: 6px; transform: translateX(100%); visibility: hidden; transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .35s; }
.drawer.open { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
html, body { overflow-x: hidden; }
.drawer a { font-family: var(--display); font-size: clamp(28px, 4vw, 38px); font-weight: 700; text-decoration: none; letter-spacing: -0.02em; padding: 4px 0; opacity: .92; }
.drawer a:hover { color: var(--yellow); }
.drawer-note { margin-top: auto; font-size: 13px; color: #a9a397; }

main { min-height: 80vh; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 44px); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 36px clamp(18px, 4vw, 44px); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 80px; }

/* portada */
.hero { position: relative; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 20px; padding: 110px clamp(18px, 4vw, 44px) 40px; max-width: 1400px; margin: 0 auto; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6.6vw, 98px); line-height: .94; letter-spacing: -0.045em; margin: 0 0 22px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead { font-size: clamp(17px, 1.4vw, 21px); color: var(--muted); max-width: 520px; margin: 0 0 28px; }
.hero-stage { position: relative; height: min(78vh, 720px); border-radius: 28px; background: radial-gradient(120% 90% at 50% 20%, #fff 0%, #efe9df 70%); overflow: hidden; }
.hero-stage canvas { display: block; }
.stage-tag { position: absolute; left: 18px; bottom: 16px; background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; }
.stat b { display: block; font-family: var(--display); font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.stat span { color: var(--muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 15px 24px; font-weight: 600; font-size: 16px; text-decoration: none; background: var(--ink); color: #fff; transition: transform .15s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.alt { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.red { background: var(--red); }
.btn.small { padding: 10px 16px; font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.section-title { font-family: var(--display); font-size: clamp(32px, 4vw, 56px); letter-spacing: -0.035em; line-height: 1; margin: 90px 0 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(30, 25, 10, .08); }
.card .thumb { aspect-ratio: 4/3; background: #f1ece3; display: grid; place-items: center; }
.card .thumb img { width: 88%; height: 88%; object-fit: contain; }
.card .body { padding: 16px 18px 18px; }
.card h3 { font-family: var(--display); font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
.meta { color: var(--muted); font-size: 14px; }
.price { font-weight: 700; }

/* página de modelo */
.model-page { padding-top: 100px; }
.model-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 28px; align-items: start; }
.viewer { position: relative; height: min(76vh, 760px); border-radius: 24px; overflow: hidden; background: radial-gradient(110% 90% at 50% 15%, #fff 0%, #ece6db 75%); }
.viewer .loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 10px; font-size: 15px; }
.bar { width: 220px; height: 6px; background: #e3ddd2; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.steps { position: absolute; left: 14px; right: 14px; bottom: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 12px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.steps button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; }
.steps input[type=range] { width: 100%; accent-color: var(--red); }
.steps .count { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 92px; text-align: right; font-size: 15px; }
.viewer-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.92); border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
.panel h1 { font-family: var(--display); font-size: clamp(38px, 4vw, 58px); letter-spacing: -0.04em; line-height: .95; margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.kv div { background: #f4efe7; border-radius: 14px; padding: 12px 14px; }
.kv b { display: block; font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; }
.kv span { font-size: 13px; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; font-size: 15px; }
.checks li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #1f9d55; color: #fff; font-size: 12px; margin-right: 10px; }
.buy { display: grid; gap: 10px; margin-top: 18px; }
.buy .opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: #fff; }
.buy .opt b { display: block; }
.buy .opt small { color: var(--muted); }

.parts-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.part { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; font-size: 13px; cursor: pointer; text-decoration: none; }
.part .img { aspect-ratio: 1; display: grid; place-items: center; background: #fff; border-radius: 10px; margin-bottom: 8px; }
.part .img img { max-height: 90%; width: auto; }
.part b { font-size: 15px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid rgba(0,0,0,.15); }

/* catálogo */
.catalog-head { padding-top: 120px; }
.search { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 26px; }
.search input, .search select, .field input, .field select, .field textarea { font: inherit; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.search input { flex: 1 1 280px; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 30px 0; align-items: center; }

/* modales y formularios */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(20, 18, 12, .5); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--bg); border-radius: 22px; width: min(560px, 100%); max-height: 92dvh; overflow: auto; padding: 28px; position: relative; }
.modal-box h2 { font-family: var(--display); letter-spacing: -0.03em; font-size: 32px; margin: 0 0 8px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 20px; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 14px; font-weight: 600; }
.field textarea { min-height: 80px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { font-size: 14px; color: var(--muted); }
.ok { background: #e7f6ec; border: 1px solid #b7e2c5; padding: 14px; border-radius: 14px; }
.err { color: var(--red); font-size: 14px; }
.steps-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.steps-how .panel h3 { font-family: var(--display); font-size: 24px; margin: 8px 0; letter-spacing: -0.02em; }
.steps-how .n { font-family: var(--display); font-size: 48px; color: var(--red); line-height: 1; }
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 14px; overflow: hidden; }
table.adm th, table.adm td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 100px; }
  .hero-stage { height: 56vh; }
  .model-layout { grid-template-columns: 1fr; }
  .viewer { height: 64vh; }
  .steps { grid-template-columns: auto 1fr auto; }
  .steps .hide-sm { display: none; }
  .two { grid-template-columns: 1fr; }
}
