:root {
  --primario: #0f1e3d;
  --primario-claro: #1c3059;
  --acento: #e11d2e;
  --acento-hover: #c51626;
  --texto: #1c2333;
  --gris: #6b7280;
  --fondo: #f4f6fb;
  --blanco: #ffffff;
  --sombra: 0 10px 30px rgba(15, 30, 61, 0.10);
  --radio: 16px;
  --wa: #25d366;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  line-height: 1.6;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--primario);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blanco);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.brand span { color: var(--acento); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: #dbe3f2; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color .2s; }
.nav a:hover { color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-primary { background: var(--acento); color: #fff; box-shadow: 0 6px 18px rgba(225,29,46,0.35); }
.btn-primary:hover { background: var(--acento-hover); }
.btn-whatsapp { background: var(--wa); color: #fff; box-shadow: 0 6px 18px rgba(37,211,102,0.30); }
.btn-whatsapp:hover { background: #1fb958; }
.btn-ghost { background: transparent; border: 2px solid #c3cbe0; color: var(--texto); }
.btn-ghost:hover { border-color: var(--primario); }

.wa-icon {
  width: 15px; height: 15px; background: #fff; border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.4 0 0 5.4 0 12c0 2.1.6 4.2 1.6 6L0 24l6.2-1.6c1.7.9 3.6 1.4 5.8 1.4C18.6 23.8 24 18.4 24 12S18.6 0 12 0zm6 17.1c-.3.8-1.6 1.5-2.2 1.6-.6.1-1.3.1-2.1-.1-1.9-.6-4.7-2.6-6.7-5.4-2-2.8-2.5-4.1-2.6-4.9-.1-.6 0-1.4.5-2 .2-.3.6-.6.9-.6h.8c.3 0 .6-.1 1 .7.4.9 1.4 3.2 1.5 3.4.1.2.2.5 0 .8-.1.3-.4.6-.6.8l-.4.6c-.2.3-.5.6-.2 1.1.3.5 1.3 2.1 2.7 3.4 1.9 1.7 3.5 2.2 4 2.5.5.3.8.2 1.1-.1.3-.3 1.3-1.5 1.6-2 .3-.5.6-.4 1-.2.4.1 1.9.9 2.2 1.1.3.2.5.3.6.4.1.2.1.6-.1 1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.4 0 0 5.4 0 12c0 2.1.6 4.2 1.6 6L0 24l6.2-1.6c1.7.9 3.6 1.4 5.8 1.4C18.6 23.8 24 18.4 24 12S18.6 0 12 0zm6 17.1c-.3.8-1.6 1.5-2.2 1.6-.6.1-1.3.1-2.1-.1-1.9-.6-4.7-2.6-6.7-5.4-2-2.8-2.5-4.1-2.6-4.9-.1-.6 0-1.4.5-2 .2-.3.6-.6.9-.6h.8c.3 0 .6-.1 1 .7.4.9 1.4 3.2 1.5 3.4.1.2.2.5 0 .8-.1.3-.4.6-.6.8l-.4.6c-.2.3-.5.6-.2 1.1.3.5 1.3 2.1 2.7 3.4 1.9 1.7 3.5 2.2 4 2.5.5.3.8.2 1.1-.1.3-.3 1.3-1.5 1.6-2 .3-.5.6-.4 1-.2.4.1 1.9.9 2.2 1.1.3.2.5.3.6.4.1.2.1.6-.1 1z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 24px; height: 3px; background: #fff; border-radius: 3px; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primario) 0%, var(--primario-claro) 100%);
  color: #fff;
  padding: 90px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225,29,46,0.35), transparent 70%);
  top: -120px; right: -120px;
}
.hero-inner { position: relative; z-index: 2; max-width: 640px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -1px; margin-bottom: 18px; }
.hero-sub { font-size: 1.15rem; color: #c4cfe6; margin-bottom: 30px; }

/* ---------- Filtros ---------- */
.filtros {
  margin-top: -56px;
  position: relative;
  z-index: 5;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 24px 28px;
}
.filtros-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 16px; align-items: end; }
.filtro label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--gris); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.filtro select {
  width: 100%; padding: 12px 14px; border: 2px solid #e1e6f1; border-radius: 10px;
  font-size: 0.95rem; background: #fafbfe; color: var(--texto); cursor: pointer; transition: border .2s;
}
.filtro select:focus { outline: none; border-color: var(--primario); }
.result-count { margin-top: 14px; font-size: 0.9rem; color: var(--gris); font-weight: 600; }

/* ---------- Catálogo ---------- */
.catalogo { padding-top: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; align-items: stretch; }

.card {
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(15,30,61,0.16); }

.card-foto { position: relative; aspect-ratio: 16/10; background: #e4e8f2; overflow: hidden; }
.card-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-foto img { transform: scale(1.06); }
.sin-foto { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.2rem; opacity: .4; }
.foto-count {
  position: absolute; bottom: 10px; right: 10px; background: rgba(15,30,61,0.8); color: #fff;
  font-size: 0.72rem; font-weight: 600; padding: 4px 9px; border-radius: 20px;
}
.etiqueta {
  position: absolute; top: 12px; left: 12px; background: #10b981; color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 5px 11px; border-radius: 20px; letter-spacing: .04em;
}
.etiqueta.vendido { background: #6b7280; }

.card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.card-titulo { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px; }
.card-meta { color: var(--gris); font-size: 0.9rem; margin-top: 2px; }
.unidades {
  display: inline-block;
  margin-top: 6px;
  background: var(--primario-claro); color: #9bd1ff;
  font-size: 0.74rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; letter-spacing: .02em;
}
.detalle-info .unidades { margin: 8px 0 0; }
.card-precio { font-size: 1.6rem; font-weight: 800; color: var(--acento); margin: 10px 0 12px; }
.card-specs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card-specs li {
  font-size: 0.78rem; background: var(--fondo); color: var(--primario); font-weight: 600;
  padding: 5px 11px; border-radius: 8px;
}
.card-desc {
  color: var(--gris); font-size: 0.9rem; margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-actions { margin-top: auto; }
.card-actions .btn { width: 100%; }

.vacio { text-align: center; color: var(--gris); padding: 40px 0; font-size: 1.05rem; }

/* ---------- Cómo funciona ---------- */
.como-funciona { padding: 70px 0 40px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 34px; text-align: center; }
.pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.paso { background: var(--blanco); border-radius: var(--radio); padding: 32px 26px; box-shadow: var(--sombra); text-align: center; }
.paso-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; background: var(--primario); color: #fff;
  font-weight: 800; font-size: 1.2rem; margin-bottom: 16px;
}
.paso h3 { font-size: 1.1rem; margin-bottom: 8px; }
.paso p { color: var(--gris); font-size: 0.92rem; }

/* ---------- Contacto ---------- */
.contacto { background: var(--primario); color: #fff; padding: 70px 0; margin-top: 40px; }
.contacto .section-title { color: #fff; }
.contacto-sub { text-align: center; color: #c4cfe6; margin-bottom: 28px; font-size: 1.05rem; }
.contacto-actions { display: flex; justify-content: center; margin-bottom: 26px; }
.contacto-info { text-align: center; font-style: normal; color: #dbe3f2; line-height: 1.9; }

/* ---------- Footer ---------- */
.site-footer { background: #0a142b; color: #93a0c4; padding: 26px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner .brand { font-size: 1.1rem; }
.footer-inner p { font-size: 0.85rem; }

/* ---------- Floating WhatsApp ---------- */
.floating-wa { position: fixed; bottom: 22px; right: 22px; z-index: 60; }
.floating-wa a {
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%; background: var(--wa);
  box-shadow: 0 8px 24px rgba(37,211,102,0.45); transition: transform .2s;
}
.floating-wa a:hover { transform: scale(1.08); }
.floating-wa .wa-icon { width: 30px; height: 30px; }

/* ---------- Modal detalle ----------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
}
.modal.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(10,20,43,0.72);
  backdrop-filter: blur(3px);
}
.modal-box {
  position: absolute; inset: 0; margin: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.modal-content {
  pointer-events: auto;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  width: 100%; max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}
.modal-close {
  position: sticky; top: 0;
  z-index: 8;
  align-self: flex-end;
  background: var(--primario); color: #fff;
  border: none; width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 10px 10px 0 0;
}
body.no-scroll { overflow: hidden; }

.detalle { display: grid; grid-template-columns: 1.25fr 1fr; }
.detalle-fotos { position: relative; background: #0b1633; display: flex; align-items: center; min-height: 320px; }
.detalle-fotos img { width: 100%; height: auto; display: block; max-height: 78vh; }
.gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.85); border: none;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.6rem; font-weight: 700; color: var(--primario);
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  z-index: 2;
}
.gal-btn:hover { background: #fff; }
.gal-prev { left: 10px; }
.gal-next { right: 10px; }
.gal-count {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(15,30,61,0.8); color: #fff;
  font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: 20px;
}
.detalle-info { padding: 24px 26px 28px; }
.detalle-info h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.4px; }
.detalle-meta { color: var(--gris); font-size: 0.92rem; margin-top: 2px; }
.detalle-precio { font-size: 1.8rem; font-weight: 800; color: var(--acento); margin: 12px 0 14px; }
.detalle-specs {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.detalle-specs li {
  font-size: 0.82rem; background: var(--fondo); color: var(--primario); font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.detalle-desc { color: var(--gris); font-size: 0.95rem; margin-bottom: 20px; }
.detalle-info .btn { width: 100%; }
.detalle-minis {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
  padding: 0 22px 22px;
  background: var(--blanco);
}
.detalle-minis img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 8px; cursor: pointer; opacity: .75;
  border: 2px solid transparent; transition: .2s;
}
.detalle-minis img:hover { opacity: 1; }
.detalle-minis img.activa { opacity: 1; border-color: var(--acento); }

@media (max-width: 820px) {
  .detalle { grid-template-columns: 1fr; }
  .detalle-fotos { min-height: 220px; }
  .modal-box { padding: 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .filtros-grid { grid-template-columns: 1fr 1fr; }
  .pasos { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--primario);
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 18px 20px 26px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav .btn { margin-top: 10px; }
  .filtros-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 90px; }
}
