/* ══════════════════════════════════════════════════════════════════════════
   /css/compare.css — Comparador estilo Zillow (Feature 2).

   Tres piezas independientes pero coordinadas:
     1. Checkbox "Comparar" overlay sobre cada card del listado.
     2. CompareBar sticky inferior con miniaturas + CTA.
     3. Página /comparar — hero + rail sticky + secciones agrupadas.

   Token guideline: usamos las CSS vars globales de tokens.css cuando aplica
   (--color-brand, etc.), pero el comparador define sus propios accent locales
   para no contaminar otros componentes.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
    --cmp-accent: #0d9488;
    --cmp-accent-strong: #0f766e;
    --cmp-accent-soft: #ccfbf1;
    --cmp-accent-glow: rgba(20, 184, 166, 0.32);
    --cmp-win-bg: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    --cmp-win-border: #10b981;
    --cmp-win-text: #065f46;
    --cmp-ink-900: #0f172a;
    --cmp-ink-700: #334155;
    --cmp-ink-500: #64748b;
    --cmp-ink-400: #94a3b8;
    --cmp-ink-200: #e2e8f0;
    --cmp-ink-100: #f1f5f9;
    --cmp-bar-shadow: 0 20px 50px -20px rgba(13, 148, 136, 0.45),
                      0 8px 24px -12px rgba(15, 23, 42, 0.18);
}

/* ═══════════════════════════════════════════════════════════════════════════
   1. CHECKBOX "COMPARAR" — overlay sobre cada card del listado.
   ═══════════════════════════════════════════════════════════════════════════ */

.li-compare-check {
    /* Bottom-right del wrap de imagen. La top-left la usan los badges,
       top-right ahora el contador de fotos, bottom-left .li-card-tipo. */
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;

    /* Glass pill compacto. */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22),
                0 1px 2px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    transition:
        background 180ms ease,
        border-color 180ms ease,
        transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 220ms ease;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--cmp-ink-700);
    letter-spacing: -0.005em;
    user-select: none;
    text-decoration: none;
}

.li-compare-check:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.26);
}

.li-compare-check__box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.6px solid var(--cmp-ink-400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: background 180ms ease, border-color 180ms ease;
    color: white;
}

.li-compare-check__box svg {
    width: 11px;
    height: 11px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.li-compare-check--on {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.97), rgba(15, 118, 110, 0.97));
    border-color: rgba(20, 184, 166, 0.6);
    color: white;
    box-shadow:
        0 6px 16px rgba(13, 148, 136, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.li-compare-check--on:hover {
    background: linear-gradient(135deg, rgba(15, 118, 110, 1), rgba(13, 89, 84, 1));
}

.li-compare-check--on .li-compare-check__box {
    background: white;
    border-color: white;
    color: var(--cmp-accent-strong);
}

.li-compare-check--on .li-compare-check__box svg {
    opacity: 1;
    transform: scale(1);
}

.li-compare-check--shake {
    animation: cmpShake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes cmpShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Anillo teal en la card cuando está en el comparador. Outline en lugar de
   box-shadow porque la card tiene su propio box-shadow:hover scoped que
   ganaría especificidad. */
.li-card.li-card--in-compare {
    outline: 2px solid var(--cmp-accent);
    outline-offset: -2px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. COMPARE BAR — pill sticky abajo, glass + glow.
   ═══════════════════════════════════════════════════════════════════════════ */

.cmp-bar {
    position: fixed;
    z-index: 950;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, calc(100% + 24px));
    width: min(880px, calc(100vw - 32px));
    pointer-events: none;
    opacity: 0;
    transition: opacity 380ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cmp-bar--in {
    transform: translate(-50%, 0);
    opacity: 1;
}

.cmp-bar__inner {
    position: relative;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 16px 14px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    box-shadow: var(--cmp-bar-shadow);
}

.cmp-bar__glow {
    position: absolute;
    inset: -30px -30px -10px -30px;
    z-index: -1;
    background: radial-gradient(60% 80% at 50% 100%,
                                var(--cmp-accent-glow) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0.7;
    animation: cmpBarGlow 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes cmpBarGlow {
    from { opacity: 0.5; }
    to   { opacity: 0.85; }
}

.cmp-bar__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.1;
    min-width: 0;
}

.cmp-bar__count {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.cmp-bar__count-num {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--cmp-ink-900);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.cmp-bar__count-text {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cmp-ink-500);
    letter-spacing: 0.01em;
}

.cmp-bar__clear {
    background: none;
    border: none;
    padding: 0;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cmp-ink-500);
    cursor: pointer;
    text-align: left;
    transition: color 180ms ease;
    align-self: flex-start;
}

.cmp-bar__clear:hover {
    color: #dc2626;
    text-decoration: underline;
}

.cmp-bar__track {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.cmp-bar__slot {
    position: relative;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: visible;
    transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cmpSlotIn 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--cmp-i, 0) * 60ms);
}

@keyframes cmpSlotIn {
    from { opacity: 0; transform: translateY(8px) scale(0.86); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmp-bar__slot--filled:hover { transform: translateY(-2px) scale(1.04); }
.cmp-bar__slot--filled { cursor: default; }

.cmp-bar__thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 14px;
    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: box-shadow 220ms ease;
}

.cmp-bar__thumb--placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #94a3b8;
}

.cmp-bar__meta {
    position: absolute;
    left: 50%; bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    background: var(--cmp-ink-900);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease, transform 220ms ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
    display: flex; flex-direction: column; gap: 2px;
    max-width: 220px;
}

.cmp-bar__meta::after {
    content: "";
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--cmp-ink-900);
}

.cmp-bar__slot--filled:hover .cmp-bar__meta {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cmp-bar__price {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cmp-bar__location { color: rgba(255, 255, 255, 0.7); font-size: 10.5px; }

.cmp-bar__remove {
    position: absolute;
    top: -6px; right: -6px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid var(--cmp-ink-200);
    color: var(--cmp-ink-500);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    opacity: 0; transform: scale(0.6);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
                background 180ms ease, color 180ms ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.cmp-bar__remove svg { width: 10px; height: 10px; }
.cmp-bar__slot--filled:hover .cmp-bar__remove { opacity: 1; transform: scale(1); }
.cmp-bar__remove:hover { background: #dc2626; color: white; border-color: #dc2626; }

.cmp-bar__slot--empty {
    border: 1.4px dashed var(--cmp-ink-200);
    background: rgba(241, 245, 249, 0.5);
    display: flex; align-items: center; justify-content: center;
    color: var(--cmp-ink-400);
    animation: none;
    opacity: 0.85;
}

.cmp-bar__slot--empty .cmp-bar__slot-plus {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: white;
    color: var(--cmp-ink-400);
}

.cmp-bar__cta {
    position: relative;
    overflow: hidden;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 16px 11px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--cmp-accent) 0%, var(--cmp-accent-strong) 100%);
    color: white;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow:
        0 10px 24px -6px rgba(13, 148, 136, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 280ms ease;
}

.cmp-bar__cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 32px -8px rgba(13, 148, 136, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cmp-bar__cta:active { transform: translateY(0); }

.cmp-bar__cta-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cmp-bar__cta-arrow { transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.cmp-bar__cta:hover .cmp-bar__cta-arrow { transform: translateX(3px); }

.cmp-bar__cta-shine {
    position: absolute; inset: 0;
    background: linear-gradient(110deg,
        transparent 30%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}

.cmp-bar__cta--ready .cmp-bar__cta-shine {
    animation: cmpShine 4.5s ease-in-out 1.6s infinite;
}

@keyframes cmpShine {
    0%   { transform: translateX(-120%); }
    25%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

@media (max-width: 720px) {
    .cmp-bar { bottom: 12px; width: calc(100vw - 16px); }
    .cmp-bar__inner { padding: 10px 12px 10px 14px; gap: 10px; border-radius: 18px; }
    .cmp-bar__head { display: none; }
    .cmp-bar__slot { width: 48px; height: 48px; border-radius: 10px; }
    .cmp-bar__thumb { border-radius: 10px; }
    .cmp-bar__cta { padding: 9px 14px; font-size: 13px; gap: 6px; }
    .cmp-bar__cta-label { display: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. PÁGINA /comparar
   Estructura:
     .cmp-page
       .cmp-hero        — hero con foto + overlay teal
         .cmp-hero-inner
           breadcrumb, eyebrow, title, sub, actions, warning, summary
       .cmp-body        — cuerpo blanco con scroll vertical
         .cmp-scroller  — wrapper con scroll-x en mobile
           .cmp-table   — grid con N+1 columnas
             .cmp-rail  — header sticky con las property-cards
             .cmp-section ×N
               .cmp-section-head
               .cmp-section-body → CompareRow ×N
             .cmp-final — botones "Ver ficha" por columna
   ═══════════════════════════════════════════════════════════════════════════ */

.cmp-page {
    background: #f7f9fc;
    min-height: 100vh;
    color: var(--cmp-ink-900);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0 0 140px;  /* hueco abajo reservado para la barra sticky */
}

/* ── Hero con foto ────────────────────────────────────────────────────────
   Mismo lenguaje que /favoritos y /mi-actividad (consistencia con las
   páginas "del comprador"). Usamos hero-3 (faro al atardecer con luna).
   ─────────────────────────────────────────────────────────────────────── */

.cmp-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 56px 24px 44px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%),
        url('/img/hero/hero-3-desktop.jpg') center 35% / cover no-repeat;
}

/* WebP optimizado si el browser banca. */
@supports (background-image: image-set(url('') type(''))) {
    .cmp-hero {
        background-image:
            linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%),
            image-set(
                url('/img/hero/hero-3-desktop.webp') type('image/webp') 1x,
                url('/img/hero/hero-3-desktop.jpg') type('image/jpeg') 1x
            );
    }
}

@media (max-width: 1100px) {
    .cmp-hero {
        background:
            linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%),
            url('/img/hero/hero-3-tablet.jpg') center 35% / cover no-repeat;
    }
    @supports (background-image: image-set(url('') type(''))) {
        .cmp-hero {
            background-image:
                linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%),
                image-set(
                    url('/img/hero/hero-3-tablet.webp') type('image/webp') 1x,
                    url('/img/hero/hero-3-tablet.jpg') type('image/jpeg') 1x
                );
        }
    }
}

@media (max-width: 700px) {
    .cmp-hero {
        padding: 32px 16px 28px;
        background:
            linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.75) 100%),
            url('/img/hero/hero-3-mobile.jpg') center / cover no-repeat;
    }
    @supports (background-image: image-set(url('') type(''))) {
        .cmp-hero {
            background-image:
                linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.75) 100%),
                image-set(
                    url('/img/hero/hero-3-mobile.webp') type('image/webp') 1x,
                    url('/img/hero/hero-3-mobile.jpg') type('image/jpeg') 1x
                );
        }
    }
}

/* Vignette extra para que el texto blanco se lea sobre cualquier zona. */
.cmp-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 90% at 50% 50%, transparent 0%, rgba(0,0,0,0.28) 100%);
    pointer-events: none;
}

.cmp-hero-inner {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
}

.cmp-breadcrumb {
    display: flex; align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 24px;
}
.cmp-breadcrumb a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 180ms ease;
}
.cmp-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.cmp-breadcrumb span[aria-hidden="true"] { opacity: 0.5; }

.cmp-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 20px;
}

.cmp-hero-text {
    max-width: 640px;
    flex: 1 1 320px;
    min-width: 0;
}

.cmp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.16);
    border: 1px solid rgba(94, 234, 212, 0.35);
    color: #99f6e4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cmp-hero-eyebrow-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.2);
    animation: cmpPulse 2.2s ease-in-out infinite;
}

@keyframes cmpPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.82); opacity: 0.7; }
}

.cmp-hero-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 14px;
    color: #fff;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

.cmp-hero-sub {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    max-width: 580px;
}

.cmp-hero-sub a {
    color: #99f6e4;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cmp-hero-sub a:hover { color: #fff; }

.cmp-hero-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cmp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: var(--cmp-accent-strong);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 200ms ease, background 200ms ease, box-shadow 240ms ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.cmp-action-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.cmp-action-btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}
.cmp-action-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.cmp-action-btn--danger {
    background: rgba(255, 255, 255, 0.12);
    color: #fecaca;
    border-color: rgba(254, 202, 202, 0.35);
}
.cmp-action-btn--danger:hover {
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
    border-color: rgba(220, 38, 38, 1);
}

.cmp-warning {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 10px 14px;
    background: rgba(254, 240, 138, 0.95);
    border: 1px solid rgba(253, 224, 71, 0.7);
    border-radius: 10px;
    color: #713f12;
    font-size: 12.5px;
    line-height: 1.4;
    max-width: 880px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.cmp-warning svg { flex-shrink: 0; }

/* ── Resumen ejecutivo (3 cards bajo el título del hero) ────────────────── */

.cmp-summary {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 880px;
}

.cmp-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    transition: transform 280ms ease, background 280ms ease;
    animation: cmpSummaryIn 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cmp-summary-card:nth-child(1) { animation-delay: 80ms; }
.cmp-summary-card:nth-child(2) { animation-delay: 160ms; }
.cmp-summary-card:nth-child(3) { animation-delay: 240ms; }

@keyframes cmpSummaryIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cmp-summary-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cmp-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(94, 234, 212, 0.22);
    color: #ccfbf1;
    flex-shrink: 0;
}

.cmp-summary-body {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.cmp-summary-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 4px;
}

.cmp-summary-value {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Empty / loading ──────────────────────────────────────────────────── */

.cmp-empty {
    max-width: 560px;
    margin: 64px auto 0;
    text-align: center;
    padding: 56px 32px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--cmp-ink-200);
    box-shadow: 0 18px 40px -20px rgba(15, 23, 42, 0.1);
}

.cmp-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--cmp-accent-soft);
    color: var(--cmp-accent-strong);
    margin-bottom: 22px;
}

.cmp-empty-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 23px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--cmp-ink-900);
}

.cmp-empty-sub {
    color: var(--cmp-ink-500);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0 0 26px;
}

.cmp-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cmp-accent), var(--cmp-accent-strong));
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 10px 22px -6px rgba(13, 148, 136, 0.5);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 280ms ease;
}

.cmp-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -8px rgba(13, 148, 136, 0.6);
}

.cmp-empty--loading .cmp-empty-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid var(--cmp-accent-soft);
    border-top-color: var(--cmp-accent);
    animation: cmpSpin 0.9s linear infinite;
    margin: 0 auto 18px;
}
.cmp-empty--loading .cmp-empty-msg { color: var(--cmp-ink-500); font-size: 14px; }

@keyframes cmpSpin { to { transform: rotate(360deg); } }


/* ══════════════════════════════════════════════════════════════════════════
   CUERPO COMPARATIVO
   ══════════════════════════════════════════════════════════════════════════ */

.cmp-body {
    max-width: 1320px;
    margin: -32px auto 0;     /* lifteamos el cuerpo sobre el hero */
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.cmp-scroller {
    background: #fff;
    border-radius: 24px;
    box-shadow:
        0 30px 60px -30px rgba(15, 23, 42, 0.18),
        0 8px 24px -12px rgba(15, 23, 42, 0.08);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--cmp-ink-200) transparent;
}

.cmp-scroller::-webkit-scrollbar { height: 10px; }
.cmp-scroller::-webkit-scrollbar-thumb {
    background: var(--cmp-ink-200);
    border-radius: 999px;
}
.cmp-scroller::-webkit-scrollbar-thumb:hover { background: var(--cmp-ink-400); }

.cmp-table {
    --cmp-label-w: 200px;
    display: grid;
    grid-template-columns:
        var(--cmp-label-w)
        repeat(var(--cmp-cols, 1), minmax(260px, 1fr));
    min-width: max-content;  /* permite que el grid empuje el scroller */
}

/* ── Rail de inmuebles (header sticky) ────────────────────────────────── */

.cmp-rail {
    display: contents;
}

.cmp-rail > .cmp-rail-card,
.cmp-rail > .cmp-rail-spacer {
    /* top: 64px porque la navbar global (.lc-navbar) es sticky con height
       64px en desktop. Sin este offset las property-cards quedarían tapadas
       por la navbar al scrollear. */
    position: sticky;
    top: 64px;
    z-index: 6;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--cmp-ink-200);
}

.cmp-rail-spacer {
    background: #f8fafc;
    border-right: 1px solid var(--cmp-ink-200);
}

.cmp-rail-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 18px 18px 16px;
    border-right: 1px solid var(--cmp-ink-100);
    animation: cmpRailIn 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--cmp-col, 0) * 70ms);
}

.cmp-rail-card:last-child { border-right: none; }

@keyframes cmpRailIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cmp-rail-photo {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 140px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    text-decoration: none;
    margin-bottom: 14px;
    box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.2);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cmp-rail-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cmp-rail-photo:hover img { transform: scale(1.06); }
.cmp-rail-photo:hover { transform: translateY(-2px); }

.cmp-rail-photo-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8;
}

.cmp-rail-photo-badge {
    position: absolute;
    top: 8px; left: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.45);
}

.cmp-rail-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cmp-rail-price {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--cmp-accent-strong);
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.cmp-rail-price-period {
    color: var(--cmp-ink-500);
    font-size: 12px;
    font-weight: 500;
    margin-left: 2px;
}

.cmp-rail-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 6px;
    color: var(--cmp-ink-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cmp-rail-loc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 10px;
    color: var(--cmp-ink-500);
    font-size: 12px;
    line-height: 1.3;
}

.cmp-rail-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--cmp-ink-700);
    font-size: 11.5px;
    font-weight: 500;
}

.cmp-rail-quick span {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cmp-accent-soft);
    color: var(--cmp-accent-strong);
    font-weight: 600;
}

.cmp-rail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.cmp-rail-cta {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--cmp-accent);
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: background 200ms ease, transform 200ms ease;
}

.cmp-rail-cta:hover {
    background: var(--cmp-accent-strong);
    transform: translateY(-1px);
}

.cmp-rail-remove {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid var(--cmp-ink-200);
    color: var(--cmp-ink-500);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 200ms ease;
}

.cmp-rail-remove:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* ── Section ──────────────────────────────────────────────────────────── */

.cmp-section { display: contents; }

.cmp-section-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 24px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid var(--cmp-ink-100);
    border-bottom: 1px solid var(--cmp-ink-200);
    /* Sin sticky: el rail (property cards) ya es sticky y eso es suficiente
       referencia. Hacer sticky también las section-heads requiere calcular
       el offset exacto del rail dinámicamente, fragil. */
}

.cmp-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--cmp-accent-soft);
    color: var(--cmp-accent-strong);
    flex-shrink: 0;
}

.cmp-section-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cmp-ink-900);
    margin: 0;
}

.cmp-section-body { display: contents; }

/* ── Filas comparativas ──────────────────────────────────────────────── */

.cmp-row {
    display: contents;
}

.cmp-cell {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cmp-ink-700);
    transition: background 220ms ease;
    scroll-snap-align: start;
    position: relative;
    z-index: 1;
}

.cmp-row:hover .cmp-cell:not(.cmp-cell--label) {
    background: #f8fafc;
}

.cmp-cell--label {
    background: #fafbfc;
    font-weight: 600;
    color: var(--cmp-ink-500);
    font-size: 12px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    border-right: 1px solid var(--cmp-ink-100);
    /* Sticky horizontal: la columna etiqueta queda visible cuando el
       usuario scrollea las columnas lateralmente en mobile. */
    position: sticky;
    left: 0;
    z-index: 2;
    justify-content: center;  /* etiqueta centrada verticalmente — mejor con celdas altas */
}

.cmp-row:hover .cmp-cell--label { background: #f1f5f9; }

.cmp-cell__value {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--cmp-ink-900);
    letter-spacing: -0.005em;
    font-variant-numeric: tabular-nums;
}

.cmp-cell__value--empty {
    color: var(--cmp-ink-400);
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.cmp-cell--winner {
    background: var(--cmp-win-bg) !important;
    position: relative;
}

.cmp-cell--winner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 3px solid var(--cmp-win-border);
    pointer-events: none;
}

.cmp-cell--winner .cmp-cell__value { color: var(--cmp-win-text); }

.cmp-cell__winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 7px;
    background: var(--cmp-win-border);
    color: white;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    width: max-content;
    box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.5);
    animation: cmpWinnerIn 480ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cmpWinnerIn {
    from { opacity: 0; transform: translateY(4px) scale(0.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Amenities ───────────────────────────────────────────────────────── */

.cmp-row--amenities .cmp-cell { padding: 18px 20px; }

.cmp-amenity-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.cmp-amenity-count {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--cmp-accent-strong);
    font-size: 14px;
    margin-right: 4px;
    font-variant-numeric: tabular-nums;
}

.cmp-amenity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 4px 7px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    transition: background 180ms ease, transform 180ms ease;
}

.cmp-amenity--yes {
    background: rgba(20, 184, 166, 0.1);
    color: var(--cmp-accent-strong);
    border-color: rgba(20, 184, 166, 0.25);
}

.cmp-amenity--yes:hover {
    background: rgba(20, 184, 166, 0.18);
    transform: translateY(-1px);
}

.cmp-amenity-empty {
    font-size: 12.5px;
    color: var(--cmp-ink-400);
    font-style: italic;
}

/* ── CTAs finales ────────────────────────────────────────────────────── */

.cmp-final { display: contents; }

.cmp-final-spacer {
    background: #f8fafc;
    border-right: 1px solid var(--cmp-ink-100);
    position: sticky;
    left: 0;
    z-index: 2;
}

.cmp-final-cell {
    padding: 22px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-right: 1px solid var(--cmp-ink-100);
}

.cmp-final-cell:last-child { border-right: none; }

.cmp-final-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cmp-accent), var(--cmp-accent-strong));
    color: white;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow:
        0 10px 22px -8px rgba(13, 148, 136, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 280ms ease;
}

.cmp-final-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 30px -10px rgba(13, 148, 136, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── Mobile hint + disclaimer ──────────────────────────────────────────── */

.cmp-mobile-hint {
    display: none;
    margin-top: 14px;
    color: var(--cmp-ink-400);
    font-size: 12px;
    align-items: center;
    gap: 6px;
}

.cmp-disclaimer {
    max-width: 880px;
    margin: 24px auto 0;
    text-align: center;
    color: var(--cmp-ink-400);
    font-size: 12px;
    line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .cmp-table { --cmp-label-w: 140px; }
    .cmp-cell { padding: 13px 14px; font-size: 13.5px; }
    .cmp-cell__value { font-size: 14px; }
    .cmp-section-head { padding: 14px 16px 10px; }
    .cmp-rail-card { padding: 14px 14px 12px; }
    .cmp-rail-price { font-size: 17px; }
    .cmp-rail-title { font-size: 13.5px; }
    .cmp-body { padding: 0 12px; margin-top: -20px; }
    .cmp-scroller { border-radius: 18px; }
    .cmp-mobile-hint { display: inline-flex; }
}

@media (max-width: 600px) {
    .cmp-table { --cmp-label-w: 116px; grid-template-columns: var(--cmp-label-w) repeat(var(--cmp-cols, 1), 220px); }
    .cmp-cell--label { font-size: 11px; padding: 10px 12px; }
    .cmp-hero { padding: 32px 16px 28px; }
    .cmp-summary { grid-template-columns: 1fr; }
    .cmp-hero-row { flex-direction: column; align-items: flex-start; }
    .cmp-hero-actions { width: 100%; flex-wrap: wrap; }
    .cmp-action-btn { flex: 1; justify-content: center; min-width: 0; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .cmp-bar { transition: opacity 200ms ease; transform: translate(-50%, 0); }
    .cmp-bar__glow { animation: none; }
    .cmp-bar__cta-shine { animation: none !important; }
    .cmp-bar__slot { animation: none; }
    .cmp-hero-eyebrow-dot { animation: none; }
    .cmp-summary-card { animation: none; }
    .cmp-rail-card { animation: none; }
    .cmp-cell__winner-badge { animation: none; }
}

/* ── Print ─────────────────────────────────────────────────────────────── */

@media print {
    .cmp-bar,
    .cmp-action-btn,
    .cmp-rail-remove,
    .cmp-rail-cta,
    .cmp-mobile-hint,
    .li-compare-check,
    .cmp-final-cta { display: none !important; }

    .cmp-page {
        background: white !important;
        padding: 0 !important;
    }
    .cmp-hero {
        background: white !important;
        color: var(--cmp-ink-900) !important;
        padding: 16px 20px !important;
    }
    .cmp-hero-title,
    .cmp-hero-sub { color: var(--cmp-ink-900) !important; text-shadow: none !important; }
    .cmp-breadcrumb,
    .cmp-breadcrumb a { color: var(--cmp-ink-500) !important; }
    .cmp-summary-card { background: #f1f5f9 !important; color: var(--cmp-ink-900) !important; border-color: #e2e8f0 !important; }
    .cmp-summary-label,
    .cmp-summary-value { color: var(--cmp-ink-900) !important; }
    .cmp-scroller {
        overflow: visible !important;
        box-shadow: none !important;
        border: 1px solid var(--cmp-ink-200);
    }
    .cmp-body { margin-top: 0 !important; padding: 0 20px; }
    .cmp-rail > .cmp-rail-card,
    .cmp-rail > .cmp-rail-spacer,
    .cmp-cell--label,
    .cmp-section-head { position: static !important; }
    .cmp-rail-photo:hover img { transform: none; }
}
