body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
}

.container {
    position: relative;
}

.imagen {
    max-width: 100%;
    height: auto;
}

.fondo {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    transition: width 1s ease;
    z-index: 1;
}

.fondo.activo {
    width: 30%;
}

.texto {
    position: absolute;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    color: white;
    font-size: 2em;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 2;
}

.texto.activo {
    opacity: 1;
}
