/* ─────────────────────────────────────────────
   XIFOO · Web pública · Sistema base
   ───────────────────────────────────────────── */

:root {
  /* paleta — Xifoo blue #0b8de8 */
  --primary:        #0b8de8;
  --primary-hover:  #0876c4;
  --primary-ink:    #0a4a7a;
  --primary-soft:   #e6f3fc;
  --primary-light:  #79bff0;

  --bg:             #ffffff;
  --bg-soft:        oklch(0.985 0.005 210);
  --bg-section:     oklch(0.96 0.008 210);
  --bg-dark:        oklch(0.18 0.025 215);

  --border:         oklch(0.92 0.008 220);
  --border-strong:  oklch(0.86 0.010 220);

  --ink:            oklch(0.20 0.015 220);
  --body:           oklch(0.40 0.012 220);
  --muted:          oklch(0.55 0.010 220);
  --faint:          oklch(0.72 0.008 220);

  --green:          oklch(0.62 0.13 155);
  --red:            oklch(0.60 0.15 25);
  --warm:           oklch(0.70 0.12 55);

  /* radios */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* sombra */
  --shadow-sm: 0 1px 2px rgba(20,30,40,0.04);
  --shadow-md: 0 8px 30px -12px rgba(20,30,40,0.12);
  --shadow-lg: 0 30px 80px -30px rgba(20,30,40,0.20);

  /* contenedor */
  --container: 1280px;
}

/* ── reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ── tipografía ── */
.serif-italic {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
.mono { font-family: "JetBrains Mono", monospace; }

/* ── container ── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

/* ── botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  font-size: 15px; font-weight: 600;
  border-radius: var(--r-md);
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-dark {
  background: var(--ink); color: #fff;
}
.btn-dark:hover { background: oklch(0.10 0.02 220); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink); }

/* ── eyebrow ── */
.eyebrow {
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(1 0 0 / 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.footer .brand-logo {
  height: 32px;
  filter: brightness(0) invert(1);
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 15px; font-weight: 500; color: var(--body);
  transition: color 0.15s;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active { font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions a { font-size: 15px; font-weight: 500; color: var(--body); }
.header-actions a:hover { color: var(--ink); }

/* ─────────────────────────────────────────────
   SECTION HEADERS
   ───────────────────────────────────────────── */
.section-header {
  display: flex; align-items: end; justify-content: space-between; gap: 32px;
  margin-bottom: 40px;
}
.section-title {
  font-size: 44px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}
.section-desc {
  font-size: 17px; color: var(--body);
  line-height: 1.5;
  max-width: 480px;
}

/* ─────────────────────────────────────────────
   CARDS DE PROPIEDAD
   ───────────────────────────────────────────── */
.prop-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex; flex-direction: column;
}
.prop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.prop-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.prop-badge {
  position: absolute; top: 14px; left: 14px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: oklch(0 0 0 / 0.5);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.prop-fav {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: oklch(1 0 0 / 0.9);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s;
}
.prop-fav:hover { transform: scale(1.08); }
.prop-fav.is-fav { color: var(--red); }
.prop-fav.is-fav svg { fill: var(--red); }

.prop-body { padding: 20px; display: flex; flex-direction: column; gap: 0; flex: 1; }
.prop-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.prop-price {
  font-size: 24px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.prop-type {
  font-size: 11px; color: var(--muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.prop-addr { font-size: 16px; color: var(--body); margin-bottom: 16px; }
.prop-meta {
  display: flex; gap: 16px; align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}
.prop-meta-item { display: flex; align-items: center; gap: 6px; }
.prop-meta-item svg { color: var(--muted); }
.prop-meta-cta {
  margin-left: auto; color: var(--primary); font-weight: 600;
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 6px;
}

/* placeholders de imagen "edificio" */
.ph-img {
  position: relative; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--ph-a, oklch(0.74 0.06 200)) 0%, var(--ph-b, oklch(0.55 0.08 215)) 100%);
}
.ph-img::before, .ph-img::after {
  content: ''; position: absolute; bottom: 0;
  background: oklch(0.25 0.04 215 / 0.45); border-radius: 4px 4px 0 0;
}
.ph-img::before { left: 18%; width: 28%; height: 55%; box-shadow: 38% 0 oklch(0.30 0.04 215 / 0.45), 64% 0 oklch(0.27 0.04 215 / 0.45); }
.ph-img::after  { left: 28%; width: 44%; height: 70%; }
.ph-h0 { --ph-a: oklch(0.74 0.06 200); --ph-b: oklch(0.55 0.08 215); }
.ph-h1 { --ph-a: oklch(0.78 0.05 75);  --ph-b: oklch(0.62 0.09 60); }
.ph-h2 { --ph-a: oklch(0.72 0.05 155); --ph-b: oklch(0.50 0.08 165); }
.ph-h3 { --ph-a: oklch(0.75 0.06 280); --ph-b: oklch(0.55 0.09 260); }
.ph-h4 { --ph-a: oklch(0.78 0.04 40);  --ph-b: oklch(0.55 0.10 30); }
.ph-h5 { --ph-a: oklch(0.70 0.06 230); --ph-b: oklch(0.45 0.09 240); }

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
.footer {
  margin-top: 120px;
  background: var(--bg-dark);
  color: oklch(0.82 0.02 215);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px 32px 40px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid oklch(0.30 0.04 215);
}
.footer-tag {
  font-size: 16px; line-height: 1.5;
  color: oklch(0.78 0.02 215);
  margin-top: 18px;
  max-width: 280px;
}
.footer h4 {
  font-size: 12px; font-weight: 600;
  color: oklch(0.65 0.02 215);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a {
  font-size: 15px; color: oklch(0.85 0.02 215);
  transition: color 0.15s;
}
.footer-links a:hover { color: #fff; }

.newsletter {
  display: flex; gap: 0;
  background: oklch(0.24 0.04 215);
  border: 1px solid oklch(0.32 0.04 215);
  border-radius: var(--r-md);
  padding: 4px;
  margin-top: 4px;
}
.newsletter input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 12px 14px; color: #fff;
  font-size: 14px;
}
.newsletter input::placeholder { color: oklch(0.60 0.02 215); }
.newsletter button {
  background: var(--primary-light); color: var(--bg-dark);
  font-weight: 600; padding: 10px 18px;
  border-radius: 8px; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.newsletter button:hover { background: oklch(0.82 0.08 250); }

.footer-bottom {
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: oklch(0.65 0.02 215);
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a:hover { color: #fff; }

/* ─────────────────────────────────────────────
   ICON UTILS
   ───────────────────────────────────────────── */
.ic-chip {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ic-chip-lg { width: 56px; height: 56px; }
.ic-chip-dark {
  background: oklch(0.24 0.04 215);
  border: 1px solid oklch(0.32 0.04 215);
  color: var(--primary-light);
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav { display: none; }
  .section-header { flex-direction: column; align-items: start; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .section-title { font-size: 32px; }
}

/* Chatbot — markdown rendering */
.cb-msg-ai a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.cb-msg-ai a:hover { color: var(--primary-hover); }
.cb-msg-ai ul, .cb-msg-ai ol { padding-left: 18px; }
.cb-msg-ai li { margin: 2px 0; }
.cb-msg-ai strong { font-weight: 600; color: var(--ink); }
.cb-msg-user a { color: #fff; text-decoration: underline; }
