.mariposa_fija {
    position: absolute;
    top: 10px;
    left: 55px;
    width: 50px;
    height: 70px;
    z-index: 2;
    opacity: 0.4;
}


.butterfly {
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('mariposa.png') no-repeat;
    display: none;
}


/* Mariposa giratoria */
.butterfly1 {
    position: absolute;
    display:none;
    left: 55px;
    width: 50px;
    height: 70px;
    z-index: 160;
    transition: top 0.8s ease-in-out, left 0.8s ease-in-out; 
    /*
    transform: translateX(-50%) scale(0.5);
    animation: girarYvolar 80s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 200, 255, 0.6));
    */
}


/* Alas generales */
.wing {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 100px;
    transform: translateY(-50%);
    z-index: 1;
}

/* Ala izquierda (reflejada con scaleX) */
.left-wing {
    position: absolute;
    width: 50px;
    height: 80px;
    left: 0;
    transform: scaleX(-1);
    transform-origin: 0% 50%; /* ← Este es el truco correcto */
    z-index: 1;
    animation: flapLeft var(--animation-speed) infinite ease-in-out;
}


/* Ala derecha (normal) */
.right-wing {
    position: absolute;
    width: 50px;
    height: 80px;
    left: 1px;
    transform-origin: 0% 50%;
    z-index: 1;
    animation: flapRight var(--animation-speed) infinite ease-in-out;
}

/* Aleteo de ala izquierda */
@keyframes flapLeft {
    0%   { transform: translateY(-50%) rotateY(0deg) scaleX(-1); }
    50%  { transform: translateY(-50%) rotateY(80deg) scaleX(-1); }
    100% { transform: translateY(-50%) rotateY(0deg) scaleX(-1); }
}

/* Aleteo de ala derecha */
@keyframes flapRight {
    0%   { transform: translateY(-50%) rotateY(0deg) scaleX(1); }
    50%  { transform: translateY(-50%) rotateY(-90deg) scaleX(1); }
    100% { transform: translateY(-50%) rotateY(0deg) scaleX(1); }
}

/* Vuelo rotativo y desplazamiento de la mariposa */
@keyframes girarYvolar {
    0%   { transform: translateX(-50%) rotate(180deg) scale(0.8); }
    47%  { transform: translateX(-10%) rotate(180deg) scale(0.8); }
    50%  { transform: translateX(10%) rotate(20deg) scale(0.8); }
    97%  { transform: translateX(-10%) rotate(0deg) scale(0.8); }
    100% { transform: translateX(-50%) rotate(180deg) scale(0.8); }
}


.wing-rapido  { --animation-speed: 0.20s; }
.wing-normal  { --animation-speed: 0.4s; }
.wing-lento   { --animation-speed: 4.2s; }


@media screen and (min-width: 820px) {

.mariposa_fija {
    position: absolute;
    top: 10px;
    left: 160px;
    width: 50px;
    height: 70px;
    z-index: 2;
    opacity: 0.4;
}

}