/* ==============================
   SECCION MANTENIMIENTO
============================== */

.mantenimiento-section {
    background: linear-gradient(to bottom, #f4f4f4, #e9e9e9);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* TITULO PRINCIPAL */
.mantenimiento-titulo {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 3rem;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fad201;
    text-shadow:
        3px 3px 0 #000,
        6px 6px 15px rgba(0,0,0,.3);
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(40px);
}

/* TEXTO */
.mantenimiento-texto {
    max-width: 900px;
    margin: auto;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(40px);
}

/* CONTENEDOR COMPARACION */
.comparacion-container {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
}

/* TARJETAS */
.comparacion-card {
    text-align: center;
    transition: transform .4s ease;
    opacity: 0;
    transform: translateY(60px);
}

.comparacion-card:hover {
    transform: translateY(-10px);
}

/* TITULOS ANTES / DESPUES */
.estado {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.antes {
    color: #c0392b;
}

.despues {
    color: #27ae60;
}

/* IMAGENES */
.img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,.25);
}

.img-wrapper img {
    width: 100%;
    max-width: 500px;
    transition: transform .6s ease, filter .6s ease;
}

/* HOVER EFECTO */
.img-wrapper:hover img {
    transform: scale(1.1);
    filter: brightness(70%);
}

/* OVERLAY */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity .4s ease;
}

.img-wrapper:hover .overlay {
    opacity: 1;
}

/* ANIMACION REVEAL */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 1s ease;
}

/* RESPONSIVE */
@media (max-width: 768px) {

    .mantenimiento-titulo {
        font-size: 2.2rem;
    }

    .comparacion-container {
        gap: 50px;
    }

}

/* ===================================
   EFECTOS ELECTRICOS DE FONDO
=================================== */

.electricidad-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(255, 215, 0, 0.05) 0px,
        rgba(255, 215, 0, 0.05) 2px,
        transparent 2px,
        transparent 120px
    );
    animation: electricidadMove 6s linear infinite;
    z-index: 0;
}

@keyframes electricidadMove {
    from { transform: translateX(0); }
    to { transform: translateX(120px); }
}

/* FLASH DE ENERGIA */

.energia-flash {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,0,0.5) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 1;
}

.energia-flash.activo {
    animation: flashEnergia 0.8s ease-out forwards;
}

@keyframes flashEnergia {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* PARTICULAS */

.particulas-energia {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,0,0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: particulasMove 10s linear infinite;
    opacity: 0.3;
    z-index: 0;
}

@keyframes particulasMove {
    from { background-position: 0 0; }
    to { background-position: 0 100px; }
}

/* GLOW ELECTRICO EN DESPUES */

.despues {
    position: relative;
}

.despues.glow-activo {
    text-shadow:
        0 0 10px #27ae60,
        0 0 20px #27ae60,
        0 0 40px #27ae60,
        2px 2px 0 #000;
    transition: 0.4s;
}

/* EFECTO ELECTRICO EN IMAGEN DESPUES */

.comparacion-card:nth-child(2) .img-wrapper:hover {
    box-shadow:
        0 0 20px #27ae60,
        0 0 40px rgba(39,174,96,.7),
        0 15px 35px rgba(0,0,0,.25);
}

/* ASEGURAR CAPAS CORRECTAS */

.mantenimiento-section {
    position: relative;
    z-index: 1;
}

.mantenimiento-section > .container {
    position: relative;
    z-index: 3;
}

/* Fondo eléctrico detrás */
.electricidad-bg,
.particulas-energia {
    z-index: 1;
}

/* Flash encima de todo */
.energia-flash {
    z-index: 4;
}

/* GLOW ROJO EN ANTES */

.antes {
    position: relative;
}

.antes.glow-rojo {
    text-shadow:
        0 0 10px #c0392b,
        0 0 20px #c0392b,
        0 0 40px #c0392b,
        2px 2px 0 #000;
    animation: pulsoRojo 1.5s infinite alternate;
}

@keyframes pulsoRojo {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* IMAGEN ANTES CON TONO DAÑADO */

.comparacion-card:first-child .img-wrapper img {
    filter: grayscale(40%) brightness(85%);
}

/* ==============================
   EFECTO FALLA EN ANTES
============================== */

.antes.falla-activa {
    animation: falloParpadeo 0.4s infinite alternate;
}

@keyframes falloParpadeo {
    from {
        text-shadow:
            0 0 5px #c0392b,
            0 0 10px #c0392b;
        transform: translateX(0);
    }
    to {
        text-shadow:
            0 0 20px #ff0000,
            0 0 40px #ff0000;
        transform: translateX(-2px);
    }
}

/* Oscurecer imagen ANTES */
.comparacion-card:first-child .img-wrapper img.falla-img {
    animation: imagenFalla 0.6s infinite alternate;
}

@keyframes imagenFalla {
    from { filter: brightness(60%) contrast(120%); }
    to { filter: brightness(40%) contrast(140%); }
}


/* ==============================
   RAYO ELECTRICO ENTRE IMAGENES
============================== */

.rayo-energia {
    position: absolute;
    top: 55%;
    left: 25%;
    width: 50%;
    height: 4px;
    background: linear-gradient(to right, transparent, #ffff00, #00ff00, transparent);
    box-shadow: 0 0 20px #00ff00;
    transform: scaleX(0);
    transform-origin: left;
    z-index: 5;
}

.rayo-energia.activo {
    animation: rayoMover 0.6s forwards;
}

@keyframes rayoMover {
    from { transform: scaleX(0); opacity: 1; }
    to { transform: scaleX(1); opacity: 0; }
}


/* ==============================
   ENCENDIDO FUERTE EN DESPUES
============================== */

.despues.encendido {
    animation: encenderVerde 1s forwards;
}

@keyframes encenderVerde {
    0% {
        text-shadow: 0 0 5px #27ae60;
    }
    50% {
        text-shadow:
            0 0 20px #00ff00,
            0 0 40px #00ff00,
            0 0 60px #00ff00;
    }
    100% {
        text-shadow:
            0 0 10px #27ae60,
            2px 2px 0 #000;
    }
}

/* ==============================
   ANTES - FALLA CONSTANTE
============================== */

.antes {
    animation: vibracionConstante 1.5s infinite ease-in-out;
}

@keyframes vibracionConstante {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

/* Parpadeo rojo constante */
.antes {
    text-shadow:
        0 0 5px #c0392b,
        0 0 10px #c0392b,
        2px 2px 0 #000;
    animation: vibracionConstante 1.5s infinite,
               pulsoRojoConstante 2s infinite alternate;
}

@keyframes pulsoRojoConstante {
    from { text-shadow: 0 0 5px #c0392b, 0 0 10px #c0392b; }
    to { text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000; }
}

/* ==============================
   DESPUES - ENERGIA ACTIVA
============================== */


@keyframes energiaVerdeConstante {
    0% {
        text-shadow:
            0 0 5px #27ae60,
            2px 2px 0 #000;
    }
    100% {
        text-shadow:
            0 0 20px #00ff00,
            0 0 40px #00ff00,
            0 0 60px #00ff00,
            2px 2px 0 #000;
    }
}

/* =====================================
   LINEA ROJO -> VERDE TRANSICION
===================================== */

.linea-transicion {
    position: absolute;
    top: 55%;
    left: 20%;
    width: 60%;
    height: 5px;
    background: red;
    box-shadow: 0 0 15px red;
    transform: scaleX(0);
    transform-origin: left;
    z-index: 10;
    opacity: 0;
}

/* Animación completa */
.linea-transicion.activa {
    animation: moverLinea 1.2s forwards;
}

@keyframes moverLinea {
    0% {
        transform: scaleX(0);
        background: red;
        box-shadow: 0 0 20px red;
        opacity: 1;
    }

    50% {
        background: red;
        box-shadow: 0 0 40px red;
    }

    80% {
        background: lime;
        box-shadow: 0 0 40px lime;
    }

    100% {
        transform: scaleX(1);
        background: lime;
        box-shadow: 0 0 20px lime;
        opacity: 0;
    }
}

/* Iluminación fuerte en imagen DESPUES */

.img-wrapper.energia-final {
    box-shadow:
        0 0 25px lime,
        0 0 60px rgba(0,255,0,0.8),
        0 15px 35px rgba(0,0,0,.25);
    transition: 0.4s;
}

/* Brillo rojo fuerte en ANTES cuando inicia */

.antes.activando {
    text-shadow:
        0 0 20px red,
        0 0 40px red,
        2px 2px 0 #000;
}

/* =========================================
   FONDO ENERGIA INDUSTRIAL PRO
========================================= */

.mantenimiento-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,215,0,0.06), transparent 60%);
    animation: pulsoFondo 6s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulsoFondo {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.4; }
}

/* RAYOS DIAGONALES EN MOVIMIENTO */

.energia-dinamica {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,0,0.08) 0px,
        rgba(255,255,0,0.08) 2px,
        transparent 2px,
        transparent 80px
    );
    animation: moverRayos 12s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes moverRayos {
    from { transform: translateX(0) translateY(0); }
    to { transform: translateX(-200px) translateY(-200px); }
}

/* CHISPAS ELECTRICAS */

.chispas-electricas {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: moverChispas 8s linear infinite;
    opacity: 0.4;
    z-index: 1;
}

@keyframes moverChispas {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

/* ==============================
   SECCION TIPOS DE MANTENIMIENTO
============================== */

.mantenimiento-tipos {
    background: #0c0c0c;
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.tipos-titulo {
    text-align: center;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 2.8rem;
    letter-spacing: 3px;
    color: #fad201;
    margin-bottom: 80px;
    text-shadow: 3px 3px 0 #000;
}

.tipos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    max-width: 900px;
    margin: 0 auto; /* centra todo el bloque */
}

@media (max-width: 768px) {
    .tipos-grid {
        grid-template-columns: 1fr;
    }
}


.tipo-card {
    background: #1a1a1a;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: all .4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

.tipo-card:hover {
    transform: translateY(-15px);
    box-shadow:
        0 0 20px #fad201,
        0 20px 50px rgba(0,0,0,.6);
}

.tipo-card h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #fad201;
    margin: 25px 0 15px 0;
}

.tipo-card p {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    color: #ddd;
    line-height: 1.6;
}

.tipo-img img {
    width: 100%;
    max-width: 220px;
    transition: transform .4s ease;
}

.tipo-card:hover .tipo-img img {
    transform: scale(1.1);
}

/* Glow industrial */
.tipo-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.08), transparent 70%);
    animation: glowIndustrial 6s infinite ease-in-out;
    z-index: 0;
}

.tipo-card * {
    position: relative;
    z-index: 2;
}

@keyframes glowIndustrial {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.4; }
}

