/* =============================================================
   ALTURA — hoja de estilos única
   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Componentes
   6 Navegación · 7 Secciones · 8 Panel finca · 9 Mercado
   10 Efectos · 11 Responsive · 12 Movimiento reducido
   ============================================================= */

/* =============================================================
   1. TOKENS — modo claro por defecto; oscuro por sistema o elección
   ============================================================= */
:root {
  /* --- CLARO: blanco + dorado --- */
  --bg:          #fbfaf7;
  --bg-2:        #f4f1e9;
  --bg-3:        #ece7db;
  --surface:     #ffffff;
  --surface-2:   #fbf9f4;

  --ink:         #14120e;
  --ink-2:       #3d372c;
  --ink-mute:    #736c5e;

  --gold:        #96701f;
  --gold-text:   #7d5c13;   /* dorado oscurecido: texto pequeño sobre claro */
  --gold-2:      #b98f36;
  --gold-3:      #d9b660;
  --gold-soft:   rgba(150, 112, 31, 0.10);
  --gold-line:   rgba(150, 112, 31, 0.28);

  --line:        rgba(20, 18, 14, 0.13);
  --line-soft:   rgba(20, 18, 14, 0.07);

  --up:          #2f7d4f;
  --down:        #a8342a;
  --warn:        #9a6a12;

  --shadow-sm:   0 1px 2px rgba(20,18,14,.05), 0 4px 14px rgba(20,18,14,.05);
  --shadow-md:   0 2px 6px rgba(20,18,14,.06), 0 18px 44px -18px rgba(20,18,14,.18);
  --shadow-lg:   0 4px 10px rgba(20,18,14,.07), 0 40px 90px -30px rgba(20,18,14,.28);

  --aurora-1:    rgba(217, 182, 96, 0.55);
  --aurora-2:    rgba(150, 112, 31, 0.24);
  --aurora-3:    rgba(120, 140, 110, 0.18);
  --aurora-opacity: .55;
  --grain-opacity: .30;
  --ph-1:        #efe9da;
  --ph-2:        #e2d7bd;
  --scrim:       linear-gradient(180deg, rgba(251,250,247,0) 30%, rgba(251,250,247,.86) 82%, var(--bg) 100%);

  /* --- constantes de marca --- */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);

  --nav-h: 74px;
  --radius:    14px;
  --radius-lg: 22px;
  --gutter: clamp(1.15rem, 4vw, 3.5rem);
  --maxw: 1300px;
}

/* --- OSCURO por preferencia del sistema (salvo que se fuerce claro) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0a0908;
    --bg-2:      #100e0b;
    --bg-3:      #17140f;
    --surface:   #141210;
    --surface-2: #1b1813;

    --ink:       #f3ecdf;
    --ink-2:     #cec5b2;
    --ink-mute:  #8d8474;

    --gold:      #d8b264;
    --gold-text: #e6c88a;
    --gold-2:    #efd7a0;
    --gold-3:    #f2dda6;
    --gold-soft: rgba(216, 178, 100, 0.13);
    --gold-line: rgba(216, 178, 100, 0.30);

    --line:      rgba(243, 236, 223, 0.13);
    --line-soft: rgba(243, 236, 223, 0.07);

    --up:        #62c48c;
    --down:      #e0705f;
    --warn:      #e2b46a;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.32);
    --shadow-md: 0 2px 6px rgba(0,0,0,.45), 0 18px 44px -18px rgba(0,0,0,.75);
    --shadow-lg: 0 4px 10px rgba(0,0,0,.5), 0 40px 90px -30px rgba(0,0,0,.85);

    --aurora-1:  rgba(216, 178, 100, 0.34);
    --aurora-2:  rgba(150, 112, 31, 0.30);
    --aurora-3:  rgba(90, 120, 95, 0.20);
    --aurora-opacity: .85;
    --grain-opacity: .42;
    --ph-1:      #1c1813;
    --ph-2:      #2a231a;
    --scrim:     linear-gradient(180deg, rgba(10,9,8,0) 28%, rgba(10,9,8,.88) 80%, var(--bg) 100%);
  }
}

/* --- OSCURO forzado por el usuario --- */
:root[data-theme="dark"] {
  --bg:        #0a0908;
  --bg-2:      #100e0b;
  --bg-3:      #17140f;
  --surface:   #141210;
  --surface-2: #1b1813;

  --ink:       #f3ecdf;
  --ink-2:     #cec5b2;
  --ink-mute:  #8d8474;

  --gold:      #d8b264;
  --gold-text: #e6c88a;
  --gold-2:    #efd7a0;
  --gold-3:    #f2dda6;
  --gold-soft: rgba(216, 178, 100, 0.13);
  --gold-line: rgba(216, 178, 100, 0.30);

  --line:      rgba(243, 236, 223, 0.13);
  --line-soft: rgba(243, 236, 223, 0.07);

  --up:        #62c48c;
  --down:      #e0705f;
  --warn:      #e2b46a;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.32);
  --shadow-md: 0 2px 6px rgba(0,0,0,.45), 0 18px 44px -18px rgba(0,0,0,.75);
  --shadow-lg: 0 4px 10px rgba(0,0,0,.5), 0 40px 90px -30px rgba(0,0,0,.85);

  --aurora-1:  rgba(216, 178, 100, 0.34);
  --aurora-2:  rgba(150, 112, 31, 0.30);
  --aurora-3:  rgba(90, 120, 95, 0.20);
  --aurora-opacity: .85;
  --grain-opacity: .42;
  --ph-1:      #1c1813;
  --ph-2:      #2a231a;
  --scrim:     linear-gradient(180deg, rgba(10,9,8,0) 28%, rgba(10,9,8,.88) 80%, var(--bg) 100%);
}

/* =============================================================
   2. RESET & BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  color-scheme: light dark;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  transition: background-color .5s var(--ease-out), color .5s var(--ease-out);
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  text-wrap: balance;
  line-height: 1.04;
  letter-spacing: -0.018em;
}
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--gold); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Transiciones de página */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .5s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   3. UTILIDADES
   ============================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 900px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--ink); color: var(--bg);
  border-radius: 10px; font-weight: 600; font-size: .9rem;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-text);
  display: inline-flex; align-items: center; gap: .6rem;
}
.kicker::before {
  content: ""; width: 26px; height: 1px; background: var(--gold-line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-mute);
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.gold { color: var(--gold-text); }
.mute { color: var(--ink-mute); }

.divider { height: 1px; background: var(--line); border: 0; }

/* Revelado al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }

/* =============================================================
   4. TIPOGRAFÍA
   ============================================================= */
.display-xl {
  font-size: clamp(2.9rem, 8.2vw, 6.6rem);
  line-height: .98;
  letter-spacing: -0.03em;
}
.display-lg { font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.02; }
.display-md { font-size: clamp(1.65rem, 3.4vw, 2.6rem); line-height: 1.08; }
.display-sm { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.18; }

em, .it { font-style: italic; }
.hl { color: var(--gold); font-style: italic; }

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  color: var(--ink-2);
  max-width: 58ch;
}
.body-sm { font-size: .9rem; color: var(--ink-mute); }

.section-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }
.section-head .lead { margin-top: .2rem; }

/* =============================================================
   5. COMPONENTES
   ============================================================= */

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .92rem 1.7rem;
  border-radius: 999px;
  font-size: .93rem; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft),
              background-color .35s var(--ease-out), color .35s var(--ease-out),
              border-color .35s var(--ease-out);
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); transition-duration: .1s; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #17130a;
  box-shadow: 0 4px 16px -4px var(--gold-soft);
}
:root[data-theme="dark"] .btn-gold,
:root:not([data-theme="light"]) .btn-gold { color: #100d07; }
.btn-gold:hover { box-shadow: 0 22px 46px -18px rgba(150,112,31,.6); }

.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold-line); color: var(--gold); }

.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { box-shadow: var(--shadow-md); }

.btn-sm { padding: .6rem 1.1rem; font-size: .84rem; }

/* --- Tarjetas --- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft), border-color .4s var(--ease-out);
  isolation: isolate;
  overflow: hidden;
}
.card--pad { padding: clamp(1.4rem, 2.6vw, 2.2rem); }

.card--hover:hover {
  transform: translateY(-5px);
  border-color: var(--gold-line);
  box-shadow: var(--shadow-lg);
}

/* Halo dorado que sigue al cursor */
.has-halo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(280px circle at var(--hx, 50%) var(--hy, 50%), var(--gold-soft), transparent 68%);
  opacity: 0; transition: opacity .45s var(--ease-out);
  pointer-events: none;
}
.has-halo:hover::before { opacity: 1; }

/* Inclinación 3D sutil */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty, 0));
  transform-style: preserve-3d;
}

/* --- Insignias / chips --- */
.badge {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .26rem .62rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  white-space: nowrap;
}
.badge--gold { border-color: var(--gold-line); color: var(--gold-text); background: var(--gold-soft); }
.badge--up   { border-color: color-mix(in srgb, var(--up) 40%, transparent); color: var(--up); }
.badge--warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.badge--down { border-color: color-mix(in srgb, var(--down) 40%, transparent); color: var(--down); }

.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent);
  animation: pulseLive 2.4s var(--ease-out) infinite;
  flex: none;
}
@keyframes pulseLive {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- Marcos de imagen (marcador de posición) --- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(.92) contrast(1.04);
  transition: transform 1.1s var(--ease-soft), filter .6s var(--ease-out);
}
.frame--zoom:hover img { transform: scale(1.05); filter: saturate(1.02) contrast(1.06); }

/* En oscuro las fotos se atenúan para no competir con el dorado */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .frame img { filter: saturate(.8) brightness(.78) contrast(1.1); }
  :root:not([data-theme="light"]) .frame--zoom:hover img { filter: saturate(.9) brightness(.86) contrast(1.1); }
}
:root[data-theme="dark"] .frame img { filter: saturate(.8) brightness(.78) contrast(1.1); }
:root[data-theme="dark"] .frame--zoom:hover img { filter: saturate(.9) brightness(.86) contrast(1.1); }

/* Velo degradado para que el texto encima siempre se lea */
.frame--veil { position: relative; }
.frame--veil::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--bg) 72%, transparent) 100%);
}

.ph {
  position: relative;
  width: 100%; height: 100%;
  background:
    linear-gradient(135deg, var(--ph-1) 0%, var(--ph-2) 58%, var(--ph-1) 100%);
  display: grid; place-items: center;
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, var(--gold-soft) 14px 15px);
  opacity: .5;
}
.ph::after {
  content: attr(data-ph);
  position: relative;
  font-family: var(--mono);
  font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .4rem .8rem;
  border-radius: 999px;
  max-width: 82%;
  text-align: center;
  line-height: 1.4;
}

.ratio-hero   { aspect-ratio: 16 / 9; }
.ratio-wide   { aspect-ratio: 3 / 2; }
.ratio-square { aspect-ratio: 1 / 1; }
.ratio-tall   { aspect-ratio: 4 / 5; }

/* --- Campos de formulario --- */
.field { display: grid; gap: .42rem; }
.field label {
  font-family: var(--mono);
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-mute);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: .78rem .95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.field select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}

/* --- Formularios de la aplicación --- */
.form-card {
  display: grid; gap: 1rem;
  padding: clamp(1.4rem, 3vw, 2.1rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 540px) { .form-grid { grid-template-columns: 1fr 1fr; } }

.check-row { display: flex; flex-wrap: wrap; gap: .55rem .9rem; }
.check {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .88rem; color: var(--ink-2);
  padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: border-color .3s var(--ease-out), color .3s var(--ease-out);
}
.check:hover { border-color: var(--gold-line); color: var(--ink); }
.check input { accent-color: var(--gold); }

/* --- Avisos --- */
.aviso {
  display: flex; gap: .85rem; align-items: flex-start; flex-wrap: wrap;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 1.4rem;
}
.aviso p { font-size: .92rem; color: var(--ink-2); margin: 0; flex: 1 1 240px; }
.aviso--ok    { border-left-color: var(--up); }
.aviso--error { border-left-color: var(--down); }
.aviso--info  { border-left-color: var(--gold); }

/* Formulario de pedido dentro de una oferta */
.pedir-form { display: flex; gap: .5rem; align-items: center; }
.pedir-form .stock-row-input { width: 110px; }

@media (min-width: 960px) { [data-wide-only] { display: inline-flex !important; } }

/* --- Tablas de datos --- */
.table-wrap { overflow-x: auto; overflow-y: visible; max-width: 100%; border-radius: var(--radius); }
.data-table { font-size: .9rem; min-width: 720px; }
.data-table thead th {
  text-align: left;
  padding: .8rem 1rem;
  font-family: var(--mono);
  font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
.data-table tbody td {
  padding: .92rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.data-table tbody tr { transition: background-color .3s var(--ease-out); }
.data-table tbody tr:hover { background: var(--gold-soft); }
.data-table .t-num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .t-strong { font-weight: 600; }

/* =============================================================
   6. NAVEGACIÓN
   ============================================================= */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 300;
  background: transparent; pointer-events: none;
}
.progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-3));
  transform-origin: 0 50%; transform: scaleX(0);
}

.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.2rem;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease-out), background-color .4s var(--ease-out);
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--serif); font-size: 1.14rem; font-weight: 600;
  letter-spacing: -.02em; margin-right: auto;
}
.nav-mark {
  width: 26px; height: 26px; flex: none;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .68rem; font-weight: 700; color: #14100a;
}
.nav-links { display: none; align-items: center; gap: 1.9rem; }
.nav-links a { font-size: .89rem; color: var(--ink-2); position: relative; padding-block: .2rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--gold);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-soft);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links a[aria-current="page"] { color: var(--gold); }
.nav-actions { display: flex; align-items: center; gap: .7rem; }

/* Selector de tema (3 estados) */
.theme-switch {
  display: inline-flex; align-items: center;
  padding: 3px; gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.theme-switch button {
  width: 30px; height: 26px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--ink-mute);
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.theme-switch button svg { width: 14px; height: 14px; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold); }

.nav-toggle {
  display: grid; gap: 5px; width: 40px; height: 40px;
  place-content: center;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.5px; background: var(--ink);
  transition: transform .35s var(--ease-out), opacity .3s var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 190;
  display: grid; gap: .3rem;
  padding: 1.4rem var(--gutter) 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .5s var(--ease-out);
}
.nav-mobile.is-open { clip-path: inset(0 0 0 0); }
.nav-mobile a {
  font-family: var(--serif); font-size: 1.5rem;
  padding-block: .55rem;
  border-bottom: 1px solid var(--line-soft);
}
.nav-mobile .btn { margin-top: 1rem; }

/* =============================================================
   7. SECCIONES
   ============================================================= */
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt { background: var(--bg-2); }

/* --- Aurora dorada --- */
@property --aur-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --aur-x { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --aur-y { syntax: "<percentage>"; inherits: false; initial-value: 45%; }

.aurora {
  position: absolute; inset: -22% -12% 0 -12%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(58% 46% at var(--aur-x) var(--aur-y), var(--aurora-1), transparent 62%),
    radial-gradient(44% 40% at calc(var(--aur-x) + 22%) calc(var(--aur-y) + 16%), var(--aurora-3), transparent 66%),
    conic-gradient(from var(--aur-a) at 60% 40%, var(--aurora-2), transparent 32%, var(--aurora-1), transparent 68%, var(--aurora-2));
  filter: blur(88px) saturate(125%);
  opacity: var(--aurora-opacity);
  animation: auroraDrift 26s linear infinite;
}
@keyframes auroraDrift {
  0%   { --aur-a: 0deg;   --aur-x: 42%; --aur-y: 38%; }
  50%  { --aur-a: 180deg; --aur-x: 62%; --aur-y: 52%; }
  100% { --aur-a: 360deg; --aur-x: 42%; --aur-y: 38%; }
}

/* Grano */
.grain {
  position: fixed; inset: 0; z-index: 400; pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.42 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* --- HERO --- */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
  overflow: clip;
  isolation: isolate;
}
.hero-inner { position: relative; z-index: 2; }
.hero-grid { display: grid; gap: clamp(2rem, 4vw, 3.4rem); align-items: end; }

.hero-title { margin-block: 1.3rem 1.5rem; }
.hero-title span {
  display: block;
  opacity: 0;
  transform: translateY(38px);
  animation: heroLine 1.15s var(--ease-out) forwards;
}
.hero-title span:nth-child(1) { animation-delay: .12s; }
.hero-title span:nth-child(2) { animation-delay: .26s; }
.hero-title span:nth-child(3) { animation-delay: .40s; }
@keyframes heroLine { to { opacity: 1; transform: none; } }

.hero-sub { animation: heroLine 1.15s var(--ease-out) .52s forwards; opacity: 0; transform: translateY(24px); }
.hero-cta {
  display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem;
  animation: heroLine 1.15s var(--ease-out) .64s forwards; opacity: 0; transform: translateY(24px);
}

.hero-figure { position: relative; }
.hero-figure .frame { box-shadow: var(--shadow-lg); }

/* Tarjeta de mercado flotante sobre el hero */
.hero-ticker {
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: heroLine 1.2s var(--ease-out) .78s forwards; opacity: 0; transform: translateY(30px);
}
.hero-ticker-head {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.hero-ticker-head strong { font-family: var(--sans); font-size: .84rem; font-weight: 700; letter-spacing: -.01em; }
.hero-ticker-head .eyebrow { margin-left: auto; }
.ticker-rows { display: grid; }
.ticker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 1rem;
  align-items: center;
  padding: .78rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .4s var(--ease-out);
}
.ticker-row:last-child { border-bottom: 0; }
.ticker-row.is-flash { background: var(--gold-soft); }
.ticker-var { font-weight: 600; font-size: .92rem; }
.ticker-meta { font-family: var(--mono); font-size: .7rem; color: var(--ink-mute); letter-spacing: .04em; }
.ticker-price { font-family: var(--mono); font-size: 1rem; font-weight: 600; text-align: right; }
.ticker-delta { font-family: var(--mono); font-size: .68rem; text-align: right; }
.ticker-delta.up { color: var(--up); }
.ticker-delta.down { color: var(--down); }

/* --- Banda de métricas --- */
.stats { border-block: 1px solid var(--line); background: var(--bg-2); }
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
}
.stat {
  background: var(--bg-2);
  padding: clamp(1.5rem, 3.4vw, 2.6rem) clamp(1rem, 2vw, 1.8rem);
  display: grid; gap: .3rem;
}
.stat-value {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 500; letter-spacing: -.03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .82rem; color: var(--ink-mute); }

/* --- Pasos --- */
.steps { display: grid; gap: clamp(1.2rem, 2.4vw, 1.6rem); counter-reset: step; }
.step {
  position: relative;
  display: grid; gap: .7rem;
  padding: clamp(1.5rem, 2.8vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .4s var(--ease-out), transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.step:hover { border-color: var(--gold-line); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-num {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  color: var(--gold-text);
}
.step h3 { font-size: 1.32rem; }
.step p { color: var(--ink-mute); font-size: .95rem; }

/* --- Doble perfil --- */
.profiles { display: grid; gap: clamp(1.4rem, 3vw, 2rem); }
.profile {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .45s var(--ease-out), box-shadow .5s var(--ease-soft), transform .5s var(--ease-soft);
}
.profile:hover { border-color: var(--gold-line); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.profile-media { position: relative; }
.profile-media .frame { border: 0; border-radius: 0; height: 100%; }
.profile-body { padding: clamp(1.6rem, 3.2vw, 2.8rem); display: grid; align-content: start; gap: 1.1rem; }
.profile-body h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.profile-list { display: grid; gap: .68rem; margin-top: .2rem; }
.profile-list li { display: flex; gap: .7rem; align-items: flex-start; font-size: .93rem; color: var(--ink-2); }
.profile-list li::before {
  content: ""; flex: none; margin-top: .52rem;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
}

/* --- Trazabilidad (línea de tiempo) --- */
.timeline { display: grid; gap: 0; position: relative; }
.tl-item {
  display: grid; gap: .5rem;
  padding: 1.5rem 0 1.5rem 2.3rem;
  border-left: 1px solid var(--line);
  position: relative;
}
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 1.95rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--gold);
}
.tl-item:last-child { border-left-color: transparent; }
.tl-item h4 { font-family: var(--sans); font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.tl-item p { font-size: .9rem; color: var(--ink-mute); }
.tl-code { font-family: var(--mono); font-size: .68rem; color: var(--gold-text); letter-spacing: .08em; }

/* --- Marquesina --- */
.marquee {
  position: relative; overflow: hidden;
  padding-block: 1.15rem;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(50px, 10vw, 140px); z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--bg-2), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--bg-2), transparent); }
.marquee-track {
  display: flex; gap: 2.6rem; white-space: nowrap; width: max-content;
  animation: marqueeSlide 42s linear infinite;
}
.marquee-item {
  display: inline-flex; align-items: center; gap: 2.6rem;
  font-family: var(--serif); font-size: clamp(1.05rem, 2vw, 1.5rem);
  color: var(--ink-2);
}
.marquee-item::after { content: "✦"; color: var(--gold); font-size: .6em; }
@keyframes marqueeSlide { to { transform: translateX(-50%); } }

/* --- Planes de suscripción (fincas) --- */
.plans { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); align-items: stretch; }
.plan {
  position: relative;
  display: grid; align-content: start; gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft), border-color .4s var(--ease-out);
}
.plan:hover { transform: translateY(-5px); border-color: var(--gold-line); box-shadow: var(--shadow-lg); }
.plan--featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-soft), var(--shadow-md);
}
.plan-flag {
  position: absolute; top: -1px; right: clamp(1.2rem, 3vw, 2rem);
  transform: translateY(-50%);
  padding: .3rem .8rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #14100a;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700;
}
.plan-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.plan-for { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.plan-price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.plan-price b {
  font-family: var(--serif); font-size: clamp(2.1rem, 4.6vw, 3rem); font-weight: 500;
  letter-spacing: -.03em; color: var(--gold); line-height: 1;
}
.plan-price span { font-size: .85rem; color: var(--ink-mute); }
.plan-list { display: grid; gap: .58rem; }
.plan-list li { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; color: var(--ink-2); }
.plan-list li::before {
  content: "✓"; flex: none; color: var(--gold); font-size: .8rem; line-height: 1.6; font-weight: 700;
}
.plan-list li.off { color: var(--ink-mute); opacity: .65; }
.plan-list li.off::before { content: "—"; color: var(--ink-mute); font-weight: 400; }
.plan .btn { width: 100%; margin-top: .3rem; }

.plan--free {
  border-style: dashed;
  background: var(--bg-2);
}

/* Comparativa rápida de acceso */
.access { display: grid; gap: clamp(1rem, 2.4vw, 1.6rem); }
.access-card {
  display: grid; gap: .9rem; align-content: start;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.access-card h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.access-price {
  font-family: var(--mono); font-size: .9rem; font-weight: 700;
  color: var(--gold); letter-spacing: .02em;
}

/* --- CTA final --- */
.cta-panel {
  position: relative;
  border: 1px solid var(--gold-line);
  border-radius: clamp(var(--radius-lg), 3vw, 30px);
  padding: clamp(2.2rem, 5.5vw, 4.4rem);
  background: var(--surface);
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}
.cta-panel .aurora { inset: -40% -20%; opacity: calc(var(--aurora-opacity) * .8); }
.cta-form {
  display: grid; gap: .7rem; max-width: 460px; margin: 2rem auto 0;
  position: relative; z-index: 2;
}
.cta-note { margin-top: 1rem; font-size: .82rem; color: var(--ink-mute); position: relative; z-index: 2; }

/* --- Pie --- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(2.4rem, 5vw, 3.6rem); background: var(--bg-2); }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand { display: grid; gap: .8rem; max-width: 34ch; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.footer-col { display: grid; gap: .55rem; align-content: start; }
.footer-col h5 {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 500; margin-bottom: .3rem;
}
.footer-col a, .footer-col span { font-size: .89rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 2.4rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between;
  font-size: .8rem; color: var(--ink-mute);
}

/* =============================================================
   8. PANEL DE FINCA
   ============================================================= */
.app { display: grid; min-height: calc(100svh - var(--nav-h)); }
/* Sin esto, una tabla ancha impide que la columna se encoja y el móvil se corta */
.app > *, .market > * { min-width: 0; }
.app-side {
  border-bottom: 1px solid var(--line);
  padding: 1.2rem var(--gutter);
  background: var(--bg-2);
}
.app-side-inner { display: grid; gap: 1.4rem; }
.app-ident { display: flex; align-items: center; gap: .8rem; }
.app-ident-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: #14100a;
}
.app-ident-name { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.app-nav { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .2rem; }
.app-nav button {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem .95rem; border-radius: 10px;
  font-size: .87rem; font-weight: 500; color: var(--ink-mute);
  white-space: nowrap;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.app-nav button:hover { color: var(--ink); background: var(--gold-soft); }
.app-nav button[aria-selected="true"] { background: var(--gold-soft); color: var(--gold); font-weight: 700; }

.app-main { padding: clamp(1.5rem, 3.5vw, 2.8rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.app-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between;
  margin-bottom: clamp(1.5rem, 3vw, 2.4rem);
}
.app-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.app-head .body-sm { margin-top: .35rem; }

.panel { display: none; }
.panel.is-active { display: block; animation: panelIn .5s var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(.7rem, 1.6vw, 1.1rem); }
.kpi {
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  display: grid; gap: .35rem;
  transition: border-color .4s var(--ease-out);
}
.kpi:hover { border-color: var(--gold-line); }
.kpi-label { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.kpi-value {
  font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 500;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.kpi-foot { font-family: var(--mono); font-size: .7rem; display: flex; align-items: center; gap: .35rem; }

.block {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
}
.block-head {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center;
  padding: 1.05rem clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.block-head h2, .block-head h3 {
  font-family: var(--sans); font-size: .95rem; font-weight: 700; letter-spacing: -.01em;
}
.block-head .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.block-body { padding: clamp(1rem, 2.2vw, 1.6rem); }

/* Editor de disponibilidad */
.stock-row-input {
  width: 92px; padding: .42rem .6rem; text-align: right;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: .84rem;
  transition: border-color .3s var(--ease-out);
}
.stock-row-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.stepper { display: inline-flex; align-items: center; gap: .3rem; }
.stepper button {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-mute);
  font-family: var(--mono); font-size: .9rem; line-height: 1;
  transition: border-color .25s, color .25s, background-color .25s;
}
.stepper button:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

.save-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  padding: 1rem clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.save-bar .status { font-family: var(--mono); font-size: .72rem; color: var(--ink-mute); margin-right: auto; }
.save-bar .status.is-ok { color: var(--up); }

/* Gráfica */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-area { fill: url(#goldFade); }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-dot { fill: var(--gold); }
.chart-label { font-family: var(--mono); font-size: 9px; fill: var(--ink-mute); }

.chart-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1rem; font-size: .8rem; color: var(--ink-mute); }
.chart-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.chart-legend i { width: 10px; height: 3px; border-radius: 2px; background: var(--gold); }

/* Barras por variedad */
.bars { display: grid; gap: .85rem; }
.bar-row { display: grid; gap: .35rem; }
.bar-head { display: flex; justify-content: space-between; font-size: .85rem; }
.bar-head .num { color: var(--ink-mute); font-size: .8rem; }
.bar-track { height: 7px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-3));
  width: 0;
  transition: width 1.2s var(--ease-out);
}

/* Documentos */
.dropzone {
  border: 1.5px dashed var(--gold-line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  text-align: center;
  background: var(--gold-soft);
  display: grid; gap: .55rem; place-items: center;
  transition: background-color .35s var(--ease-out), border-color .35s var(--ease-out);
}
.dropzone:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold-soft) 180%, transparent); }
.dropzone-icon { font-size: 1.5rem; color: var(--gold); }

.doc-list { display: grid; gap: .55rem; }
.doc-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .35s var(--ease-out);
}
.doc-item:hover { border-color: var(--gold-line); }
.doc-icon {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center; font-family: var(--mono); font-size: .58rem; font-weight: 700;
}
.doc-name { font-weight: 600; font-size: .9rem; }
.doc-ref { font-family: var(--mono); font-size: .68rem; color: var(--ink-mute); }
.doc-meta { margin-left: auto; display: flex; align-items: center; gap: .8rem; }

/* =============================================================
   9. MERCADO (cliente)
   ============================================================= */
.market { display: grid; gap: clamp(1.2rem, 2.5vw, 1.8rem); }

.filters {
  display: grid; gap: .9rem;
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.filters-foot { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.filters-foot .count { font-family: var(--mono); font-size: .75rem; color: var(--ink-mute); margin-right: auto; }

.offer-list { display: grid; gap: .8rem; }
.offer {
  display: grid; gap: 1rem;
  padding: clamp(1.05rem, 2.2vw, 1.5rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .4s var(--ease-out), box-shadow .45s var(--ease-soft), transform .45s var(--ease-soft);
}
.offer:hover { border-color: var(--gold-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.offer.is-best { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft), var(--shadow-md); }

.offer-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .8rem; }
.offer-finca { display: grid; gap: .2rem; }
.offer-finca strong { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.offer-finca .body-sm { font-size: .8rem; }
.offer-match {
  margin-left: auto; text-align: right; display: grid; gap: .15rem; flex: none;
}
.offer-match-val { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.offer-match-label { font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }

.offer-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem 1rem; }
.spec { display: grid; gap: .12rem; }
.spec-label { font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.spec-value { font-family: var(--mono); font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.spec-value.big { font-size: 1.18rem; color: var(--gold); }

.offer-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding-top: .9rem; border-top: 1px solid var(--line-soft); }
.offer-seals { display: flex; flex-wrap: wrap; gap: .4rem; margin-right: auto; }

.empty {
  padding: clamp(2rem, 5vw, 3.5rem); text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  color: var(--ink-mute); display: grid; gap: .5rem; place-items: center;
}

/* Resumen lateral */
.summary { display: grid; gap: .8rem; align-content: start; }
.summary-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.summary-line span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.summary-total {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding-top: .8rem; border-top: 1px solid var(--line);
}
.summary-total strong { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; color: var(--gold); }

/* =============================================================
   10. EFECTOS / ARRANQUE
   ============================================================= */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .8s var(--ease-out), clip-path 1s var(--ease-out);
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-inner { display: grid; gap: 1rem; justify-items: center; }
.splash-mark {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em;
}
.splash-mark em { color: var(--gold); }
.splash-line { width: 130px; height: 1px; background: var(--line); overflow: hidden; }
.splash-line::after {
  content: ""; display: block; height: 100%; width: 40%;
  background: var(--gold);
  animation: splashSlide 1.4s var(--ease-soft) infinite;
}
@keyframes splashSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }

/* =============================================================
   11. RESPONSIVE (mobile-first)
   ============================================================= */
@media (min-width: 540px) {
  .filters-grid { grid-template-columns: repeat(3, 1fr); }
  .offer-specs { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .ticker-row { grid-template-columns: 1.4fr 1fr auto auto; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .offer { grid-template-columns: 1.1fr 2fr; align-items: center; }
  .offer-top { grid-column: 1; }
  .offer-specs { grid-column: 2; }
  .offer-foot { grid-column: 1 / -1; }
}

@media (min-width: 720px) {
  .access { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none; }
  .plans { grid-template-columns: repeat(3, 1fr); }

  .hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: center; }
  .profile { grid-template-columns: .9fr 1.1fr; }
  .profile--flip .profile-media { order: 2; }
  .footer-grid { grid-template-columns: 1fr 1.4fr; }
  .filters-grid { grid-template-columns: repeat(6, 1fr); }

  .app { grid-template-columns: 250px 1fr; }
  .app-side {
    border-bottom: 0; border-right: 1px solid var(--line);
    padding: 1.8rem 1.3rem;
    position: sticky; top: var(--nav-h); align-self: start;
    height: calc(100svh - var(--nav-h));
  }
  .app-nav { flex-direction: column; overflow: visible; }
  .app-nav button { width: 100%; justify-content: flex-start; }
  .app-main { padding-inline: clamp(1.5rem, 3vw, 2.6rem); }

  .market { grid-template-columns: 1fr 320px; align-items: start; }
  .market-main { grid-column: 1; }
  .market-aside { position: sticky; top: calc(var(--nav-h) + 20px); }
}

@media (min-width: 1280px) {
  .steps { gap: 1.8rem; }
}

/* =============================================================
   12. MOVIMIENTO REDUCIDO — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora { animation: none; }
  .marquee-track { animation-duration: 120s; }
  .dot-live { animation: none; }
  .splash-line::after { animation-duration: 2.4s; }
}

/* =============================================================
   13. REDISEÑO — legibilidad garantizada y acabado de estudio
   ============================================================= */

/* --- HERO: el texto manda, la imagen acompaña --- */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); }

/* La aurora nunca pasa por detrás del texto a plena intensidad */
.hero .aurora {
  inset: -30% -20% auto -20%;
  height: clamp(420px, 70vh, 780px);
  opacity: calc(var(--aurora-opacity) * .72);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 25%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 70% 25%, #000 35%, transparent 78%);
}

.hero-grid { gap: clamp(2.4rem, 5vw, 4.5rem); align-items: center; }

/* Columna de texto: la rejilla marca el ancho, el texto sólo la medida de lectura */
.hero-copy { min-width: 0; }
.hero-title {
  font-size: clamp(2.6rem, 5.6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin-block: 1.4rem 1.6rem;
  hyphens: none;
  text-wrap: balance;
}
.hero-title span { display: block; }
.hero-sub {
  font-size: clamp(1.02rem, 1.25vw, 1.16rem);
  line-height: 1.65;
  max-width: 46ch;
  color: var(--ink-2);
}
.hero-cta { margin-top: 2.2rem; gap: .9rem; }

/* La figura del hero nunca invade la columna de texto */
.hero-figure { min-width: 0; }
.hero-figure .frame {
  border-radius: clamp(18px, 2vw, 26px);
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 50px 90px -40px rgba(20,18,14,.42);
}

/* --- Panel de mercado del hero: aire y jerarquía --- */
.hero-ticker { margin-top: clamp(2.8rem, 6vw, 4.5rem); border-radius: clamp(16px, 2vw, 22px); }
.hero-ticker-head { padding: 1rem 1.35rem; }
.ticker-row { padding: .95rem 1.35rem; column-gap: 1.4rem; }
.ticker-var { letter-spacing: -.01em; }
.ticker-meta { line-height: 1.5; }

/* --- Ritmo tipográfico general --- */
.section-head { max-width: 62ch; }
.display-lg { letter-spacing: -.028em; }
.display-md { letter-spacing: -.022em; }
.lead { line-height: 1.62; }

/* Nada de texto pegado al borde en pantallas pequeñas */
@media (max-width: 539px) {
  .hero-title { font-size: clamp(2.35rem, 11vw, 3.2rem); max-width: 100%; }
  .hero-copy  { max-width: 100%; }
  .hero-sub   { max-width: 100%; }
  .display-lg { font-size: clamp(1.95rem, 8.4vw, 2.6rem); }
  .display-md { font-size: clamp(1.5rem, 6.6vw, 2rem); }
}

/* --- Botones: presencia sin estridencia --- */
.btn { letter-spacing: -.005em; }
.btn-gold {
  box-shadow: 0 1px 2px rgba(20,18,14,.10), 0 10px 26px -12px rgba(150,112,31,.55);
}
.btn-gold:hover { box-shadow: 0 2px 6px rgba(20,18,14,.12), 0 26px 50px -18px rgba(150,112,31,.62); }
.btn-ghost { background: color-mix(in srgb, var(--surface) 55%, transparent); }

/* --- Página de pago --- */
.pago-resumen {
  display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.2rem;
}
.pago-importe { display: flex; align-items: baseline; gap: .35rem; }
.pago-importe b {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 500;
  color: var(--gold); letter-spacing: -.03em; line-height: 1;
}
.pago-importe span { font-size: .9rem; color: var(--ink-mute); }
.pago-caja {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.pago-cambiar { margin-top: 1.4rem; }
.pago-cambiar summary {
  cursor: pointer; font-size: .9rem; color: var(--ink-mute);
  padding: .5rem 0;
}
.pago-cambiar summary:hover { color: var(--gold-text); }

/* --- Documentos habilitantes --- */
.doc-item--edit { display: grid; gap: 1rem; align-items: stretch; }
.doc-cab { display: flex; gap: .9rem; align-items: flex-start; }
.doc-cab > div { flex: 1 1 auto; min-width: 0; }
.doc-detalle { margin-top: .4rem; max-width: 68ch; }
.doc-estado-actual { flex: none; align-self: flex-start; }
.doc-campos { display: grid; gap: .8rem; }
@media (min-width: 720px) { .doc-campos { grid-template-columns: 1.4fr 1fr 1fr; } }

/* --- Detalles finos --- */
.block, .card, .plan, .offer, .kpi, .form-card, .access-card { transition: border-color .4s var(--ease-out), box-shadow .45s var(--ease-soft), transform .45s var(--ease-soft); }
.stat-value { letter-spacing: -.035em; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.save-bar .status { line-height: 1.5; }

/* El velo de las fotos no debe tapar texto: solo se usa en figuras sueltas */
.frame--veil::after { background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--bg) 55%, transparent) 100%); }

/* Ningún hijo de rejilla puede crecer más que su columna y montarse sobre el vecino */
.profile > *, .profile-body, .profile-media,
.hero-grid > *, .access > *, .plans > *, .steps > *,
.offer > *, .kpi-grid > *, .stats-grid > *, .form-grid > *, .filters-grid > * { min-width: 0; }

.profile-body h3, .profile-body p, .profile-list li { overflow-wrap: anywhere; }
.profile-body h3 { text-wrap: pretty; }

/* La foto de la tarjeta de perfil se ajusta a SU columna.
   Sin esto, aspect-ratio + height:100% la ensanchan y se monta sobre el texto. */
.profile-media { overflow: hidden; }
.profile-media .frame {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-height: 260px;
}
.profile-media .frame img { width: 100%; height: 100%; object-fit: cover; }
