/* ══════════════════════════════════════════════════════════════════════
   SECCIÓN "DIFERENCIAL" — layer encima del CSS existente del Home.
   ══════════════════════════════════════════════════════════════════════
   Refactor visual + copy de la sección "Por qué Listo Casas". Mantiene el
   visual comparativo (antes/después) y suma:
     - Header centrado con badge + título grande + lead
     - Grid de 5 pilares con íconos SVG, número y micro-explicación
     - Card CTA al final del grid (6to slot)
   Animaciones: data-reveal + stagger entrance via --i.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Header centrado (compactado) ─────────────────────────────────────── */
.diff-header {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
    position: relative;
    z-index: 2;
}
.diff-header .diff-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(94, 234, 212, 0.18));
    color: #0f766e;
    border: 1px solid rgba(13, 148, 136, 0.22);
    margin-bottom: 14px;
    /* Float-in con el dot pulsando — atrae el ojo sin sobrecargar. */
    animation: diffBadgeIn 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.diff-header .diff-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin: 0 0 12px;
}
.diff-lead {
    font-size: clamp(14px, 1.5vw, 16px);
    line-height: 1.55;
    color: #475569;
    margin: 0 auto;
    max-width: 620px;
}
.diff-lead strong {
    color: #0f766e;
    font-weight: 700;
}

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

/* Sub-header del bloque comparativo (a la izquierda del visual). */
.diff-side-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(13, 148, 136, 0.08);
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.diff-subtitle {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 16px;
}

/* ══════════════════════════════════════════════════════════════════════
   GRID DE 5 PILARES + CTA — versión compacta con más microinteracciones
   ══════════════════════════════════════════════════════════════════════ */
.diff-pillars {
    margin-top: 24px;
    position: relative;
    z-index: 2;
}
.diff-pillars__title {
    text-align: center;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 24px;
}
.diff-pillars__brand {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #5eead4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    background-size: 200% 100%;
    /* Animación shimmer continua sobre el degradé — muy sutil, no distrae. */
    animation: diffBrandShimmer 6s ease-in-out infinite;
}
@keyframes diffBrandShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.diff-pillars__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

/* ── Card individual de pilar — más compacta ─────────────────────────── */
.diff-pillar {
    position: relative;
    padding: 20px 20px 22px;
    background: white;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    box-shadow: 0 3px 14px -6px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    /* Stagger entrance: cada card aparece con un retraso de 70ms × su índice. */
    opacity: 0;
    transform: translateY(16px);
    animation: diffPillarIn 640ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(160ms + var(--i, 0) * 70ms);
    transition:
        transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 280ms ease,
        box-shadow 360ms ease;
}
@keyframes diffPillarIn {
    to { opacity: 1; transform: translateY(0); }
}

.diff-pillar:hover {
    transform: translateY(-6px);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow:
        0 24px 50px -12px rgba(13, 148, 136, 0.25),
        0 0 0 1px rgba(13, 148, 136, 0.12);
}

/* Halo teal sutil arriba a la derecha en hover. */
.diff-pillar::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 360ms ease;
    pointer-events: none;
}
.diff-pillar:hover::before { opacity: 1; }

.diff-pillar__num {
    position: absolute;
    top: 16px;
    right: 18px;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 0.04em;
    transition: color 280ms ease, transform 280ms ease;
}
.diff-pillar:hover .diff-pillar__num {
    color: #14b8a6;
    transform: scale(1.15);
}

.diff-pillar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(94, 234, 212, 0.18));
    color: #0d9488;
    margin-bottom: 14px;
    transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), background 280ms ease, box-shadow 280ms ease;
}
.diff-pillar:hover .diff-pillar__icon {
    transform: scale(1.1) rotate(-6deg);
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    box-shadow: 0 12px 26px -8px rgba(13, 148, 136, 0.55);
}

/* Sweep brillante que cruza la card en hover (de izquierda a derecha). */
.diff-pillar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(94, 234, 212, 0.16) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.diff-pillar:hover::after { transform: translateX(120%); }

.diff-pillar__title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: #0f172a;
    margin: 0 0 8px;
}
.diff-pillar__desc {
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
}
.diff-pillar__desc strong {
    color: #0f172a;
    font-weight: 700;
}

/* ── Card CTA (último slot del grid) ─────────────────────────────────── */
.diff-pillar--cta {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 60%, #0f766e 100%);
    color: white;
    border-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.diff-pillar--cta::before { display: none; }
.diff-pillar--cta .diff-pillar__num {
    position: static;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    margin-bottom: 6px;
}
.diff-pillar--cta .diff-pillar__title {
    color: white;
    font-size: 19px;
    margin-bottom: 10px;
}
.diff-pillar--cta .diff-pillar__desc {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13.5px;
    margin-bottom: 14px;
}
.diff-pillar--cta:hover {
    transform: translateY(-6px);
    box-shadow:
        0 28px 56px -14px rgba(13, 148, 136, 0.55),
        0 0 0 1px rgba(94, 234, 212, 0.3);
}
.diff-pillar--cta:hover .diff-pillar__num {
    color: white;
    transform: translateX(4px);
    transition: transform 280ms ease, color 280ms ease;
}

.diff-pillar__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 11px 20px;
    background: white;
    color: #0f766e;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}
.diff-pillar__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    color: #115e59;
}
.diff-pillar__cta svg { transition: transform 220ms ease; }
.diff-pillar__cta:hover svg { transform: translateX(3px); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .diff-pillars__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .diff-pillars { margin-top: 56px; }
}
@media (max-width: 640px) {
    .diff-pillars__grid { grid-template-columns: 1fr; gap: 14px; }
    .diff-pillar { padding: 22px 20px; }
    .diff-header { margin-bottom: 40px; }
}

/* ══════════════════════════════════════════════════════════════════════
   VIEWPORT — render condicional con animación de entrada.
   Sólo una vista en el DOM a la vez (gracias al @if del Razor + @key).
   Al cambiar diffVista, el nodo se re-monta y dispara diffViewIn que
   combina slide vertical sutil + fade + scale para un efecto premium.
   ══════════════════════════════════════════════════════════════════════ */
.diff-viewport {
    position: relative;
    /* overflow visible: con el render condicional, no hay slides laterales
       que recortar. overflow: hidden estaba cortando la fila inferior de
       las cards de pilares apenas en su borde inferior. */
    overflow: visible;
    /* padding-bottom para que el ::after del sweep en hover no se vea
       cortado por el borde del viewport en la última fila. */
    padding: 4px 0 8px;
}

.diff-view {
    width: 100%;
    will-change: opacity, transform;
}

.diff-view--enter {
    animation: diffViewIn 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes diffViewIn {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.985);
        filter: blur(6px);
    }
    60% { filter: blur(0); }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ── Paginador (prev + dots + next) ──────────────────────────────────── */
.diff-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.diff-pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: white;
    border: 1.5px solid rgba(13, 148, 136, 0.22);
    border-radius: 999px;
    color: #0f766e;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
        background 200ms ease,
        border-color 200ms ease,
        box-shadow 240ms ease;
    box-shadow: 0 4px 14px -6px rgba(13, 148, 136, 0.25);
}
.diff-pager__btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    border-color: transparent;
    box-shadow: 0 14px 30px -10px rgba(13, 148, 136, 0.55);
}
.diff-pager__btn:hover:not(:disabled) svg { transform: translateX(3px); }
.diff-pager__btn--prev:hover:not(:disabled) svg { transform: translateX(-3px); }
.diff-pager__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.diff-pager__btn svg { transition: transform 240ms ease; }

.diff-pager__btn--prev { padding: 11px 16px; }
.diff-pager__btn--prev:disabled { display: none; }

.diff-pager__dots {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.diff-pager__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.18);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 240ms ease, transform 240ms ease, width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.diff-pager__dot:hover { background: rgba(13, 148, 136, 0.4); transform: scale(1.15); }
.diff-pager__dot.is-active {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    width: 28px;
    border-radius: 5px;
}

@media (max-width: 640px) {
    .diff-pager__btn { font-size: 12.5px; padding: 9px 14px; }
    .diff-pager { gap: 10px; margin-top: 24px; }
}
