/* ════════════════════════════════════════════════════════════════
   Sellaris · Ecosistema (Home)
   Banda oscura "cinemática" con el works wheel + tarjetas de producto.
   Se ve igual en tema claro y oscuro a propósito: funciona como un
   bloque de producto premium dentro de la página.
   ════════════════════════════════════════════════════════════════ */

@property --ww-accent {
    syntax: '<color>';
    inherits: true;
    initial-value: #f97316;
}

.eco-section {
    --eco-bg: #05060b;
    --eco-line: rgba(255, 255, 255, 0.08);
    --eco-text: #f1f5f9;
    --eco-muted: #94a3b8;
    --eco-dim: #64748b;
    --eco-ecom: #f97316;
    --eco-ecom-2: #fb923c;
    --eco-agentis: #a855f7;
    --eco-agentis-2: #c084fc;
    --eco-erp: #0ea5e9;
    --eco-erp-2: #3b82f6;
}

.eco-shell {
    position: relative;
    margin-inline: 0.75rem;
    border-radius: 2.5rem;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(249, 115, 22, 0.10), transparent 60%),
        radial-gradient(1000px 600px at 110% 30%, rgba(168, 85, 247, 0.10), transparent 60%),
        radial-gradient(900px 600px at 50% 110%, rgba(14, 165, 233, 0.10), transparent 60%),
        var(--eco-bg);
    color: var(--eco-text);
    border: 1px solid var(--eco-line);
    box-shadow: 0 60px 140px -40px rgba(2, 6, 23, 0.55);
    /* clip (no hidden): hidden crearía un contenedor de scroll y rompería el sticky */
    overflow: clip;
    isolation: isolate;
}

@media (min-width: 768px) {
    .eco-shell { margin-inline: 1.5rem; border-radius: 3rem; }
}

/* Grilla técnica sutil de fondo */
.eco-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
    pointer-events: none;
    z-index: -1;
}

/* ── Encabezado ─────────────────────────────────────────────── */
.eco-head {
    max-width: 56rem;
    margin: 0 auto;
    padding: 6rem 1.5rem 1rem;
    text-align: center;
}

.eco-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem 0.45rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--eco-line);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.01em;
}

.eco-eyebrow-dots { display: inline-flex; }
.eco-eyebrow-dots span {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    border: 2px solid var(--eco-bg);
    margin-left: -0.2rem;
}
.eco-eyebrow-dots span:first-child { margin-left: 0; background: var(--eco-ecom); }
.eco-eyebrow-dots span:nth-child(2) { background: var(--eco-agentis); }
.eco-eyebrow-dots span:nth-child(3) { background: var(--eco-erp); }

.eco-title {
    margin-top: 1.5rem;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.045em;
    color: #fff;
}

.eco-title-grad {
    background: linear-gradient(90deg, var(--eco-ecom-2), var(--eco-agentis-2) 50%, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: eco-shine 8s ease-in-out infinite alternate;
}

@keyframes eco-shine {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

.eco-lead {
    margin: 1.5rem auto 0;
    max-width: 42rem;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.65;
    color: var(--eco-muted);
}
.eco-lead strong { color: #e2e8f0; font-weight: 700; }

/* ── Track + escenario sticky ───────────────────────────────── */
.eco-track {
    position: relative;
    --ww-m: 0;
    /* Debe coincidir con data-step-vh / data-hold-vh: 100 + pasos·45 + 2·25 */
    height: calc(100vh + var(--eco-steps, 9) * 45vh + 50vh);
    height: calc(100svh + var(--eco-steps, 9) * 45svh + 50svh);
}

.eco-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    outline: none;
}

.eco-stage:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }

/* Halo del color de la app al frente */
.eco-stage::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(70vw, 900px);
    aspect-ratio: 1.6;
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--ww-accent) 28%, transparent), transparent);
    opacity: calc(0.35 + var(--ww-m) * 0.65);
    filter: blur(20px);
    transition: --ww-accent 0.8s ease;
    pointer-events: none;
}

.eco-wheel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
}

.eco-track.is-narrow .eco-wheel { top: 40%; }

.eco-card {
    position: absolute;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    text-decoration: none;
    color: inherit;
    will-change: transform;
}

.eco-card-face {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #0b1020;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 30px 60px -25px rgba(0, 0, 0, 0.8),
        0 0 0 1px color-mix(in srgb, var(--card-accent) 18%, transparent);
    transform-origin: center;
}

.eco-card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.eco-card-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(3, 6, 15, 0.85));
    pointer-events: none;
}

.eco-card-chip {
    position: absolute;
    left: 0.75rem;
    bottom: 0.7rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem 0.3rem 0.3rem;
    border-radius: 999px;
    background: rgba(5, 8, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.eco-card-chip img,
.eco-card-chip .eco-s-tile {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.4rem;
    object-fit: cover;
}

.eco-card-chip i {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--card-accent);
    box-shadow: 0 0 10px var(--card-accent);
}

.eco-card-action {
    position: absolute;
    right: 0.75rem;
    bottom: 0.7rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 0.7rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.eco-card:hover .eco-card-action,
.eco-card:focus-visible .eco-card-action { opacity: 1; transform: none; }

.eco-card:focus-visible { outline: none; }
.eco-card:focus-visible .eco-card-face { box-shadow: 0 0 0 3px var(--card-accent); }

/* Isotipo "S" de Sellaris E-commerce */
.eco-s-tile {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: #fff;
    font-weight: 900;
    line-height: 1;
}

/* ── Título del anillo ──────────────────────────────────────── */
.eco-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    pointer-events: none;
}

.eco-track.is-narrow .eco-ring-label { padding-bottom: 20vh; }

.eco-ring-brand {
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #fff;
    line-height: 1;
}

.eco-ring-sub {
    margin-top: 0.6rem;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    font-weight: 600;
    color: var(--eco-muted);
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
}
.eco-ring-sub b { font-weight: 700; }
.eco-ring-sub .c-ecom { color: var(--eco-ecom-2); }
.eco-ring-sub .c-agentis { color: var(--eco-agentis-2); }
.eco-ring-sub .c-erp { color: #38bdf8; }

/* ── Panel del ítem al frente ───────────────────────────────── */
.eco-front {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50% - var(--ww-card-w, 30vw) / 2 - 5% - 2.5rem);
    max-width: 24rem;
    display: grid;
    pointer-events: none;
    opacity: 0;
}

.eco-front-item {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.eco-front-item.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.eco-front-app {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--item-accent);
}
.eco-front-app i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--item-accent);
    box-shadow: 0 0 12px var(--item-accent);
}

.eco-front-num {
    margin-left: 0.35rem;
    color: var(--eco-dim);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.eco-front-title {
    margin-top: 0.75rem;
    font-size: clamp(1.6rem, 2.6vw, 2.5rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: #fff;
}

.eco-front-desc {
    margin-top: 0.9rem;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--eco-muted);
}

.eco-front-link {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--item-accent) 60%, transparent);
    padding-bottom: 0.15rem;
    transition: gap 0.2s ease, border-color 0.2s ease;
}
.eco-front-link:hover { gap: 0.7rem; border-color: var(--item-accent); }

.eco-track.is-narrow .eco-front {
    left: 0;
    right: 0;
    top: auto;
    bottom: 7%;
    transform: none;
    width: auto;
    max-width: none;
    padding: 0 1.5rem;
    text-align: center;
}
.eco-track.is-narrow .eco-front-title { font-size: 1.5rem; margin-top: 0.5rem; }
.eco-track.is-narrow .eco-front-desc { font-size: 0.9rem; margin-top: 0.5rem; max-width: 26rem; margin-inline: auto; }
.eco-track.is-narrow .eco-front-link { display: none; }

/* ── Índice lateral ─────────────────────────────────────────── */
.eco-index {
    position: absolute;
    right: 3%;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50% - var(--ww-card-w, 30vw) / 2 - 3% - 2.5rem);
    max-width: 15rem;
    text-align: right;
    font-size: 0.82rem;
}

.eco-track.is-narrow .eco-index { display: none; }

.eco-index-group + .eco-index-group { margin-top: 1.1rem; }

.eco-index-app {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--eco-dim);
    letter-spacing: 0.02em;
}
.eco-index-app i { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: var(--group-accent); }

.eco-index button {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.18rem 0;
    color: #475569;
    font-weight: 500;
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.25s ease;
}
.eco-index button:hover { color: #cbd5e1; }
.eco-index button.is-active { color: #fff; font-weight: 700; transform: translateX(-4px); }
.eco-index button.is-active::after {
    content: '';
    display: inline-block;
    width: 0.9rem;
    height: 2px;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-radius: 2px;
    background: var(--group-accent);
}
.eco-index button:focus-visible { outline: 1px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ── Progreso + pista ───────────────────────────────────────── */
.eco-progress-wrap {
    position: absolute;
    left: 50%;
    bottom: 2.25rem;
    width: min(320px, 50vw);
    height: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    opacity: calc(var(--ww-m) * 1);
}
.eco-track.is-narrow .eco-progress-wrap { bottom: 2.5%; }

.eco-progress {
    position: absolute;
    inset: 0;
    transform-origin: left;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--eco-ecom), var(--eco-agentis) 50%, var(--eco-erp));
}

.eco-hint {
    position: absolute;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--eco-dim);
    pointer-events: none;
}

.eco-hint-mouse {
    width: 1.3rem;
    height: 2rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    position: relative;
}
.eco-hint-mouse::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0.35rem;
    width: 3px;
    height: 0.4rem;
    margin-left: -1.5px;
    border-radius: 3px;
    background: #fff;
    animation: eco-wheel-dot 1.6s ease-in-out infinite;
}

@keyframes eco-wheel-dot {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(0.55rem); }
}

/* Antes de que el JS mida, evitar el "salto" de las tarjetas */
.eco-track:not(.is-ready) .eco-wheel { opacity: 0; }
.eco-wheel { transition: opacity 0.4s ease; }

/* ── Tarjetas de producto ───────────────────────────────────── */
.eco-products {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
}

@media (min-width: 768px) {
    .eco-products { padding: 2rem 2.5rem 6.5rem; }
}

.eco-products-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.eco-products-head h3 {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    color: #fff;
}
.eco-products-head p { margin-top: 0.6rem; color: var(--eco-muted); }

.eco-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .eco-grid { grid-template-columns: repeat(3, 1fr); }
}

.eco-product {
    --mx: 50%;
    --my: 0%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    border-radius: 1.75rem;
    background:
        radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--p-accent) 14%, transparent), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--eco-line);
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}

.eco-product::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    right: 1.75rem;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--p-accent), transparent);
    opacity: 0.8;
}

.eco-product:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--p-accent) 40%, transparent);
    box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--p-accent) 55%, transparent);
}

.eco-product-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.eco-product-logo {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--p-accent) 70%, transparent);
}
.eco-product-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eco-product-logo .eco-s-tile { width: 100%; height: 100%; font-size: 1.6rem; }

.eco-product-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: var(--p-accent-2);
    background: color-mix(in srgb, var(--p-accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--p-accent) 30%, transparent);
    white-space: nowrap;
}

.eco-product-name {
    margin-top: 1.4rem;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.035em;
    color: #fff;
}

.eco-product-tag {
    margin-top: 0.15rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-accent-2);
}

.eco-product-desc {
    margin-top: 0.9rem;
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--eco-muted);
}

.eco-product-features {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.55rem;
}

.eco-product-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.eco-product-features svg {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--p-accent-2);
}

.eco-product-chips {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.eco-product-chips span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--eco-line);
}

.eco-product-foot {
    margin-top: auto;
    padding-top: 1.5rem;
}

.eco-product-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--eco-line);
}
.eco-product-stat b {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fff;
}
.eco-product-stat span { font-size: 0.82rem; color: var(--eco-muted); }

.eco-product-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.eco-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1.2rem;
    border-radius: 0.9rem;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.eco-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--p-accent-2), var(--p-accent));
    box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--p-accent) 80%, transparent);
}
.eco-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35), transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}
.eco-btn-primary:hover { transform: translateY(-2px); }
.eco-btn-primary:hover::before { transform: translateX(120%); }

.eco-btn-ghost {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--eco-line);
}
.eco-btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.eco-btn svg { width: 1rem; height: 1rem; transition: transform 0.25s ease; }
.eco-btn:hover svg { transform: translateX(3px); }

.eco-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Franja de confianza */
.eco-trust {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 2rem;
    font-size: 0.85rem;
    color: var(--eco-muted);
}
.eco-trust span { display: inline-flex; align-items: center; gap: 0.5rem; }
.eco-trust svg { width: 1rem; height: 1rem; color: #4ade80; }

/* ── Movimiento reducido ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .eco-title-grad,
    .eco-hint-mouse::after { animation: none; }
    .eco-front-item,
    .eco-product,
    .eco-btn,
    .eco-btn-primary::before { transition: none; }
}
