:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --ink: #15161a;
  --ink-soft: #5d6168;
  --line: #e4e6ea;
  --accent: #111216;
  --brand: #111216;
  --radius: 28px;
  --shadow: 0 24px 60px -28px rgba(20, 22, 28, 0.35);
  --shadow-sm: 0 8px 24px -12px rgba(20, 22, 28, 0.25);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(244, 245, 247, 0.85);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 0.35s, border-color 0.35s;
}
/* nav transparente sobre la portada oscura */
.nav.transparent {
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  border-color: transparent;
}
.nav.transparent .logo { color: #fff; }
.nav.transparent .logo .mark { background: #fff; color: #111; }
.nav.transparent .logo small { color: rgba(255, 255, 255, 0.55); }
.logo-img { height: 48px; width: auto; display: block; }
.logo-light { display: none; }
.nav.transparent .logo-dark { display: none; }
.nav.transparent .logo-light { display: block; }
.nav.transparent .nav-links a { color: rgba(255, 255, 255, 0.72); }
.nav.transparent .nav-links a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav.transparent .nav-links a.active { background: #fff; color: #111; }
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  height: 76px; max-width: 1280px; margin: 0 auto; padding: 0 28px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.02em; }
.logo .mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 8px; margin-left: 12px; flex: 1; }
.nav-links a {
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); transition: 0.2s;
}
.nav-links a:hover { background: var(--surface); color: var(--ink); }
.nav-links a.active { background: var(--accent); color: #fff; }
.nav-cta {
  padding: 11px 22px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 14px;
}
.nav.transparent .nav-cta { background: #fff; color: #111; }

/* ---------- HERO CATALOG ---------- */
.hero-head { padding: 56px 0 28px; }
.hero-head .eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.hero-head h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.03em; margin: 14px 0; font-weight: 800; }
.hero-head p { color: var(--ink-soft); font-size: 17px; max-width: 560px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 8px 0 36px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 20px; box-shadow: var(--shadow-sm);
}
.search input { border: none; outline: none; flex: 1; font-size: 15px; background: none; color: var(--ink); }
.chip {
  padding: 12px 18px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-soft); transition: 0.18s;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- GRID ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; padding-bottom: 80px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: 0.3s; cursor: pointer;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-media {
  position: relative; aspect-ratio: 16 / 11; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 10%, #fbfbfc, #e7e9ee);
  display: grid; place-items: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.card:hover .card-media img { transform: scale(1.05); }
.card-media .placeholder { color: #b9bdc6; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.card-media .placeholder svg { width: 56px; height: 56px; opacity: 0.5; }
.badge {
  position: absolute; top: 14px; left: 14px; padding: 9px 17px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(255,255,255,0.96); color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.35);
  display: inline-flex; align-items: center; gap: 6px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #1e9e54; }
.badge.apartado { background: #f0f1f4; color: #2a2d33; }
.badge.apartado::before { background: #c98a1e; }
.badge.vendido { background: #1d1e22; color: #fff; }
.badge.vendido::before { background: #e0524d; }
.badge.featured { left: auto; right: 14px; background: var(--accent); color: #fff; }
.badge.featured::before { display: none; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body .meta { font-size: 12px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.card-body h3 { font-size: 20px; letter-spacing: -0.02em; font-weight: 700; }
.card-specs { display: flex; gap: 16px; color: var(--ink-soft); font-size: 13px; font-weight: 500; margin-top: auto; padding-top: 8px; }
.card-specs span { display: flex; align-items: center; gap: 5px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.price small { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.go { width: 40px; height: 40px; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; transition: 0.2s; }
.card:hover .go { transform: translateX(3px); }

.empty { text-align: center; padding: 80px 0; color: var(--ink-soft); }

/* ---------- DETAIL ---------- */
.detail { display: none; }
.detail.show { display: block; }
.catalog.hide { display: none; }

.back-btn { display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 8px; font-weight: 600; color: var(--ink-soft); }
.back-btn:hover { color: var(--ink); }

.stage {
  position: relative; margin-top: 18px; border-radius: 36px; overflow: hidden;
  background:
    radial-gradient(120% 130% at 50% -10%, #ffffff 0%, #eef0f4 45%, #dfe2e8 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 44px clamp(20px, 5vw, 60px) 40px;
}
.stage-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: start; }
.stage-head .eyebrow { color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.stage-head h2 { font-size: clamp(34px, 5vw, 60px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 800; margin: 10px 0 6px; }
.stage-head .sub { color: var(--ink-soft); font-size: 17px; font-weight: 500; }
.tabs { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; max-width: 220px; }
.tab { text-align: left; padding: 15px 22px; border-radius: 999px; background: rgba(255,255,255,0.7); border: 1px solid var(--line); font-weight: 600; color: var(--ink-soft); transition: 0.2s; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 3D car viewer */
.viewer { position: relative; perspective: 1600px; min-height: 340px; display: grid; place-items: center; }
.viewer-img {
  width: 100%; max-width: 640px; object-fit: contain; will-change: transform;
  transition: transform 0.15s ease-out;
  filter: drop-shadow(0 40px 40px rgba(20,22,28,0.28));
  -webkit-user-drag: none; user-select: none; cursor: grab;
}
.viewer.dragging .viewer-img { cursor: grabbing; transition: none; }
.viewer-placeholder { color: #aeb3bd; text-align: center; font-weight: 600; }
.viewer-placeholder svg { width: 120px; height: 120px; opacity: 0.4; margin-bottom: 10px; }
.spin-hint {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: rgba(255,255,255,0.8); padding: 6px 14px; border-radius: 999px; display: flex; align-items: center; gap: 6px;
}

.float-card {
  position: absolute; right: 0; top: 6%; width: 230px; padding: 18px;
  background: var(--accent); color: #fff; border-radius: 22px; box-shadow: var(--shadow);
}
.float-card .ttl { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.float-card p { color: #b9bcc4; font-size: 13px; line-height: 1.5; margin-top: 10px; }

.colors { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.colors .lbl { font-weight: 700; font-size: 14px; }
.swatch { width: 30px; height: 30px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: 0.2s; }
.swatch.active { transform: scale(1.18); box-shadow: 0 0 0 2px var(--accent); }

/* spec strip */
.spec-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 34px; }
.spec-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-sm); }
.spec-cell .k { font-size: 12px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 7px; }
.spec-cell .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 8px; }
.spec-cell .v small { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* detail lower */
.detail-low { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; margin: 48px 0 90px; }
.detail-low h4 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 14px; }
.detail-low p.desc { color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.feature-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; }
.feature-list li svg { color: var(--brand); flex-shrink: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.gallery img { aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; cursor: pointer; border: 1px solid var(--line); }
.buy-card { background: var(--accent); color: #fff; border-radius: 26px; padding: 30px; align-self: start; position: sticky; top: 96px; --brand: #ffffff; }
.buy-card .price-big { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.buy-card .price-big small { font-size: 15px; color: #b9bcc4; }
.buy-card .row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 14px; }
.buy-card .row span:first-child { color: #b9bcc4; }
.buy-card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.buy-card .btn-primary { background: var(--brand); color: #111216; padding: 15px; border-radius: 14px; font-weight: 700; text-align: center; }
.buy-card .btn-ghost { background: rgba(255,255,255,0.1); color: #fff; padding: 15px; border-radius: 14px; font-weight: 600; text-align: center; }

footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-soft); font-size: 14px; text-align: center; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10,11,14,0.92); z-index: 100; display: none; place-items: center; padding: 40px; }
.lightbox.show { display: grid; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 16px; }
.lightbox .close { position: absolute; top: 24px; right: 28px; color: #fff; font-size: 30px; }

/* ---------- PORTADA CINEMÁTICA ---------- */
.hero {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 110px 28px 0;
  background:
    radial-gradient(130% 90% at 72% 18%, #20242c 0%, #111419 42%, #08090c 100%);
  color: #fff;
  --brand: #ffffff; /* sobre fondo oscuro, el acento es blanco */
}
.catalog { padding-top: 24px; }
#catalog { scroll-margin-top: 76px; }

.hero-word {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  font-size: clamp(120px, 26vw, 460px); font-weight: 800; letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.035); white-space: nowrap; pointer-events: none;
  line-height: 1; user-select: none;
}
.hero-glow {
  position: absolute; right: 4%; top: 30%; width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 62%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2; flex: 1;
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 30px; align-items: center;
}
.hero-copy { max-width: 540px; animation: heroUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); padding: 9px 16px; border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--brand); }
.hero-title {
  font-size: clamp(46px, 6.4vw, 92px); line-height: 0.96; letter-spacing: -0.04em;
  font-weight: 800; margin: 22px 0 18px;
}
.hero-title em { font-style: normal; color: var(--brand); }
.hero-sub { color: rgba(255, 255, 255, 0.62); font-size: 18px; line-height: 1.6; max-width: 460px; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; }
.hero-btn { padding: 16px 30px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: 0.2s; }
.hero-btn.primary { background: var(--brand); color: #111216; }
.hero-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(255, 255, 255, 0.3); }
.hero-btn.ghost { background: rgba(255, 255, 255, 0.06); color: #fff; border: 1px solid rgba(255, 255, 255, 0.16); }
.hero-btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }

.hero-stage { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 46vh; min-width: 0; }
.hero-3d { position: relative; width: 100%; min-width: 0; max-width: 100%; height: min(60vh, 600px); cursor: grab; overflow: hidden; }
.hero-3d:active { cursor: grabbing; }
.hero-3d canvas { display: block; outline: none; width: 100% !important; height: 100% !important; }
.hero-3d-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 11px;
  color: rgba(255, 255, 255, 0.5); font-weight: 600; font-size: 14px; pointer-events: none;
}
.hero-3d-loading .spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand); border-radius: 999px; animation: spin 0.8s linear infinite;
}
.hero-3d-hint { margin-top: 4px; color: rgba(255, 255, 255, 0.42); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 0.6s; }
.hero-3d-hint.show { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-car {
  width: 100%; max-width: 760px; object-fit: contain; will-change: transform, opacity;
  filter: drop-shadow(0 50px 60px rgba(0, 0, 0, 0.55));
  transition: opacity 0.5s, transform 0.5s; animation: carIn 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-car.swap { opacity: 0; transform: translateX(40px) scale(0.97); }
.hero-car-meta {
  position: absolute; top: 4%; left: 2%; z-index: 3;
  background: rgba(12, 13, 16, 0.6); border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 18px; padding: 14px 18px; min-width: 180px;
}
.hero-car-meta .m { font-size: 12px; color: rgba(255, 255, 255, 0.5); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-car-meta .n { font-size: 19px; font-weight: 700; margin: 4px 0 8px; }
.hero-car-meta .p { font-size: 17px; font-weight: 800; color: var(--brand); }
.hero-dots { position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%); display: flex; gap: 9px; z-index: 3; }
.hero-dots button { width: 9px; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); transition: 0.2s; }
.hero-dots button.active { background: var(--brand); width: 26px; }

.hero-stats {
  position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: 26px 0; border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-stats strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats span { font-size: 13px; color: rgba(255, 255, 255, 0.5); font-weight: 500; }

.hero-scroll {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, 0.55);
  font-size: 13px; font-weight: 600;
}
.hero-scroll .mouse {
  width: 22px; height: 34px; border: 2px solid rgba(255, 255, 255, 0.35); border-radius: 14px; position: relative;
}
.hero-scroll .mouse::after {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; border-radius: 4px; background: var(--brand);
  animation: scrollDot 1.5s infinite;
}

@keyframes heroUp { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes carIn { from { opacity: 0; transform: translateX(60px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes scrollDot { 0% { opacity: 0; top: 6px; } 40% { opacity: 1; } 80% { opacity: 0; top: 18px; } 100% { opacity: 0; } }

/* tabs compartidos del panel admin */
.admin-tabs { display: flex; gap: 6px; margin: 0 0 26px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-tab { padding: 13px 20px; font-weight: 600; font-size: 14px; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.admin-tab:hover { color: var(--ink); }

/* modal de captura de lead */
.lead-overlay { position: fixed; inset: 0; background: rgba(10,11,14,0.6); z-index: 120; display: none; align-items: center; justify-content: center; padding: 20px; }
.lead-overlay.show { display: flex; }
.lead-modal { background: var(--surface); width: 100%; max-width: 440px; border-radius: 24px; padding: 30px; position: relative; box-shadow: var(--shadow); }
.lead-modal h3 { font-size: 22px; letter-spacing: -0.02em; }
.lead-modal > #lead-form-wrap > p { color: var(--ink-soft); font-size: 14px; margin: 6px 0 18px; }
.lead-close { position: absolute; top: 16px; right: 18px; font-size: 26px; color: var(--ink-soft); background: none; }
.lead-field { margin-bottom: 14px; }
.lead-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-soft); }
.lead-field input, .lead-field textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 15px; background: var(--surface); color: var(--ink); outline: none; }
.lead-field input:focus, .lead-field textarea:focus { border-color: var(--accent); }
.lead-submit { width: 100%; padding: 15px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; margin-top: 6px; }

/* reveal al hacer scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s, transform 0.8s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 920px) {
  .hero { padding-top: 96px; }
  .hero-inner { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .hero-copy { margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-eyebrow { margin: 0 auto; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-car-meta { display: none; }
  .stage-grid { grid-template-columns: 1fr; }
  .float-card { position: static; width: 100%; margin-top: 20px; }
  .tabs { flex-direction: row; flex-wrap: wrap; max-width: none; }
  .detail-low { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
