
/* =========================================================
   NIEVE NAVIDEÑA - DULCE NOVIEMBRE
   ========================================================= */

.nieve-capa {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    overflow: hidden;
}

/* =========================================================
   COPOS DE NIEVE
   ========================================================= */

.copo-navidad {
    position: absolute;
    top: -20px;
    color: #fff;
    opacity: .85;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(255,255,255,.8);

    animation: caerNieve linear forwards;
}

@keyframes caerNieve {

    0% {
        transform: translate3d(0, -10px, 0) rotate(0deg);
    }

    100% {
        transform: translate3d(
            var(--desplazamiento),
            110vh,
            0
        ) rotate(360deg);
    }

}

/* =========================================================
   NIEVE ACUMULADA
   ========================================================= */

.nieve-acumulada {
    position: fixed;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 0;

    z-index: 901;

    background: transparent;
    border: none;
    padding: 0;

    cursor: pointer;
    pointer-events: auto;

    transition: height 1.2s ease;

    overflow: visible;
}

/* MONTAÑAS DE NIEVE */

.nieve-monticulo {
    position: absolute;
    bottom: 0;

    height: 100%;

    background: #fff;

    box-shadow:
        0 -5px 15px rgba(255,255,255,.4),
        0 -2px 8px rgba(220,235,255,.5);

    pointer-events: none;
}

.nieve-izquierda {
    left: 0;
    width: 58%;

    border-radius: 0 55% 0 0 / 0 35% 0 0;

}

.nieve-derecha {
    right: 0;
    width: 58%;

    border-radius: 55% 0 0 0 / 35% 0 0 0;

}

/* =========================================================
   TEXTO PARA LIMPIAR
   ========================================================= */

.nieve-limpiar {
    position: absolute;
    z-index: 3;

    bottom: 15px;
    left: 50%;

    transform: translateX(-50%);

    background: #ae092b;
    color: white;

    border: none;
    border-radius: 30px;

    padding: 9px 20px;

    font-size: 12px;
    font-weight: bold;

    cursor: pointer;

    white-space: nowrap;

    opacity: 0;

    transition: opacity .3s ease;
}

.nieve-acumulada:hover .nieve-limpiar,
.nieve-acumulada:focus-visible .nieve-limpiar {
    opacity: 1;
}


/* =========================================================
   ANIMACIÓN: NIEVE CAYENDO AL LIMPIAR
   ========================================================= */

.nieve-acumulada.cayendo {
    pointer-events: none;
}

.nieve-acumulada.cayendo .nieve-izquierda {
    animation: nieveCaeIzquierda 1.1s ease-in forwards;
}

.nieve-acumulada.cayendo .nieve-derecha {
    animation: nieveCaeDerecha 1.1s ease-in forwards;
}

.nieve-acumulada.cayendo .nieve-limpiar {
    opacity: 0;
}

/* Montículo izquierdo */

@keyframes nieveCaeIzquierda {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }

    35% {
        transform: translateY(25px) rotate(-5deg);
        opacity: 1;
    }

    100% {
        transform: translateY(180px) rotate(12deg);
        opacity: 0;
    }
}

/* Montículo derecho */

@keyframes nieveCaeDerecha {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }

    35% {
        transform: translateY(30px) rotate(5deg);
        opacity: 1;
    }

    100% {
        transform: translateY(180px) rotate(-12deg);
        opacity: 0;
    }
}

/* Partículas de nieve */

.particula-nieve {
    position: fixed;
    z-index: 902;

    width: var(--tamano);
    height: var(--tamano);

    border-radius: 50%;
    background: white;

    pointer-events: none;

    animation: particulaCae 1.3s ease-in forwards;
}

@keyframes particulaCae {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform:
            translate(var(--movimiento-x), var(--movimiento-y))
            scale(.4);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    .nieve-limpiar {
        opacity: 1;
        bottom: 8px;
        padding: 7px 14px;
        font-size: 10px;
    }

}

/* ACCESIBILIDAD */

@media (prefers-reduced-motion: reduce) {

    .copo-navidad {
        animation: none;
        display: none;
    }

    .nieve-acumulada.cayendo .nieve-izquierda,
    .nieve-acumulada.cayendo .nieve-derecha {
        animation: none;
        opacity: 0;
    }

}


