/* ═══════════════════════════════════════════════════════════════════
   DOÑA DOMINGA · ARIMEZ — Portal Inmobiliario
   Rediseño 2026-09-11
   Identidad conservada: Poppins + Montserrat · naranjo #E26B2C
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   1. TOKENS
   Todo color, sombra, radio y tiempo vive aquí.
   El modo oscuro sólo redefine variables: cero parches por componente.
   ───────────────────────────────────────────────────────────────── */
:root {
  /* Marca — no cambia entre temas */
  --accent:        #E26B2C;
  --accent-strong: #D45A1E;
  --accent-soft:   rgba(226, 107, 44, 0.12);
  --accent-ring:   rgba(226, 107, 44, 0.35);
  --on-accent:     #FFFFFF;
  /* Derivados accesibles: mismo tono, mas oscuros. --accent no se toca. */
  --accent-fill:   #C3551B;  /* fondo con texto blanco encima -> 4.53:1 */
  --accent-fill-h: #A9490F;  /* su hover, mas oscuro aun -> 5.60:1 */
  --wa:            #25D366;
  --wa-strong:     #1EB558;

  /* Superficies */
  --bg:        #F6F7F8;
  --bg-sunken: #ECEEF0;
  --card:      #FFFFFF;
  --card-hover:#FFFFFF;
  --overlay:   rgba(20, 22, 25, 0.55);
  --skeleton:  #E6E8EB;
  --skeleton-shine: rgba(255, 255, 255, 0.65);

  /* Texto */
  --text:   #1F2328;
  --text-2: #4B5259;
  --text-3: #656C76;

  /* Líneas */
  --line:        #E3E6EA;
  --line-strong: #CDD2D8;

  /* Elevación — 3 niveles, no sombras sueltas */
  --shadow-1: 0 1px 2px rgba(31, 35, 40, .06), 0 2px 8px rgba(31, 35, 40, .05);
  --shadow-2: 0 2px 6px rgba(31, 35, 40, .07), 0 10px 24px rgba(31, 35, 40, .09);
  --shadow-3: 0 8px 20px rgba(31, 35, 40, .10), 0 24px 56px rgba(31, 35, 40, .14);

  /* Tipografía */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Montserrat', system-ui, sans-serif;

  /* Escala fluida — se adapta sola, sin breakpoints */
  --step--1: clamp(.72rem, .69rem + .14vw, .80rem);
  --step-0:  clamp(.86rem, .83rem + .16vw, .95rem);
  --step-1:  clamp(1.05rem, .99rem + .30vw, 1.25rem);
  --step-2:  clamp(1.30rem, 1.18rem + .58vw, 1.75rem);
  --step-3:  clamp(1.65rem, 1.42rem + 1.10vw, 2.50rem);
  --step-4:  clamp(2.05rem, 1.60rem + 2.20vw, 3.75rem);

  /* Radios — escala coherente */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Espaciado */
  --gutter: clamp(16px, 4vw, 40px);
  --shell:  1280px;

  /* Flecha del <select>, dibujada en SVG para que se vea igual en todo sistema */
  --caret: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23656C76' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* Movimiento */
  --t-fast: 120ms;
  --t-mid:  200ms;
  --t-slow: 380ms;
  --ease:        cubic-bezier(.2, 0, 0, 1);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
}

html[data-theme="dark"] {
  --accent-soft: rgba(226, 107, 44, 0.18);
  --accent-ring: rgba(226, 107, 44, 0.55);

  --bg:        #141517;
  --bg-sunken: #0E0F10;
  --card:      #1C1E21;
  --card-hover:#24272B;
  --overlay:   rgba(0, 0, 0, 0.68);
  --skeleton:  #25282C;
  --skeleton-shine: rgba(255, 255, 255, 0.06);

  --text:   #F3F4F5;
  --text-2: #BFC4CA;
  --text-3: #8E959C;

  --line:        #2B2E33;
  --line-strong: #3A3E44;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 10px 24px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 20px rgba(0, 0, 0, .55), 0 24px 56px rgba(0, 0, 0, .5);

  --caret: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%238E959C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ─────────────────────────────────────────────────────────────────
   2. RESET
   ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

::selection { background: var(--accent); color: var(--on-accent); }

/* Foco visible y consistente en TODO lo interactivo.
   :focus-visible no se dispara con el mouse, sólo con teclado. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Respeta a quien pidió menos animación en su sistema operativo. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.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;
}

/* ─────────────────────────────────────────────────────────────────
   3. BOTONES
   Cada botón tiene 4 estados: reposo · hover · press · foco.
   El press (:active) es lo que hacía sentir la interfaz "muerta".
   ───────────────────────────────────────────────────────────────── */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;              /* área táctil mínima accesible */
  padding: 12px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    background   var(--t-mid) var(--ease),
    border-color var(--t-mid) var(--ease),
    color        var(--t-mid) var(--ease),
    box-shadow   var(--t-mid) var(--ease),
    transform    var(--t-fast) var(--ease);
}
.btn svg { flex-shrink: 0; }

.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); transition-duration: var(--t-fast); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; pointer-events: none; transform: none;
}

/* Primario — naranjo de marca */
.btn-primary {
  --btn-bg: var(--accent-fill);
  --btn-fg: var(--on-accent);
  box-shadow: var(--shadow-1);
}
.btn-primary:hover  { --btn-bg: var(--accent-fill-h); box-shadow: var(--shadow-2); }
.btn-primary:active { box-shadow: var(--shadow-1); }

/* Secundario — contorno */
.btn-outline {
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
}
.btn-outline:hover { --btn-bd: var(--accent); --btn-fg: var(--accent-strong); --btn-bg: var(--accent-soft); }

/* Fantasma — sin peso visual hasta que lo tocas */
.btn-ghost { --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-strong); }

/* WhatsApp — color propio de la plataforma */
.btn-wa { --btn-bg: var(--wa); --btn-fg: #fff; box-shadow: var(--shadow-1); }
.btn-wa:hover { --btn-bg: var(--wa-strong); box-shadow: var(--shadow-2); }

.btn-sm  { min-height: 38px; padding: 9px 16px; font-size: var(--step--1); }
.btn-lg  { min-height: 52px; padding: 16px 30px; font-size: var(--step-0); }
.btn-block { width: 100%; }

/* Botón de icono cuadrado */
.btn-icon {
  width: 42px; height: 42px; min-height: 42px; padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease),
              border-color var(--t-mid) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-icon:hover  { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.btn-icon:active { transform: scale(.92); }

/* ─────────────────────────────────────────────────────────────────
   4. CONTROLES DE FORMULARIO
   ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--step-0);
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease),
              background var(--t-mid) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

/* Flecha del select dibujada por CSS (no depende del sistema operativo) */
.select {
  appearance: none;
  padding-right: 40px;
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-image: var(--caret);
  cursor: pointer;
}

/* Control segmentado — Venta / Arriendo */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.segmented-item {
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--t-mid) var(--ease), background var(--t-mid) var(--ease),
              transform var(--t-fast) var(--ease);
}
.segmented-item:hover  { color: var(--text); }
.segmented-item:active { transform: scale(.96); }
.segmented-item[aria-pressed="true"] {
  background: var(--accent-fill);
  color: var(--on-accent);
  box-shadow: var(--shadow-1);
}

/* Grupo de opciones tipo píldora — dormitorios, baños */
.pillgroup { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: var(--step--1);
  font-weight: 600;
  transition: all var(--t-mid) var(--ease);
}
.pill:hover  { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.pill:active { transform: scale(.94); }
.pill[aria-pressed="true"] {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent);
}

/* Etiqueta de filtro activo, con su propia X para quitarlo */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 14px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--accent-strong);
  font-size: var(--step--1);
  font-weight: 600;
  animation: chip-in var(--t-mid) var(--ease-spring) both;
}
.chip-x {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  color: currentColor;
  opacity: .65;
  transition: opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.chip-x:hover  { opacity: 1; background: rgba(0, 0, 0, .1); }
.chip-x:active { transform: scale(.85); }

@keyframes chip-in {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Distintivos sobre la foto de la tarjeta */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1;
  backdrop-filter: blur(10px);
}
.badge-op      { background: rgba(255,255,255,.92); color: #1A1D21; }
.badge-featured{ background: var(--accent-fill); color: var(--on-accent); }
.badge-status  { background: var(--overlay); color: #fff; }
.badge-soft    { background: var(--accent-soft); color: var(--accent-strong); }

/* ─────────────────────────────────────────────────────────────────
   5. NAVEGACIÓN
   ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease),
              padding var(--t-slow) var(--ease), background var(--t-slow) var(--ease);
}
.nav.scrolled {
  padding-block: 9px;
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-1);
}

/* min-width:0 en toda la cadena flex: sin esto los hijos se niegan a
   encogerse por debajo de su contenido y la barra desborda en celular. */
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  overflow: hidden;
}
.nav-logo img {
  width: 46px; height: 46px; object-fit: contain;
  transition: transform var(--t-slow) var(--ease-spring);
}
.nav-logo:hover img { transform: rotate(-6deg) scale(1.06); }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.nav-logo-brand {
  font-size: 9.5px; font-weight: 600; letter-spacing: .28em;
  text-transform: uppercase; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-logo-name {
  margin-top: 7px;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 21px; color: var(--accent-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="dark"] .nav-logo-name { color: var(--text); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color var(--t-mid) var(--ease);
}
.nav-link:hover { color: var(--text); }
/* Subrayado que crece desde el centro */
.nav-link::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--t-mid) var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 10px; flex-shrink: 0; }

/* Redes dentro del menú lateral, para lo que se oculta de la barra */
.nav-drawer-social { display: flex; gap: 10px; margin-top: 18px; }
.nav-social {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all var(--t-mid) var(--ease);
}
.nav-social:hover  { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-2px); }
.nav-social:active { transform: scale(.9); }

/* Interruptor de tema: el icono gira al cambiar */
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { transition: transform var(--t-slow) var(--ease-spring), opacity var(--t-mid) var(--ease); }
.theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun  { display: block; }
.theme-toggle:hover svg { transform: rotate(25deg); }

/* Menú móvil */
.nav-burger { display: none; }
.nav-drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(86vw, 360px);
  z-index: 70;
  padding: 26px var(--gutter);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--ease-out);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer .nav-link {
  padding: 15px 4px;
  font-size: var(--step-1);
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.nav-drawer .nav-link::after { display: none; }
.nav-drawer-head { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.scrim {
  position: fixed; inset: 0; z-index: 65;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  animation: fade-in var(--t-mid) var(--ease) both;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ─────────────────────────────────────────────────────────────────
   6. HERO + BUSCADOR
   Compacto a propósito: en un portal inmobiliario lo que importa
   es llegar rápido al listado, no una portada gigante.
   ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;              /* encierra las capas de fondo */
  padding: clamp(56px, 9vw, 104px) 0 clamp(34px, 5vw, 56px);
  background:
    radial-gradient(1100px 480px at 12% -18%, var(--accent-soft), transparent 62%),
    radial-gradient(820px 420px at 92% 8%, var(--accent-soft), transparent 58%);
}

/* ── Fotografía de portada ──
   Para cambiarla: reemplaza assets/hero-portada.jpg (y .webp).
   Si se quita el <picture> del marcado, el hero vuelve solo al degradado. */
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  overflow: hidden;
}
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 58%;      /* encuadra las casas, no el pasto */
}

/* Velo oscuro: garantiza contraste del texto sobre cualquier foto,
   en tema claro y oscuro por igual. Lleva un tinte naranjo de marca. */
/* Las paradas están calculadas para que el texto cumpla contraste AA
   aun si justo detrás la foto fuera cielo blanco. Ver check-contraste.js. */
.hero-photo::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(102deg, rgba(15, 17, 20, .92) 0%, rgba(15, 17, 20, .82) 48%, rgba(15, 17, 20, .46) 100%),
    linear-gradient(to top, rgba(15, 17, 20, .58) 0%, transparent 48%),
    linear-gradient(160deg, rgba(226, 107, 44, .24) 0%, transparent 58%);
}
html[data-theme="dark"] .hero-photo::after {
  background:
    linear-gradient(102deg, rgba(8, 9, 10, .92) 0%, rgba(8, 9, 10, .74) 46%, rgba(8, 9, 10, .44) 100%),
    linear-gradient(to top, rgba(8, 9, 10, .72) 0%, transparent 50%),
    linear-gradient(160deg, rgba(226, 107, 44, .20) 0%, transparent 58%);
}

/* Sobre la foto el texto va claro en los dos temas */
.hero-photo .hero-title { color: #FFFFFF; }
.hero-photo .hero-title em { color: #FFB27A; }
.hero-photo .hero-sub { color: rgba(255, 255, 255, .93); }
.hero-photo .hero-eyebrow {
  background: rgba(255, 255, 255, .16);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-photo .hero-dot { background: #FFB27A; }

.hero-inner { display: grid; gap: 26px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  align-self: start;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .35; transform: scale(.72); }
}

.hero-title {
  font-size: var(--step-4);
  max-width: 17ch;
  text-wrap: balance;
}
.hero-title em { font-style: italic; color: var(--accent-strong); }
html[data-theme="dark"] .hero-title em { color: var(--accent); }

.hero-sub {
  font-size: var(--step-1);
  color: var(--text-2);
  max-width: 52ch;
  text-wrap: pretty;
}

/* Barra de búsqueda */
.search {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.search-ops { grid-column: 1 / -1; }
.search .btn-primary { min-height: 44px; }

/* ─────────────────────────────────────────────────────────────────
   7. BARRA DE FILTROS PEGAJOSA
   Reemplaza el panel lateral duplicado. Un solo bloque de marcado
   sirve para escritorio y móvil.
   ───────────────────────────────────────────────────────────────── */
.toolbar {
  position: sticky;
  top: 72px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 13px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.toolbar-count {
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.toolbar-count b { color: var(--accent-strong); font-weight: 700; }
.toolbar-spacer { flex: 1 1 auto; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.toolbar .select { min-height: 40px; width: auto; min-width: 178px; padding-block: 8px; }

/* Alternador cuadrícula / lista */
.viewswitch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.viewswitch button {
  display: grid; place-items: center;
  width: 36px; height: 34px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: all var(--t-mid) var(--ease);
}
.viewswitch button:hover { color: var(--text); }
.viewswitch button[aria-pressed="true"] {
  background: var(--card); color: var(--accent-strong); box-shadow: var(--shadow-1);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }

/* ─────────────────────────────────────────────────────────────────
   8. TARJETA DE PROPIEDAD
   Antes: minmax(245px) — cuadros chicos y apretados.
   Ahora: minmax(310px) para que la foto y el precio respiren.
   ───────────────────────────────────────────────────────────────── */
.listado { padding: clamp(34px, 6vw, 60px) 0 clamp(50px, 8vw, 90px); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: clamp(16px, 2.2vw, 26px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-slow) var(--ease-out),
              box-shadow var(--t-slow) var(--ease-out),
              border-color var(--t-slow) var(--ease-out);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-3);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.card:active { transform: translateY(-2px); transition-duration: var(--t-fast); }

/* Marco de la foto: aspect-ratio fijo evita que el texto salte
   mientras cargan las imágenes (vienen como BLOB desde MySQL). */
.card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--skeleton);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease), transform 620ms var(--ease-out);
}
.card-media img.loaded { opacity: 1; }
.card:hover .card-media img { transform: scale(1.06); }

/* Degradado sólo abajo: mantiene legibles los distintivos sobre fotos claras */
.card-media::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 42%;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
  pointer-events: none;
}
.card:hover .card-media::after { opacity: 1; }

.card-badges {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-wrap: wrap; gap: 6px;
  z-index: 2;
}
.card-status { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* Aparece al pasar el cursor, sin empujar el contenido */
.card-peek {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  color: #1A1D21;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.card:hover .card-peek { opacity: 1; transform: translateY(0); }
@media (hover: none) { .card-peek { display: none; } }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  flex: 1;
}
.card-kicker {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
html[data-theme="dark"] .card-kicker { color: var(--accent); }

.card-title {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  /* Dos líneas máximo: evita que una tarjeta quede más alta que el resto */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-loc {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--step--1);
  color: var(--text-2);
}
.card-loc svg { color: var(--accent); flex-shrink: 0; opacity: .75; }

.card-specs {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding-top: 4px;
  color: var(--text-2);
}
.spec {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--step--1);
  font-weight: 600;
}
.spec svg { color: var(--text-3); flex-shrink: 0; }

.card-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.card-price {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.015em;
}
.card-price-unit { font-size: var(--step--1); font-weight: 600; color: var(--text-3); }

/* ── Vista en lista: la foto pasa al costado ── */
.grid.is-list { grid-template-columns: 1fr; }
.grid.is-list .card { flex-direction: row; }
.grid.is-list .card-media { width: min(38%, 340px); aspect-ratio: auto; flex-shrink: 0; }
.grid.is-list .card-body { padding: 22px 24px; }
.grid.is-list .card-peek { display: none; }
@media (max-width: 640px) {
  .grid.is-list .card { flex-direction: column; }
  .grid.is-list .card-media { width: 100%; aspect-ratio: 3 / 2; }
}

/* ─────────────────────────────────────────────────────────────────
   9. ESQUELETOS Y ESTADOS VACÍOS
   Antes la grilla quedaba en blanco mientras cargaba.
   ───────────────────────────────────────────────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.sk-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sk-media { aspect-ratio: 3 / 2; border-radius: 0; }
.sk-body { padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.sk-line { height: 12px; }

.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: clamp(48px, 9vw, 90px) 24px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty-icon {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.empty-title { font-size: var(--step-2); }
.empty-text { color: var(--text-2); max-width: 42ch; text-wrap: pretty; }

.loadmore { display: flex; justify-content: center; margin-top: 36px; }

/* Aparición al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* ─────────────────────────────────────────────────────────────────
   10. SECCIONES DE CONTENIDO
   ───────────────────────────────────────────────────────────────── */
.section { padding: clamp(54px, 9vw, 104px) 0; }
.section-sunken { background: var(--bg-sunken); }

.section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-eyebrow {
  display: block;
  margin-bottom: 12px;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .20em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
html[data-theme="dark"] .section-eyebrow { color: var(--accent); }
.section-title { font-size: var(--step-3); text-wrap: balance; }
.section-text { margin-top: 14px; color: var(--text-2); font-size: var(--step-1); text-wrap: pretty; }

.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
}

.feature {
  display: flex; flex-direction: column; gap: 12px;
  padding: 28px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: transform var(--t-slow) var(--ease-out),
              box-shadow var(--t-slow) var(--ease-out),
              border-color var(--t-slow) var(--ease-out);
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.feature-num {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
}
.feature-title { font-size: var(--step-1); }
.feature-text  { color: var(--text-2); font-size: var(--step-0); text-wrap: pretty; }

/* Cifras de confianza */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(14px, 2vw, 24px);
}
.stat {
  padding: 26px 20px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: -.02em;
}
html[data-theme="dark"] .stat-value { color: var(--accent); }
.stat-label {
  margin-top: 6px;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.contact-panel {
  padding: clamp(24px, 3.4vw, 38px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.contact-list { display: flex; flex-direction: column; gap: 4px; }
.contact-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 14px;
  border-radius: var(--r-md);
  color: var(--text);
  transition: background var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.contact-item:hover  { background: var(--accent-soft); transform: translateX(5px); }
.contact-item:active { transform: translateX(2px); }
.contact-item-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.contact-item-label { font-size: var(--step--1); color: var(--text-3); letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.contact-item-value { font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────
   11. PIE DE PÁGINA
   ───────────────────────────────────────────────────────────────── */
.footer {
  padding: clamp(44px, 6vw, 72px) 0 30px;
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(26px, 4vw, 56px);
  margin-bottom: 36px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-title {
  margin-bottom: 16px;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a {
  width: fit-content;
  color: var(--text-2);
  font-size: var(--step-0);
  transition: color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.footer-links a:hover { color: var(--accent-strong); transform: translateX(4px); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--text-3);
}

/* Botón flotante de WhatsApp */
.fab {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 50;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
  box-shadow: var(--shadow-3);
  transition: transform var(--t-mid) var(--ease-spring), box-shadow var(--t-mid) var(--ease);
}
.fab:hover  { transform: scale(1.09) rotate(-6deg); }
.fab:active { transform: scale(.94); }

/* ─────────────────────────────────────────────────────────────────
   12. PRECARGA
   ───────────────────────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center; gap: 20px;
  align-content: center;
  background: var(--bg);
  transition: opacity var(--t-slow) var(--ease), visibility var(--t-slow) var(--ease);
}
.preloader.loaded { opacity: 0; visibility: hidden; }
.preloader-logo {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--text);
}
.preloader-bar { width: 180px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.preloader-bar-fill { width: 40%; height: 100%; background: var(--accent); animation: loadbar 1.1s var(--ease) infinite; }
@keyframes loadbar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ─────────────────────────────────────────────────────────────────
   13. AJUSTES POR ANCHO
   El resto del archivo ya es fluido (clamp + auto-fill), así que
   aquí sólo quedan los cambios que el layout no resuelve solo.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .search { grid-template-columns: 1fr; }
  .toolbar { top: 66px; }
}

/* Bajo este ancho la barra sólo conserva tema y menú.
   El resto (redes, sitio Arimez, admin) vive dentro del menú lateral. */
@media (max-width: 760px) {
  .nav-extra { display: none !important; }
}

@media (max-width: 620px) {
  .nav { gap: 10px; }
  .nav-logo img { width: 40px; height: 40px; }
  .nav-logo-name { font-size: 17px; }
  .nav-logo-brand { font-size: 8.5px; letter-spacing: .20em; }
  .grid { grid-template-columns: 1fr; }
  .toolbar { gap: 9px; padding: 11px 13px; }
  .toolbar-count { width: 100%; }
  .toolbar-spacer { display: none; }
  /* El grupo ocupa todo el ancho y el selector de orden se encoge:
     los tres controles juntos medían 424px y no cabían. */
  .toolbar-group { width: 100%; }
  .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .toolbar-group .btn { flex: 0 0 auto; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* A 360px o menos, el nombre de marca se recorta antes que desbordar */
@media (max-width: 400px) {
  .nav-logo-brand { display: none; }
  .nav-logo-name { margin-top: 0; }
}

/* ─────────────────────────────────────────────────────────────────
   14. PANTALLAS TÁCTILES
   Sin mouse no hay puntería fina: todo lo que se toca sube a 44px,
   que es el mínimo recomendado para el dedo.
   ───────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .btn-sm          { min-height: 44px; padding-block: 12px; }
  .btn-icon        { width: 44px; height: 44px; min-height: 44px; }
  .segmented-item  { min-height: 44px; padding-block: 13px; }
  .pill            { min-height: 44px; padding-block: 12px; }
  .viewswitch button { width: 44px; height: 42px; }
  .nav-social      { width: 44px; height: 44px; }
  .chip            { padding-block: 9px; }
  .chip-x          { width: 26px; height: 26px; }
  .gal-thumbs button { height: 60px; }
}

/* ═══════════════════════════════════════════════════════════════════
   PALETA GRIS · NARANJO · BLANCO + BOOTSTRAP ICONS  (2026-10-18)
   Los neutros pasaron de beige/marrón a grises; el naranjo no cambia.
   Complementario: azul acero, sólo en detalles.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --steel:      #3F6485;
  --steel-soft: rgba(63, 100, 133, 0.10);
}
html[data-theme="dark"] {
  --steel:      #86A6C4;
  --steel-soft: rgba(134, 166, 196, 0.14);
}

.bi { line-height: 1; display: inline-block; flex-shrink: 0; }
.btn .bi { font-size: 1.05em; }
.theme-toggle .bi { transition: transform var(--t-slow) var(--ease-spring); }
.theme-toggle:hover .bi { transform: rotate(25deg); }
.theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun  { display: inline-block; }
.card-loc .bi { color: var(--accent); opacity: .85; }
.spec .bi { color: var(--steel); }
.contact-item-icon .bi { color: var(--steel); }

/* ═══════════════════════════════════════════════════════════════════
   MOVIMIENTO, MATERIALES Y TIPOGRAFÍA — criterios Apple HIG  (2026-10-24)
   ═══════════════════════════════════════════════════════════════════ */
a, button, .btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); transition-duration: 60ms; }
.btn:not(:active) { transition-timing-function: var(--ease-spring); }

h1, h2 { text-wrap: balance; }
h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.02em; }
p { text-wrap: pretty; }

@media (prefers-reduced-transparency: reduce) {
  .nav, .toolbar, .badge, .hero-photo .hero-eyebrow, .card-peek { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .nav, .toolbar { background: var(--bg) !important; }
}
@media (prefers-contrast: more) {
  :root { --line: #8A9099; --line-strong: #5E646C; --text-3: #3F464D; }
  html[data-theme="dark"] { --line: #7C838B; --line-strong: #A5ABB2; --text-3: #C2C7CD; }
}
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow-1); border-color: var(--line); }
  .card:hover .card-media img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .card:active { transform: none; }
}
