/*
 * Autos Esquivel · Home energy split slider
 * Selector visual Gasolina / Eléctricos con divisor arrastrable.
 */

.ae-energy-split {
    --ae-energy-split: 50%;
    position: relative;
    min-height: clamp(300px, 31vw, 430px);
    margin-top: 34px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 0;
    background: #060708;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .18);
    color: #fff;
}

.ae-energy-split__scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: translateZ(0);
}

.ae-energy-split__scene::before,
.ae-energy-split__scene::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ae-energy-split__scene--gasoline {
    z-index: 1;
    background-image:
        linear-gradient(90deg, rgba(5, 6, 7, .94) 0%, rgba(5, 6, 7, .68) 30%, rgba(5, 6, 7, .12) 66%, rgba(5, 6, 7, .25) 100%),
        url('/images/hero-black-sports-car.jpg');
    background-position: center 54%;
}

.ae-energy-split__scene--gasoline::after {
    background:
        radial-gradient(circle at 68% 42%, rgba(192, 131, 72, .20), transparent 40%),
        linear-gradient(0deg, rgba(3, 4, 5, .72), transparent 55%);
}

.ae-energy-split__scene--electric {
    z-index: 2;
    clip-path: inset(0 0 0 var(--ae-energy-split));
    background-image:
        linear-gradient(270deg, rgba(4, 9, 14, .94) 0%, rgba(4, 9, 14, .62) 31%, rgba(4, 9, 14, .09) 68%, rgba(4, 9, 14, .24) 100%),
        url('/images/comercial/14.webp');
    background-position: center 48%;
    filter: saturate(.82) contrast(1.03);
    will-change: clip-path;
}

.ae-energy-split__scene--electric::before {
    background:
        linear-gradient(116deg, transparent 0 47%, rgba(92, 196, 255, .14) 47.2% 47.45%, transparent 47.7%),
        linear-gradient(0deg, rgba(3, 8, 12, .78), transparent 58%);
}

.ae-energy-split__scene--electric::after {
    background: radial-gradient(circle at 34% 42%, rgba(72, 183, 255, .21), transparent 42%);
}

.ae-energy-split__content {
    position: relative;
    z-index: 3;
    width: min(45%, 520px);
    padding: clamp(28px, 4vw, 58px);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .38);
}

.ae-energy-split__content--electric {
    margin-left: auto;
    text-align: right;
}

.ae-energy-split__eyebrow {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, .68);
    font-family: inherit;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.ae-energy-split__title {
    display: block;
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: clamp(38px, 5vw, 72px);
    font-weight: 760;
    line-height: .9;
    letter-spacing: -.055em;
}

.ae-energy-split__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.ae-energy-split__cta::after {
    content: "→";
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .34);
    background: rgba(0, 0, 0, .22);
    font-size: 18px;
    letter-spacing: 0;
    transition: transform .2s ease, background .2s ease;
}

.ae-energy-split__scene:hover .ae-energy-split__cta::after {
    transform: translateX(3px);
    background: rgba(255, 255, 255, .12);
}

.ae-energy-split__divider {
    position: absolute;
    z-index: 8;
    top: 0;
    bottom: 0;
    left: var(--ae-energy-split);
    width: 76px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    cursor: ew-resize;
    touch-action: none;
    transform: translateX(-50%);
    user-select: none;
    -webkit-user-select: none;
}

.ae-energy-split__divider::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, .96);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, .16),
        0 0 22px rgba(255, 255, 255, .34);
    transform: translateX(-50%);
}

.ae-energy-split__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .80);
    border-radius: 0;
    background: rgba(7, 9, 11, .80);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .34);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translate(-50%, -50%);
}

.ae-energy-split__handle::before,
.ae-energy-split__handle::after {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.ae-energy-split__handle::before { content: "←"; }
.ae-energy-split__handle::after { content: "→"; }

.ae-energy-split__hint {
    position: absolute;
    top: 20px;
    left: 50%;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .20);
    background: rgba(4, 5, 6, .60);
    color: rgba(255, 255, 255, .78);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(-50%);
    transition: opacity .2s ease, transform .2s ease;
}

.ae-energy-split.is-dragging .ae-energy-split__hint,
.ae-energy-split.has-interacted .ae-energy-split__hint {
    opacity: 0;
    transform: translate(-50%, -6px);
}

.ae-energy-split__divider:focus-visible .ae-energy-split__handle {
    outline: 3px solid rgba(255, 255, 255, .95);
    outline-offset: 4px;
}

.ae-energy-split.is-dragging .ae-energy-split__handle {
    background: rgba(5, 6, 8, .94);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .46), 0 0 22px rgba(255, 255, 255, .12);
}

html[data-theme="dark"] .ae-energy-split {
    border-color: rgba(255, 255, 255, .10);
    box-shadow: 0 30px 76px rgba(0, 0, 0, .36);
}

@media (max-width: 760px) {
    .ae-energy-split {
        min-height: 360px;
        margin-top: 24px;
    }

    .ae-energy-split__scene--gasoline {
        background-position: 58% center;
    }

    .ae-energy-split__scene--electric {
        background-position: 47% center;
    }

    .ae-energy-split__content {
        width: 48%;
        padding: 22px 18px;
    }

    .ae-energy-split__eyebrow {
        margin-bottom: 7px;
        font-size: 8px;
        letter-spacing: .11em;
    }

    .ae-energy-split__title {
        font-size: clamp(27px, 8vw, 42px);
    }

    .ae-energy-split__cta {
        gap: 7px;
        margin-top: 14px;
        font-size: 9px;
        letter-spacing: .07em;
    }

    .ae-energy-split__cta::after {
        width: 29px;
        height: 29px;
        font-size: 15px;
    }

    .ae-energy-split__divider {
        width: 62px;
    }

    .ae-energy-split__handle {
        width: 50px;
        height: 50px;
    }

    .ae-energy-split__hint {
        top: 14px;
        font-size: 8px;
    }
}

@media (max-width: 520px) {
    .ae-energy-split {
        min-height: 330px;
    }

    .ae-energy-split__content {
        width: 47%;
        padding-inline: 14px;
    }

    .ae-energy-split__title {
        font-size: clamp(24px, 8.2vw, 34px);
    }

    .ae-energy-split__cta {
        max-width: 108px;
        line-height: 1.25;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ae-energy-split__cta::after,
    .ae-energy-split__hint {
        transition: none;
    }
}
